This source file includes following definitions.
- startup
- get_effective_focal_length
- get_focal_length
- get_zoom_x
- get_vbatt_min
- get_vbatt_max
1 #include "lolevel.h"
2 #include "platform.h"
3 #include "core.h"
4 #include "keyboard.h"
5
6
7
8 extern long link_bss_start;
9 extern long link_bss_end;
10 extern void boot();
11
12
13
14
15 void startup()
16 {
17 long *bss = &link_bss_start;
18
19
20 if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)){
21 started();
22 shutdown();
23 }
24
25
26 while (bss < &link_bss_end)
27 *bss++ = 0;
28
29 boot();
30 }
31
32
33
34 static const int fl_tbl[] = { 5000, 6400, 7400, 9000, 11200, 13000, 15600, 20000 };
35 #define NUM_FL (int)(sizeof fl_tbl / sizeof *fl_tbl)
36 #define CF_EFL 56000
37
38 const int zoom_points = NUM_FL;
39
40 int get_effective_focal_length(int zp) {
41 return (CF_EFL*get_focal_length(zp))/10000;
42 }
43
44 int get_focal_length(int zp) {
45 if (zp<0) return fl_tbl[0];
46 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1];
47 else return fl_tbl[zp];
48 }
49
50 int get_zoom_x(int zp) {
51 if (zp<1) return 10;
52 else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0];
53 else return fl_tbl[zp]*10/fl_tbl[0];
54 }
55
56
57 long get_vbatt_min()
58 {
59 return 3425;
60 }
61
62 long get_vbatt_max()
63 {
64 return 4000;
65 }
66