root/platform/a2100/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 /*
   2 ###########################################################
   3 ###########################################################
   4 #############[ FINISHED ] #################################
   5 ###########################################################
   6 ###########################################################
   7 */ 
   8 
   9 
  10 #include "lolevel.h"
  11 #include "platform.h"
  12 #include "core.h"
  13 #include "keyboard.h"
  14 
  15 
  16 extern long link_bss_start;
  17 extern long link_bss_end;
  18 extern void boot();
  19 
  20 
  21 void startup()
  22 {
  23         long *bss = &link_bss_start;
  24 
  25         // sanity check
  26         if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)){
  27                 started();
  28                 shutdown();
  29         }
  30 
  31         // initialize .bss senment
  32         while (bss<&link_bss_end)
  33                 *bss++ = 0;
  34 
  35         boot();
  36 }
  37 
  38 
  39 
  40 
  41 
  42 // from sd950, zoom steps and sensor size same
  43 //static const int fl_tbl[] = {7700, 9572, 11454, 13683, 16293, 19548, 23495, 28500};
  44 
  45 // A2100 
  46 static const int fl_tbl[] = {6400, 6800, 7600, 8800, 10500, 12300, 14100, 18500, 21200, 27100, 30700, 35100, 38400}; 
  47 
  48 
  49 #define NUM_FL (int)(sizeof(fl_tbl)/sizeof(fl_tbl[0]))
  50 // sd950 uses wrong value
  51 // #define CF_EFL 60869
  52 // ewavr
  53 // SD990 focal length range is 7,7 - 28,5 mm, 36 - 133 in 35-mm equivalent.
  54 // So, CF_EFL = 36/7.7*10000=46753 or 133/28.5*10000=46666.
  55 
  56 // A2100 :: 6x optical zoom lens 36-216mm (35mm equiv), 6.4 - 38.4mm
  57 // CF_EFL = 36/6,4*10000=56250            or     216/38,4*10000= 56250
  58 #define CF_EFL 56250 // split the difference
  59 
  60 const int zoom_points = NUM_FL;
  61 
  62 int get_effective_focal_length(int zp) {
  63     return (CF_EFL*get_focal_length(zp))/10000;
  64 }
  65 
  66 int get_focal_length(int zp) {
  67     if (zp<0) return fl_tbl[0];
  68     else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1];
  69     else return fl_tbl[zp];
  70 }
  71 
  72 int get_zoom_x(int zp) {
  73     if (zp<1) return 10;
  74     else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0];
  75     else return fl_tbl[zp]*10/fl_tbl[0];
  76 }
  77 
  78 
  79 // A1100 High and Low Levels
  80 
  81 long get_vbatt_min()
  82 {
  83         return 2200;
  84 }
  85 
  86 long get_vbatt_max()
  87 {
  88         return 3150;
  89 }
  90 

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