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 "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
17 if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)){
18 started();
19 shutdown();
20 }
21
22
23 while (bss<&link_bss_end)
24 *bss++ = 0;
25
26 boot();
27 }
28
29
30
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