| Revision 244,
1.3 KB
checked in by msl, 3 years ago
(diff) |
|
Aktualisierung auf Rev. 870, 872 offizieller Trunk
|
| Line | |
|---|
| 1 | #include "camera.h"
|
|---|
| 2 | #include "lolevel.h"
|
|---|
| 3 | #include "platform.h"
|
|---|
| 4 | #include "core.h"
|
|---|
| 5 | #include "keyboard.h"
|
|---|
| 6 | #include "stdlib.h"
|
|---|
| 7 |
|
|---|
| 8 | extern long link_bss_start;
|
|---|
| 9 | extern long link_bss_end;
|
|---|
| 10 | extern void boot();
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 | void startup()
|
|---|
| 14 | {
|
|---|
| 15 | long *bss = &link_bss_start;
|
|---|
| 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 | // Ixus 90 focal length range is 6.2 - 18.6 mm, 35-105 in 35-mm equivalent.
|
|---|
| 31 | // So, CF_EFL = 35/6.2*10000=56452 or 105/18.6*10000=56452.
|
|---|
| 32 | static const int fl_tbl[] = {6200, 7230, 8295, 9681, 11614, 14303, 18600};
|
|---|
| 33 | #define CF_EFL 56452
|
|---|
| 34 | #define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0]))
|
|---|
| 35 |
|
|---|
| 36 | const int zoom_points = NUM_FL;
|
|---|
| 37 |
|
|---|
| 38 | int get_effective_focal_length(int zp) {
|
|---|
| 39 | return (CF_EFL*get_focal_length(zp))/10000;
|
|---|
| 40 | }
|
|---|
| 41 |
|
|---|
| 42 | int get_focal_length(int zp) {
|
|---|
| 43 | if (zp<0) return fl_tbl[0];
|
|---|
| 44 | else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1];
|
|---|
| 45 | else return fl_tbl[zp];
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | int get_zoom_x(int zp) {
|
|---|
| 49 | if (zp<1) return 10;
|
|---|
| 50 | else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0];
|
|---|
| 51 | else return fl_tbl[zp]*10/fl_tbl[0];
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 | long get_vbatt_min()
|
|---|
| 56 | {
|
|---|
| 57 | return 3500;
|
|---|
| 58 | }
|
|---|
| 59 |
|
|---|
| 60 | long get_vbatt_max()
|
|---|
| 61 | {
|
|---|
| 62 | return 4100;
|
|---|
| 63 | }
|
|---|
| 64 |
|
|---|
Note: See
TracBrowser
for help on using the repository browser.