source: trunk/platform/sx120is/main.c @ 1527

Revision 1527, 1.3 KB checked in by philmoz, 17 months ago (diff)

Merge latest code from reyalp-flt branch to main trunk.

  • Property svn:eol-style set to native
Line 
1#include "lolevel.h"
2#include "platform.h"
3#include "core.h"
4#include "keyboard.h"
5
6
7extern long link_bss_start;
8extern long link_bss_end;
9extern void boot();
10
11
12void startup()
13{
14    long *bss = &link_bss_start;
15    long *ptr;
16
17    // sanity check
18    if ((long)&link_bss_end > (MEMISOSTART + MEMISOSIZE)){
19        started();
20        shutdown();
21    }
22
23    // initialize .bss senment
24    while (bss<&link_bss_end)
25        *bss++ = 0;
26
27//debug_led(1);
28    boot();
29}
30
31// from sx100
32//fl_tbl still the same as sx100
33static const int fl_tbl[] = {6000, 6700, 7300, 8200, 9100, 10300, 11500, 12800, 14400, 16100, 18100, 20100, 22400, 25200, 28100, 31500, 34900, 38900, 42500, 46600, 51100, 55900, 60000};
34#define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0]))
35//#define CF_EFL 6000
36#define CF_EFL 5600             //      1/2.3" as sx10
37
38const int zoom_points = NUM_FL;
39
40int get_effective_focal_length(int zp) {
41        return (CF_EFL*get_focal_length(zp))/1000;
42}
43
44int 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
50int 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//end sx100
57
58
59
60long get_vbatt_min()
61{
62    return 2250;
63}
64
65long get_vbatt_max()
66{
67    return 2600;
68}
Note: See TracBrowser for help on using the repository browser.