source: branches/release-1_0/platform/ixus750_sd550/main.c @ 1519

Revision 847, 838 bytes checked in by reyalp, 3 years ago (diff)

Mode override support. See http://chdk.kernreaktor.org/mantis/view.php?id=64
All cameras except ixus40_sd400 should be supported

rec_mode_active (checks play_rec_mode, weak, can be overriden on cameras that need it)
screen_opened, screen_rotated: only defined on swivel screen cams, check phsw_ bits for screen pos

  • move old play/rec checking code to rec_switch_state. #ifdef'd out for now
  • move mode enum into it's own header file: modelist.h to allow easy lua generation.
  • use playrec_mode on tx1

+ add new generated lua file LUALIB/GEN/modelist.lua
+ add lua library LUALIB/capmode.lua see http://chdk.wikia.com/wiki/LUA/Scripts:Standard/Lualib/Capmode
+ add test scripts see

http://chdk.wikia.com/wiki/UBASIC/Scripts:Standard/Test/Setmode
http://chdk.wikia.com/wiki/LUA/Scripts:Standard/Test/Setmode

  • Property svn:eol-style set to native
Line 
1#include "../generic/main.c"
2
3long get_vbatt_min()
4{
5    return 3550;
6}
7
8long get_vbatt_max()
9{
10    return 4110;
11}
12
13
14static const int fl_tbl[] = {7700,9030,10490,12520,15600,18780,23100};
15#define NUM_FL (sizeof(fl_tbl)/sizeof(fl_tbl[0]))
16#define CF_EFL 48052
17
18const int zoom_points = NUM_FL;
19
20int get_effective_focal_length(int zp) {
21    return (CF_EFL*get_focal_length(zp))/10000;
22}
23
24int get_focal_length(int zp) {
25    if (zp<0) return fl_tbl[0];
26    else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1];
27    else return fl_tbl[zp];
28}
29
30int get_zoom_x(int zp) {
31    if (zp<1) return 10;
32    else if (zp>NUM_FL-1) return fl_tbl[NUM_FL-1]*10/fl_tbl[0];
33    else return fl_tbl[zp]*10/fl_tbl[0];
34}
35
36#if 0
37int rec_switch_state(void) {
38//    mode  = (physw_status[1]&0x0F)==0x0B ?  MODE_PLAY : MODE_REC;
39        return (physw_status[1]&0x0F)!=0x0B;
40}
41#endif
Note: See TracBrowser for help on using the repository browser.