root/platform/ixus80_sd1100/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. rec_switch_state
  6. get_vbatt_min
  7. 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[] = {6200, 7230, 8295, 9681, 11614, 14303, 18600};
  32 #define NUM_FL (int)(sizeof(fl_tbl)/sizeof(fl_tbl[0]))
  33 #define CF_EFL 61291
  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 /*
  54 from memory browser physw_status[0-2]:
  55 
  56 play:
  57 216e 31c4
  58 d0d8 0fa4  //d0d8 0f84
  59 0000 8fff
  60 
  61 rec:
  62 21af 61c4
  63 e0d9 7fa4 // e0d9 7fa4
  64 0000 8fff
  65 
  66 */
  67 #if 0
  68 int rec_switch_state(void) {
  69 //    mode  = (physw_status[1] & 0x10000000)?MODE_PLAY:MODE_REC;
  70         return !(physw_status[1] & 0x10000000);
  71 }
  72 #endif
  73 
  74 long get_vbatt_min()
  75 {
  76     return 3500;
  77 }
  78 
  79 long get_vbatt_max()
  80 {
  81     return 4100;
  82 }

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