root/platform/a650/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. screen_opened
  6. screen_rotated
  7. rec_switch_state
  8. get_vbatt_min
  9. 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 
  12 void startup()
  13 {
  14     long *bss = &link_bss_start;
  15 
  16     // sanity check
  17     if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)){
  18         started();
  19         shutdown();
  20     }
  21 
  22     // initialize .bss senment
  23     while (bss<&link_bss_end)
  24         *bss++ = 0;
  25 
  26 
  27     boot();
  28 }
  29 
  30 
  31 static const int fl_tbl[] = {7400, 8210, 9040, 9860, 10670, 12730, 14780, 16820, 18890, 21970, 25030, 29170, 36780, 44400};
  32 #define NUM_FL (int)(sizeof(fl_tbl)/sizeof(fl_tbl[0]))
  33 #define CF_EFL 47297
  34 
  35 const int zoom_points = NUM_FL;
  36 
  37 int get_effective_focal_length(int zp) {
  38     return (CF_EFL*get_focal_length(zp))/10000;
  39 }
  40 
  41 int get_focal_length(int zp) {
  42     if (zp<0) return fl_tbl[0];
  43     else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1];
  44     else return fl_tbl[zp];
  45 }
  46 
  47 int get_zoom_x(int zp) {
  48     if (zp<1) return 10;
  49     else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0];
  50     else return fl_tbl[zp]*10/fl_tbl[0];
  51 }
  52 
  53 int screen_opened(void) {
  54         return !(physw_status[0] & 0x04000000);
  55 }
  56 
  57 int screen_rotated(void) {
  58         return !(physw_status[0] & 0x08000000);
  59 }
  60 
  61 #if 0
  62 int rec_switch_state(void) {
  63 //    mode  = (physw_status[1] & 0x02000000)?MODE_PLAY:MODE_REC;
  64         return !(physw_status[1] & 0x02000000);
  65 }
  66 #endif
  67 
  68 long get_vbatt_min()
  69 {
  70     return 4550;
  71 }
  72 
  73 long get_vbatt_max()
  74 {
  75     return 5150;
  76 }

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