Changeset 607
- Timestamp:
- 11/30/08 10:40:36 (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 5 edited
-
CHDK/SCRIPTS/examples/paramdmp.lua (added)
-
core/luascript.c (modified) (4 diffs)
-
doc/version.txt (modified) (1 diff)
-
include/camera.h (modified) (4 diffs)
-
lib/ubasic/ubasic.c (modified) (2 diffs)
-
version.inc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/luascript.c
r606 r607 201 201 } 202 202 203 static int luaCB_get_parameter_data( lua_State* L ) 204 { 205 extern long* FlashParamsTable[]; 206 207 unsigned size; 208 unsigned id = luaL_checknumber( L, 1 ); 209 unsigned val; 210 211 if (id >= get_flash_params_count()) { 212 // return nil 213 return 0; 214 } 215 216 size = FlashParamsTable[id][1]>>16; 217 if (size == 0) { 218 // return nil 219 return 0; 220 } 221 if (size >= 1 && size <= 4) { 222 val = 0; 223 get_parameter_data( id, &val, size ); 224 lua_pushlstring( L, (char *)&val, size ); 225 // for convenience, params that fit in a number are returned in one as a second result 226 lua_pushnumber( L, val ); 227 return 2; 228 } 229 else { 230 char *buf = malloc(size); 231 if(!buf) { 232 luaL_error( L, "malloc failed in luaCB_get_parameter_data" ); 233 } 234 get_parameter_data( id, buf, size ); 235 lua_pushlstring( L, buf, size ); 236 free(buf); 237 return 1; 238 } 239 } 240 241 static int luaCB_get_flash_params_count( lua_State* L ) 242 { 243 lua_pushnumber( L, get_flash_params_count() ); 244 return 1; 245 } 246 203 247 static int luaCB_set_av96_direct( lua_State* L ) 204 248 { … … 383 427 } 384 428 385 #if defined (CAMERA_g7) || defined (CAMERA_sx100is) || defined (CAMERA_g9)429 #if CAM_HAS_JOGDIAL 386 430 static int luaCB_wheel_right( lua_State* L ) 387 431 { … … 857 901 FUNC(get_zoom); 858 902 FUNC(get_exp_count); 903 FUNC(get_flash_params_count); 904 FUNC(get_parameter_data); 859 905 860 906 FUNC(set_av96_direct); … … 884 930 FUNC(is_pressed); 885 931 FUNC(is_key); 886 #if defined (CAMERA_g7) || defined (CAMERA_sx100is)932 #ifdef CAM_HAS_JOGDIAL 887 933 FUNC(wheel_right); 888 934 FUNC(wheel_left); -
trunk/doc/version.txt
r604 r607 2 2 3 3 version / revision / author 4 5 0.8.7 / #606-607 / reyalp 6 + add lua functions for flash parameters (onboard flash memory, not light) 7 num=get_flash_params_count() -- num is the number of parameters 8 str,num=get_parameter_data(id) -- str is the parameter value as a lua string, 9 which may contain embedded NULLs or other non-printable characters. If the size of the flash 10 parameter is 4 bytes or less, a second value is returned, containing the parameter value as a number 11 if the parameter id is invalid, or the parameter size is 0, then nil is returned. 12 scripts/examples/paramdmp.lua contains an example 13 * added CAMERA_HAS_JOGDAIL for g7/g9/sx100is, and used it instead of checking individual camera defines 14 + Lua string lib. see http://www.lua.org/manual/5.1/manual.html#5.4 15 * Updated get_buildinfo to return two additional fields: 16 os: string, either "dryos" or "vxworks" 17 platformid: number 18 * llibtst.lua is updated to test string lib, and no longer reports a listdir failure under dryos. 19 * removed some redundant entries from sig_ref_vxworks_2.txt 4 20 5 21 -
trunk/include/camera.h
r595 r607 34 34 #undef CAM_FEATURE_FEATHER // Cameras with "feather" or touch wheel. 35 35 #define CAM_HAS_IS 1 // Camera has image stabilizer 36 #undef CAM_HAS_JOGDIAL // Camera has a "jog dial" 36 37 37 38 #undef CAM_CONSOLE_LOG_ENABLED // Development: internal camera stdout -> A/stdout.txt … … 71 72 #undef CAM_HAS_IS 72 73 #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1 74 #define CAM_HAS_JOGDIAL 1 73 75 #define DNG_SUPPORT 1 74 76 // pattern … … 110 112 #define CAM_EMUL_KEYPRESS_DURATION 10 111 113 #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1 114 #define CAM_HAS_JOGDIAL 1 112 115 #define CAM_EV_IN_VIDEO 1 113 116 // #define CAM_CONSOLE_LOG_ENABLED 1 … … 1393 1396 #define CAM_RAW_ROWS 2480 // for new 8 MP 1394 1397 #undef CAM_SYNCH 1395 #define CAM_CAN_MUTE_MICROPHONE 1 1396 #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1 1397 #define CAM_ADJUSTABLE_ALT_BUTTON 1 1398 #define CAM_SHOW_OSD_IN_SHOOT_MENU 1 1399 #undef CAM_VIDEO_CONTROL 1400 #define DNG_SUPPORT 1 1401 #define CAM_REAR_CURTAIN 1 1398 #define CAM_CAN_MUTE_MICROPHONE 1 1399 #define CAM_AF_SCAN_DURING_VIDEO_RECORD 1 1400 #define CAM_ADJUSTABLE_ALT_BUTTON 1 1401 #define CAM_SHOW_OSD_IN_SHOOT_MENU 1 1402 #undef CAM_VIDEO_CONTROL 1403 #define DNG_SUPPORT 1 1404 #define CAM_REAR_CURTAIN 1 1405 #define CAM_HAS_JOGDIAL 1 1402 1406 // pattern 1403 1407 #define cam_CFAPattern 0x01000201 // Green Blue Red Green -
trunk/lib/ubasic/ubasic.c
r604 r607 1908 1908 static void wheel_left_statement(void){ 1909 1909 accept(TOKENIZER_WHEEL_LEFT); 1910 #if defined (CAMERA_g7) || defined (CAMERA_sx100is) || defined (CAMERA_g9)1910 #ifdef CAM_HAS_JOGDIAL 1911 1911 JogDial_CCW(); 1912 1912 #endif … … 1917 1917 static void wheel_right_statement(void){ 1918 1918 accept(TOKENIZER_WHEEL_RIGHT); 1919 #if defined (CAMERA_g7) || defined (CAMERA_sx100is)1919 #ifdef CAM_HAS_JOGIDAL 1920 1920 JogDial_CW(); 1921 1921 #endif -
trunk/version.inc
r603 r607 1 BUILD_NUMBER := 0.8. 61 BUILD_NUMBER := 0.8.7
Note: See TracChangeset
for help on using the changeset viewer.