root/platform/ixus90_sd790/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 "camera.h"
   2 #include "lolevel.h"
   3 #include "platform.h"
   4 #include "core.h"
   5 #include "keyboard.h"
   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     boot();
  27 }
  28 
  29 // Ixus 90 focal length range is 6.2 - 18.6 mm, 35-105 in 35-mm equivalent.
  30 // So, CF_EFL = 35/6.2*10000=56452 or 105/18.6*10000=56452.
  31 static const int fl_tbl[] = {6200, 7230, 8295, 9681, 11614, 14303, 18600};
  32 #define CF_EFL 56452
  33 #define NUM_FL (int)(sizeof(fl_tbl)/sizeof(fl_tbl[0]))
  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 long get_vbatt_min()
  55 {
  56     return 3500;
  57 }
  58 
  59 long get_vbatt_max()
  60 {
  61     return 4100;
  62 }
  63 

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