root/platform/a470/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 extern long link_bss_start;
   7 extern long link_bss_end;
   8 extern void boot();
   9 
  10 void startup()
  11 {
  12     long *bss = &link_bss_start;
  13 
  14     // sanity check
  15     if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)){
  16         started();
  17         shutdown();
  18     }
  19 
  20     // initialize .bss senment
  21     while (bss<&link_bss_end)
  22         *bss++ = 0;
  23 
  24 
  25     boot();
  26 }
  27 
  28 static const int fl_tbl[] ={6300, 8100, 9800, 12100, 14800, 17600, 21600};
  29 #define NUM_FL (int)(sizeof(fl_tbl)/sizeof(fl_tbl[0]))
  30 #define CF_EFL 60345
  31 
  32 const int zoom_points = NUM_FL;
  33 
  34 int get_effective_focal_length(int zp) {
  35     return (CF_EFL*get_focal_length(zp))/10000;
  36 }
  37 
  38 int get_focal_length(int zp) {
  39     if (zp<0) return fl_tbl[0];
  40     else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1];
  41     else return fl_tbl[zp];
  42 }
  43 
  44 int get_zoom_x(int zp) {
  45     if (zp<1) return 10;
  46     else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0];
  47     else return fl_tbl[zp]*10/fl_tbl[0];
  48 }
  49 
  50 #if 0
  51 int rec_switch_state(void) {
  52 //    mode  = (physw_status[1] & 0x00000e00)?MODE_REC:MODE_PLAY;
  53         return (physw_status[1] & 0x00000e00);
  54 }
  55 #endif
  56 
  57 
  58 long get_vbatt_min()
  59 {
  60     return 2300;
  61 }
  62 
  63 long get_vbatt_max()
  64 {
  65     return 2550;
  66 }

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