root/platform/m3/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 "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 void startup() {
  12     long *bss = &link_bss_start;
  13     // sanity check
  14     if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)) {
  15         started();
  16         shutdown();
  17     }
  18     // initialize .bss senment
  19     while (bss<&link_bss_end)
  20         *bss++ = 0;
  21     boot();
  22 }
  23 
  24 #define NUM_FL      101
  25 #define NUM_DATA    2   // 2 words each entry, first is FL
  26 //extern int focus_len_table[NUM_FL*NUM_DATA];
  27 
  28 //asm1989 done for sx260
  29 // Conversion factor lens FL --> 35mm equiv
  30 // lens      35mm     CF
  31 // ----      ----     --
  32 // 4.5       25       ( 25/ 4.5) * 45 = 250  (min FL)
  33 // 90.0      500      (500/90.0) * 45 = 250  (max FL)
  34 // #define CF_EFL      250
  35 // #define CF_EFL_DIV  45
  36 
  37 const int zoom_points = NUM_FL;
  38 extern unsigned int _GetLensFocalLengthAll(unsigned int*, unsigned int*, unsigned int*);
  39 
  40 int get_effective_focal_length(__attribute__ ((unused))int zp) {
  41         unsigned int focal [3];
  42         _GetLensFocalLengthAll(&focal[0], &focal[1], &focal[2]);
  43         return ( (unsigned short)(focal[0]) * 1600  ) ;
  44 }
  45 
  46 int get_focal_length(__attribute__ ((unused))int zp) {
  47         unsigned int focal [3];
  48         _GetLensFocalLengthAll(&focal[0], &focal[1], &focal[2]);
  49         return ((unsigned short)(focal[0]) * 1000);     
  50 }
  51         
  52 int get_zoom_x(__attribute__ ((unused))int zp) {
  53         unsigned int focal [3];
  54         _GetLensFocalLengthAll(&focal[0], &focal[1], &focal[2]);
  55         return (unsigned short)(focal[0]) * 10 / (unsigned short)(focal[1]) ;
  56 }
  57 
  58 long get_vbatt_min()
  59 {
  60     return 2*3300;
  61 }
  62 
  63 
  64 long get_vbatt_max()
  65 {
  66     return 2*4168;  // 4168 original battery just charged ASM1989
  67 }

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