| Line | |
|---|
| 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 |
|
|---|
| 12 | void 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 | boot();
|
|---|
| 28 | }
|
|---|
| 29 |
|
|---|
| 30 | // TODO: Check focal length table
|
|---|
| 31 | static const int fl_tbl[] = {6600, 8060, 9840, 12050, 14800, 17550, 21600};
|
|---|
| 32 | #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0]))
|
|---|
| 33 | #define CF_EFL 56481L
|
|---|
| 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 | // TODO: is battery v min/max ok?
|
|---|
| 54 | long get_vbatt_min()
|
|---|
| 55 | {
|
|---|
| 56 | return 2300;
|
|---|
| 57 | }
|
|---|
| 58 |
|
|---|
| 59 | long get_vbatt_max()
|
|---|
| 60 | {
|
|---|
| 61 | return 2550;
|
|---|
| 62 | }
|
|---|
| 63 |
|
|---|
Note: See
TracBrowser
for help on using the repository browser.