root/platform/m10/main.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. startup
  2. get_effective_focal_length
  3. get_focal_length
  4. get_zoom_x
  5. get_vbatt_min
  6. get_vbatt_max

   1 #include "lolevel.h"
   2 #include "platform.h"
   3 #include "core.h"
   4 #include "keyboard.h"
   5 
   6 
   7 extern long link_bss_start;
   8 extern long link_bss_end;
   9 extern void boot();
  10 
  11 void startup() {
  12     long *bss = &link_bss_start;
  13     // sanity check
  14     if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)) {
  15         started();
  16         shutdown();
  17     }
  18     // initialize .bss senment
  19     while (bss<&link_bss_end)
  20         *bss++ = 0;
  21     boot();
  22 }
  23 
  24 const int zoom_points = 1;
  25 extern int _GetLensCurrentFocalLength(void);
  26 extern int _GetLensWideFocalLength(void);
  27 
  28 int get_effective_focal_length(__attribute__ ((unused))int zp) {
  29     return _GetLensCurrentFocalLength() * 1600;
  30 }
  31 
  32 int get_focal_length(__attribute__ ((unused))int zp) {
  33     return _GetLensCurrentFocalLength() * 1000;
  34 }
  35 
  36 int get_zoom_x(__attribute__ ((unused))int zp) {
  37     return _GetLensCurrentFocalLength()*100 / (_GetLensWideFocalLength()*100);
  38 }
  39 
  40 long get_vbatt_min()
  41 {
  42     return 2*3300;
  43 }
  44 
  45 
  46 long get_vbatt_max()
  47 {
  48     return 2*4168;  // 4168 original battery just charged ASM1989
  49 }

/* [<][>][^][v][top][bottom][index][help] */