From 9fcd47640c7f486e681aa6d9497cf0735abb337f Mon Sep 17 00:00:00 2001 From: reyalp Date: Tue, 16 Nov 2010 05:30:23 +0000 Subject: [PATCH] renames and cleanup in preparation for making script optional. From ultimA in http://chdk.setepontos.com/index.php?topic=5793.msg57064#msg57064 git-svn-id: http://tools.assembla.com/svn/chdk/trunk@977 6794e30b-3f2a-0410-a806-a2bbca1c07ff --- core/conf.c | 10 +++++----- core/gui_palette.c | 1 - core/histogram.c | 1 - core/kbd.c | 4 ++-- core/luascript.c | 10 +++++----- core/script.c | 12 ++++++------ include/platform.h | 12 ++++++------ include/script.h | 2 +- lib/ubasic/camera_functions.c | 12 ++++++------ lib/ubasic/camera_functions.h | 10 +++++----- lib/ubasic/ubasic.c | 10 +++++----- platform/a2000/lib.c | 2 +- platform/a470/wrappers.c | 2 +- platform/a480/lib.c | 2 +- platform/a530/lib.c | 2 +- platform/a560/lib.c | 2 +- platform/a570/lib.c | 2 +- platform/a590/wrappers.c | 2 +- platform/a650/lib.c | 2 +- platform/a700/wrappers.c | 2 +- platform/a710/wrappers.c | 2 +- platform/a720/wrappers.c | 2 +- platform/d10/lib.c | 2 +- platform/g11/lib.c | 2 +- platform/g7/lib.c | 2 +- platform/g9/lib.c | 2 +- platform/g9/wrappers.c | 2 +- platform/generic/lib.c | 2 +- platform/ixus100_sd780/lib.c | 2 +- platform/ixus40_sd300/lib.c | 2 +- platform/ixus50_sd400/lib.c | 2 +- platform/ixus55_sd450/lib.c | 2 +- platform/ixus700_sd500/lib.c | 2 +- platform/ixus70_sd1000/lib.c | 2 +- platform/ixus750_sd550/lib.c | 2 +- platform/ixus75_sd750/lib.c | 2 +- platform/ixus800_sd700/lib.c | 2 +- platform/ixus80_sd1100/lib.c | 2 +- platform/ixus850_sd800/lib.c | 2 +- platform/ixus85_sd770/lib.c | 2 +- platform/ixus860_sd870/lib.c | 2 +- platform/ixus870_sd880/lib.c | 2 +- platform/ixus900_sd900/lib.c | 2 +- platform/ixus90_sd790/lib.c | 4 ++-- platform/ixus950_sd850/lib.c | 2 +- platform/ixus95_sd1200/lib.c | 2 +- platform/ixus95_sd1200/sub/100c/boot.c | 4 ++-- platform/ixus960_sd950/lib.c | 2 +- platform/ixus970_sd890/lib.c | 2 +- platform/ixus980_sd990/lib.c | 2 +- platform/s2is/lib.c | 2 +- platform/s3is/lib.c | 2 +- platform/s5is/lib.c | 2 +- platform/s90/lib.c | 2 +- platform/sx1/lib.c | 2 +- platform/sx10/lib.c | 2 +- platform/sx100is/wrappers.c | 2 +- platform/sx110is/lib.c | 2 +- platform/sx20/lib.c | 2 +- platform/sx200is/lib.c | 2 +- platform/tx1/lib.c | 2 +- 61 files changed, 93 insertions(+), 95 deletions(-) diff --git a/core/conf.c b/core/conf.c index eb4fb21d..b92a824a 100644 --- a/core/conf.c +++ b/core/conf.c @@ -69,29 +69,29 @@ static void conf_change_grid_file(); static void conf_change_video_bitrate(); static void conf_change_dng_ext(); -void ubasic_camera_set_raw(int mode) +void camera_set_raw(int mode) { conf.save_raw = mode; } -void ubasic_camera_set_nr(int mode) +void camera_set_nr(int mode) { // "Auto", "Off", "On" conf.raw_nr = mode; } -int ubasic_camera_script_autostart() +int camera_get_script_autostart() { // 1 = Autostarted return auto_started; } -void ubasic_camera_set_script_autostart(int state) +void camera_set_script_autostart(int state) { // 1 = Autostarted auto_started = state; } -int ubasic_camera_get_nr() +int camera_get_nr() { // "Auto", "Off", "On" return conf.raw_nr; diff --git a/core/gui_palette.c b/core/gui_palette.c index 9d07f2fb..91fb6012 100644 --- a/core/gui_palette.c +++ b/core/gui_palette.c @@ -4,7 +4,6 @@ #include "keyboard.h" #include "conf.h" #include "lang.h" -#include "ubasic.h" #include "gui.h" #include "gui_draw.h" #include "gui_lang.h" diff --git a/core/histogram.c b/core/histogram.c index b9443ca4..012cfe9f 100644 --- a/core/histogram.c +++ b/core/histogram.c @@ -4,7 +4,6 @@ #include "keyboard.h" #include "conf.h" #include "math.h" -#include "ubasic.h" #include "gui.h" #include "gui_draw.h" #include "histogram.h" diff --git a/core/kbd.c b/core/kbd.c index 2c5f19d6..7ad3d43a 100644 --- a/core/kbd.c +++ b/core/kbd.c @@ -330,7 +330,7 @@ void script_start( int autostart ) script_console_add_line(lang_str(LANG_CONSOLE_TEXT_STARTED)); if( is_lua() ) { - if( !lua_script_start(state_ubasic_script) ) { + if( !lua_script_start(script_source_str) ) { script_print_screen_end(); wait_and_end(); return; @@ -345,7 +345,7 @@ void script_start( int autostart ) } state_lua_kbd_first_call_to_resume = 1; } else { // ubasic - ubasic_init(state_ubasic_script); + ubasic_init(script_source_str); for (i=0; i 0){ buf[rcnt] = 0; - state_ubasic_script = buf; + script_source_str = buf; strcpy(conf.script_file, fn); } else { diff --git a/include/platform.h b/include/platform.h index 96d67587..b76d170f 100644 --- a/include/platform.h +++ b/include/platform.h @@ -402,11 +402,11 @@ int get_battery_temp(); long get_vbatt_min(); long get_vbatt_max(); void play_sound(unsigned sound); -void ubasic_camera_set_raw(int mode); -void ubasic_camera_set_nr(int mode); -int ubasic_camera_get_nr(); -int ubasic_camera_script_autostart(); -void ubasic_camera_set_script_autostart(); +void camera_set_raw(int mode); +void camera_set_nr(int mode); +int camera_get_nr(); +int camera_get_script_autostart(); +void camera_set_script_autostart(); void exit_alt(); void camera_shutdown_in_a_second(void); @@ -420,7 +420,7 @@ int get_flash_params_count(void); /******************************************************************/ void __attribute__((noreturn)) shutdown(); -void ubasic_set_led(int led, int state, int bright); +void camera_set_led(int led, int state, int bright); void debug_led(int state); /****************************************/ extern int canon_menu_active; diff --git a/include/script.h b/include/script.h index 3e8e8200..499bdb04 100644 --- a/include/script.h +++ b/include/script.h @@ -7,7 +7,7 @@ #define SCRIPT_DATA_PATH "A/CHDK/DATA/" //------------------------------------------------------------------- -extern const char *state_ubasic_script; +extern const char *script_source_str; extern char script_title[36]; extern char script_params[SCRIPT_NUM_PARAMS][28]; diff --git a/lib/ubasic/camera_functions.c b/lib/ubasic/camera_functions.c index 989faa97..9b94d008 100644 --- a/lib/ubasic/camera_functions.c +++ b/lib/ubasic/camera_functions.c @@ -162,19 +162,19 @@ int md_init_motion_detector() printf("*** md_init_motion_detector ***\n"); return 0; } -void ubasic_camera_set_nr(to) +void camera_set_nr(to) { raw_nr = to; printf("*** set raw nr %d ***\n",raw_nr); }; -int ubasic_camera_get_nr(to) +int camera_get_nr(to) { printf("*** get raw nr ***\n"); return raw_nr; }; -void ubasic_camera_set_raw(int mode) +void camera_set_raw(int mode) { raw = mode; printf("*** set raw %d ***\n",raw); @@ -196,7 +196,7 @@ long stat_get_vbatt() { return 4085; } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { printf("*** set led %d %d %d ***\n",led, state, bright); } @@ -209,11 +209,11 @@ int shooting_get_tick_count() { return 0; } -int ubasic_camera_script_autostart() +int camera_get_script_autostart() { return 0; } -void ubasic_camera_set_script_autostart(int state) +void camera_set_script_autostart(int state) { autostart = state; printf("*** set autostart %d ***\n",autostart); diff --git a/lib/ubasic/camera_functions.h b/lib/ubasic/camera_functions.h index eb0abe51..108f7386 100644 --- a/lib/ubasic/camera_functions.h +++ b/lib/ubasic/camera_functions.h @@ -10,19 +10,19 @@ void ubasic_camera_shoot(); int md_detect_motion(void); int md_get_cell_diff(int column, int row); int md_init_motion_detector(); -void ubasic_camera_set_raw(int mode); +void camera_set_raw(int mode); void ubasic_camera_get_raw(); -void ubasic_camera_set_nr(int to); -int ubasic_camera_get_nr(); +void camera_set_nr(int to); +int camera_get_nr(); void shooting_set_prop(int id, int v); int shooting_get_prop(int id); long stat_get_vbatt(); -void ubasic_set_led(int led, int state, int bright); +void camera_set_led(int led, int state, int bright); int shooting_get_day_seconds(); int shooting_get_tick_count(); int ubasic_camera_script_autostart(); int get_usb_power(int edge); -void ubasic_camera_set_script_autostart(int state); +void camera_set_script_autostart(int state); void exit_alt(); //#include "../../core/motion_detector.h" diff --git a/lib/ubasic/ubasic.c b/lib/ubasic/ubasic.c index dbe708ec..a1fa1b9d 100644 --- a/lib/ubasic/ubasic.c +++ b/lib/ubasic/ubasic.c @@ -243,7 +243,7 @@ case TOKENIZER_GET_VBATT: break; case TOKENIZER_GET_RAW_NR: accept(TOKENIZER_GET_RAW_NR); - r = ubasic_camera_get_nr(); + r = camera_get_nr(); break; case TOKENIZER_IS_KEY: accept(TOKENIZER_IS_KEY); @@ -253,7 +253,7 @@ case TOKENIZER_GET_VBATT: break; case TOKENIZER_SCRIPT_AUTOSTARTED: accept(TOKENIZER_SCRIPT_AUTOSTARTED); - r = ubasic_camera_script_autostart(); + r = camera_get_script_autostart(); break; case TOKENIZER_GET_SCRIPT_AUTOSTART: accept(TOKENIZER_GET_SCRIPT_AUTOSTART); @@ -1964,7 +1964,7 @@ static void set_led_statement() if (tokenizer_token() != TOKENIZER_CR && tokenizer_token() != TOKENIZER_ELSE ) { to2 = expr(); } - ubasic_set_led(to, to1, to2); + camera_set_led(to, to1, to2); accept_cr(); } static void set_prop_statement() @@ -2026,7 +2026,7 @@ static void set_raw_statement() int to; accept(TOKENIZER_SET_RAW); to = expr(); - ubasic_camera_set_raw(to); + camera_set_raw(to); accept_cr(); } static void set_raw_nr_statement() @@ -2034,7 +2034,7 @@ static void set_raw_nr_statement() int to; accept(TOKENIZER_SET_RAW_NR); to = expr(); - ubasic_camera_set_nr(to); + camera_set_nr(to); accept_cr(); } diff --git a/platform/a2000/lib.c b/platform/a2000/lib.c index 23dbfb65..f0cb6a90 100644 --- a/platform/a2000/lib.c +++ b/platform/a2000/lib.c @@ -55,7 +55,7 @@ int get_flash_params_count(void){ return 120; } -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { struct led_control led_c; char convert_table[11]={0,1,2,3,0,2,3,1,8,10,10}; // s3 to a710 (and a720) convert table diff --git a/platform/a470/wrappers.c b/platform/a470/wrappers.c index 1902d495..59d55343 100644 --- a/platform/a470/wrappers.c +++ b/platform/a470/wrappers.c @@ -18,7 +18,7 @@ long lens_get_target_distance() } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { struct led_control led_c; char convert_table[11]={0,1,2,3,0,2,3,1,8,10,10}; // s3 to a710 (and a720) convert table diff --git a/platform/a480/lib.c b/platform/a480/lib.c index b35ec9dc..6bd5d5f0 100644 --- a/platform/a480/lib.c +++ b/platform/a480/lib.c @@ -35,7 +35,7 @@ void debug_led(int state) *(int*)LED_PR=state ? 0x46 : 0x44; } -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { static char led_table[]={7,9}; _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); } diff --git a/platform/a530/lib.c b/platform/a530/lib.c index 96f0d8d0..8d192e29 100644 --- a/platform/a530/lib.c +++ b/platform/a530/lib.c @@ -36,7 +36,7 @@ int get_flash_params_count(void){ #define LED_BASE 0xc0220080 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {12,16,4,8,4,0,4}; diff --git a/platform/a560/lib.c b/platform/a560/lib.c index f6309611..88ccda10 100644 --- a/platform/a560/lib.c +++ b/platform/a560/lib.c @@ -35,7 +35,7 @@ int get_flash_params_count(void){ #define LED_BASE 0xc02200C0 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {12,16,4,8,4,0,4}; diff --git a/platform/a570/lib.c b/platform/a570/lib.c index 562e7faf..298518dc 100644 --- a/platform/a570/lib.c +++ b/platform/a570/lib.c @@ -35,7 +35,7 @@ int get_flash_params_count(void){ #define LED_BASE 0xc02200C0 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {12,16,4,8,4,0,4}; diff --git a/platform/a590/wrappers.c b/platform/a590/wrappers.c index c5ab8526..60eff33a 100644 --- a/platform/a590/wrappers.c +++ b/platform/a590/wrappers.c @@ -17,7 +17,7 @@ long lens_get_target_distance() } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { // 0 gr // 1 orange diff --git a/platform/a650/lib.c b/platform/a650/lib.c index 9876ba5f..d65120f6 100644 --- a/platform/a650/lib.c +++ b/platform/a650/lib.c @@ -30,7 +30,7 @@ void debug_led(int state) #define LED_AF 0xc0220080 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {12,16,4,8,4,0,4}; diff --git a/platform/a700/wrappers.c b/platform/a700/wrappers.c index a599b6d8..fbbd8fe5 100644 --- a/platform/a700/wrappers.c +++ b/platform/a700/wrappers.c @@ -16,7 +16,7 @@ long lens_get_target_distance() } // copied from a710 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { struct led_control led_c; char convert_table[11]={0,1,2,3,0,2,3,1,8,10,10}; // s3 to a710 convert table diff --git a/platform/a710/wrappers.c b/platform/a710/wrappers.c index 6116f6f1..c9ff28fd 100644 --- a/platform/a710/wrappers.c +++ b/platform/a710/wrappers.c @@ -15,7 +15,7 @@ long lens_get_target_distance() return _GetCurrentTargetDistance(); } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { struct led_control led_c; char convert_table[11]={0,1,2,3,0,2,3,1,8,10,10}; // s3 to a710 convert table diff --git a/platform/a720/wrappers.c b/platform/a720/wrappers.c index 5862b724..6942f57a 100644 --- a/platform/a720/wrappers.c +++ b/platform/a720/wrappers.c @@ -17,7 +17,7 @@ long lens_get_target_distance() } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { struct led_control led_c; char convert_table[11]={0,1,2,3,0,2,3,1,8,10,10}; // s3 to a710 (and a720) convert table diff --git a/platform/d10/lib.c b/platform/d10/lib.c index aa166b57..be76d916 100644 --- a/platform/d10/lib.c +++ b/platform/d10/lib.c @@ -40,7 +40,7 @@ int get_flash_params_count(void){ } // TODO -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { } diff --git a/platform/g11/lib.c b/platform/g11/lib.c index a77111f7..7b302f95 100644 --- a/platform/g11/lib.c +++ b/platform/g11/lib.c @@ -29,7 +29,7 @@ void debug_led(int state) p[0]=0x44; } -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { static char led_table[7]={0,1,2,3,9,14,15}; _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); } diff --git a/platform/g7/lib.c b/platform/g7/lib.c index bdc72eb3..4d408e19 100644 --- a/platform/g7/lib.c +++ b/platform/g7/lib.c @@ -29,7 +29,7 @@ void debug_led(int state) } #define LED_BASE 0xc0220000 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {308,304,108,312,108,148,108}; diff --git a/platform/g9/lib.c b/platform/g9/lib.c index 5732ff0d..f9b42d1f 100644 --- a/platform/g9/lib.c +++ b/platform/g9/lib.c @@ -32,7 +32,7 @@ void debug_led(int state) #define LED_BASE 0xc0220080 #define LED_AF 0xC0220094//was 0xc0220080 //a650- 0xc0220080//from g7 -void ubasic_set_led1(int led, int state, int bright)//? +void camera_set_led1(int led, int state, int bright)//? { int leds[] = {12,16,4,8,4,0,4}; if(led < 4 || led > 10 || led == 6) return; diff --git a/platform/g9/wrappers.c b/platform/g9/wrappers.c index 17135796..7a11b511 100644 --- a/platform/g9/wrappers.c +++ b/platform/g9/wrappers.c @@ -16,7 +16,7 @@ long lens_get_target_distance() } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { struct led_control led_c; char convert_table[11]={0,1,2,3,0,2,3,1,8,10,10}; // s3 to a710 (and a720) convert table diff --git a/platform/generic/lib.c b/platform/generic/lib.c index a504f40e..33e5b88b 100644 --- a/platform/generic/lib.c +++ b/platform/generic/lib.c @@ -29,7 +29,7 @@ void debug_led(int state) } #define LED_AF 0xc0220080 -void __attribute__((weak)) ubasic_set_led(int led, int state, int bright) +void __attribute__((weak)) camera_set_led(int led, int state, int bright) { int leds[] = {12,16,4,8,4,0,4}; diff --git a/platform/ixus100_sd780/lib.c b/platform/ixus100_sd780/lib.c index a2e2e4c0..1cc393d0 100644 --- a/platform/ixus100_sd780/lib.c +++ b/platform/ixus100_sd780/lib.c @@ -40,7 +40,7 @@ int get_flash_params_count(void){ } // based on SX10, values found by experiment -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { static char led_table[]={0, // green 1, // orange, right 2, // yellow, left diff --git a/platform/ixus40_sd300/lib.c b/platform/ixus40_sd300/lib.c index f17af787..c1ce1a81 100644 --- a/platform/ixus40_sd300/lib.c +++ b/platform/ixus40_sd300/lib.c @@ -255,7 +255,7 @@ void set_led(int led, int state) else led_off(led); } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { if (state) { if (bright > LED_BRIGHTNESS) bright = LED_BRIGHTNESS; diff --git a/platform/ixus50_sd400/lib.c b/platform/ixus50_sd400/lib.c index bf61ab90..97638267 100644 --- a/platform/ixus50_sd400/lib.c +++ b/platform/ixus50_sd400/lib.c @@ -64,7 +64,7 @@ void set_led(int led, int state) else led_off(led); } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { if (state) { if (bright > LED_BRIGHTNESS) bright = LED_BRIGHTNESS; diff --git a/platform/ixus55_sd450/lib.c b/platform/ixus55_sd450/lib.c index c93d092e..42536ebf 100644 --- a/platform/ixus55_sd450/lib.c +++ b/platform/ixus55_sd450/lib.c @@ -30,7 +30,7 @@ void debug_led(int state) #define LED_AF 0xc02200ec #define LED_BASE 0xc02200dc -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {12,16,4,8,4,0,4}; diff --git a/platform/ixus700_sd500/lib.c b/platform/ixus700_sd500/lib.c index ed7af6dc..5c94fe88 100644 --- a/platform/ixus700_sd500/lib.c +++ b/platform/ixus700_sd500/lib.c @@ -63,7 +63,7 @@ void set_led(int led, int state) else led_off(led); } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { if (state) { if (bright > LED_BRIGHTNESS) bright = LED_BRIGHTNESS; diff --git a/platform/ixus70_sd1000/lib.c b/platform/ixus70_sd1000/lib.c index 0c23ead7..925ab927 100644 --- a/platform/ixus70_sd1000/lib.c +++ b/platform/ixus70_sd1000/lib.c @@ -42,7 +42,7 @@ int get_flash_params_count(void){ #define LED_BASE 0xC02200C0 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {12,16,4,8,4,0,4}; diff --git a/platform/ixus750_sd550/lib.c b/platform/ixus750_sd550/lib.c index c93d092e..42536ebf 100644 --- a/platform/ixus750_sd550/lib.c +++ b/platform/ixus750_sd550/lib.c @@ -30,7 +30,7 @@ void debug_led(int state) #define LED_AF 0xc02200ec #define LED_BASE 0xc02200dc -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {12,16,4,8,4,0,4}; diff --git a/platform/ixus75_sd750/lib.c b/platform/ixus75_sd750/lib.c index 0c23ead7..925ab927 100644 --- a/platform/ixus75_sd750/lib.c +++ b/platform/ixus75_sd750/lib.c @@ -42,7 +42,7 @@ int get_flash_params_count(void){ #define LED_BASE 0xC02200C0 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {12,16,4,8,4,0,4}; diff --git a/platform/ixus800_sd700/lib.c b/platform/ixus800_sd700/lib.c index a7d63127..30567060 100644 --- a/platform/ixus800_sd700/lib.c +++ b/platform/ixus800_sd700/lib.c @@ -31,7 +31,7 @@ void debug_led(int state) p[0]=0x44; } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { debug_led(state); } diff --git a/platform/ixus80_sd1100/lib.c b/platform/ixus80_sd1100/lib.c index 8b193e4e..a7da48ea 100644 --- a/platform/ixus80_sd1100/lib.c +++ b/platform/ixus80_sd1100/lib.c @@ -28,7 +28,7 @@ void debug_led(int state) } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { /* ??? int leds[] = {12,16,4,8,4,0,4}; diff --git a/platform/ixus850_sd800/lib.c b/platform/ixus850_sd800/lib.c index 163d0f40..80eb23a0 100644 --- a/platform/ixus850_sd800/lib.c +++ b/platform/ixus850_sd800/lib.c @@ -41,7 +41,7 @@ int get_flash_params_count(void){ #define LED_BASE 0xC02200C0 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {12,16,4,8,4,0,4}; if(led < 4 || led > 10 || led == 6) return; diff --git a/platform/ixus85_sd770/lib.c b/platform/ixus85_sd770/lib.c index 43a3ec16..dcf53549 100644 --- a/platform/ixus85_sd770/lib.c +++ b/platform/ixus85_sd770/lib.c @@ -27,7 +27,7 @@ void debug_led(int state) *(int*)LED_PR = state ? 0x46 : 0x44; } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { static char led_table[5]={4,5,7,8,9}; _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); diff --git a/platform/ixus860_sd870/lib.c b/platform/ixus860_sd870/lib.c index 7f4cc5b0..8bc8e1e6 100644 --- a/platform/ixus860_sd870/lib.c +++ b/platform/ixus860_sd870/lib.c @@ -33,7 +33,7 @@ void debug_led(int state) } // fe50 10-Aug-2008 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { // "brigth" not implemented // YELLOW not available diff --git a/platform/ixus870_sd880/lib.c b/platform/ixus870_sd880/lib.c index 06e98897..b8c685d6 100644 --- a/platform/ixus870_sd880/lib.c +++ b/platform/ixus870_sd880/lib.c @@ -45,7 +45,7 @@ void debug_led(int state) *((int*) 0xC02200D4) = state ? 0x46 : 0x44; } -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { // approximation of behaviour advertised in documentation. long val = state ? 0x46 : 0x44; switch ( led ) diff --git a/platform/ixus900_sd900/lib.c b/platform/ixus900_sd900/lib.c index 642d21dd..1d7ac2bb 100644 --- a/platform/ixus900_sd900/lib.c +++ b/platform/ixus900_sd900/lib.c @@ -40,7 +40,7 @@ void debug_led(int state) { #define LED_BASE 0xC02200C0 // led base address -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { int leds[] = {12,16,4,8,4,0,4}; if(led < 4 || led > 10 || led == 6) return; volatile long *p=(void*)LED_BASE + leds[led-4]; diff --git a/platform/ixus90_sd790/lib.c b/platform/ixus90_sd790/lib.c index c6bc2a44..97891ec2 100644 --- a/platform/ixus90_sd790/lib.c +++ b/platform/ixus90_sd790/lib.c @@ -46,7 +46,7 @@ void debug_led_c(int color, int state) } // fe50 10-Aug-2008 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { // "brigth" not implemented // YELLOW not available @@ -60,7 +60,7 @@ void ubasic_set_led(int led, int state, int bright) p[0]=0x44; } -//void ubasic_set_led(int led, int state, int bright) +//void camera_set_led(int led, int state, int bright) //{ // static char led_table[5]={4,5,7,8,9}; // _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); diff --git a/platform/ixus950_sd850/lib.c b/platform/ixus950_sd850/lib.c index e352c760..5d2ee774 100644 --- a/platform/ixus950_sd850/lib.c +++ b/platform/ixus950_sd850/lib.c @@ -41,7 +41,7 @@ void debug_led(int state) #define LED_BASE 0xC02200C0 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {12,16,-1,8,4,0,20}; // cannot quite figure, in which order they're supposed to be.. diff --git a/platform/ixus95_sd1200/lib.c b/platform/ixus95_sd1200/lib.c index a28dbcda..b17916a0 100644 --- a/platform/ixus95_sd1200/lib.c +++ b/platform/ixus95_sd1200/lib.c @@ -32,7 +32,7 @@ int get_flash_params_count(void){ // from Microfunguy in // http://chdk.setepontos.com/index.php/topic,4324.msg55475.html#msg55475 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {0x134,0x138,0x134,0x130,0x134,0x3030,0x3030}; // green=4 | (yellow) | (not used) | orange | (not used) | af beam | timer volatile long *p=(void*)0xc0220000 + leds[(led-4)%sizeof(leds)]; diff --git a/platform/ixus95_sd1200/sub/100c/boot.c b/platform/ixus95_sd1200/sub/100c/boot.c index e6b88ec5..311dc685 100644 --- a/platform/ixus95_sd1200/sub/100c/boot.c +++ b/platform/ixus95_sd1200/sub/100c/boot.c @@ -542,11 +542,11 @@ void __attribute__((noinline)) task_blinker() { *led = 0x44; // LED off led=(void *)ledlist[(i_led)%4]; //led=(void *)ledlist[(++i_led)%4]; - //ubasic_set_led(i_led % 6, ledstate, 0); + //camera_set_led(i_led % 6, ledstate, 0); //core_test(1); } else { ledstate = 1; - //ubasic_set_led(i_led % 6, ledstate, 0); + //camera_set_led(i_led % 6, ledstate, 0); *led = 0x46; // LED on //core_test(0); } diff --git a/platform/ixus960_sd950/lib.c b/platform/ixus960_sd950/lib.c index 839c2c33..fdd7fbf3 100644 --- a/platform/ixus960_sd950/lib.c +++ b/platform/ixus960_sd950/lib.c @@ -23,7 +23,7 @@ else p[0]=0x44; } #define LED_AF 0xc0223030 -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { int leds[] = {106,0,0,103,0,3940,0}; if(led < 4 || led > 10 || led == 6) return; diff --git a/platform/ixus970_sd890/lib.c b/platform/ixus970_sd890/lib.c index bc910a0f..4cd215e5 100644 --- a/platform/ixus970_sd890/lib.c +++ b/platform/ixus970_sd890/lib.c @@ -27,7 +27,7 @@ void debug_led(int state) *(int*)LED_PR = state ? 0x46 : 0x44; } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { static char led_table[5]={4,5,7,8,9}; _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); diff --git a/platform/ixus980_sd990/lib.c b/platform/ixus980_sd990/lib.c index 5886d548..b8b3b43b 100644 --- a/platform/ixus980_sd990/lib.c +++ b/platform/ixus980_sd990/lib.c @@ -40,7 +40,7 @@ int get_flash_params_count(void){ } // based on SX10, values found by experiment -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { static char led_table[]={0, // green 1, // orange, right 2, // yellow, left diff --git a/platform/s2is/lib.c b/platform/s2is/lib.c index 4c97692f..deec5811 100644 --- a/platform/s2is/lib.c +++ b/platform/s2is/lib.c @@ -56,7 +56,7 @@ int get_flash_params_count(void){ return 85; } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { if (state) { if (bright > LED_BRIGHTNESS) bright = LED_BRIGHTNESS; diff --git a/platform/s3is/lib.c b/platform/s3is/lib.c index 0796347d..f1408b9b 100644 --- a/platform/s3is/lib.c +++ b/platform/s3is/lib.c @@ -57,7 +57,7 @@ int get_flash_params_count(void){ } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { if (state) { if (bright > LED_BRIGHTNESS) bright = LED_BRIGHTNESS; diff --git a/platform/s5is/lib.c b/platform/s5is/lib.c index b142154a..fb1c1c53 100644 --- a/platform/s5is/lib.c +++ b/platform/s5is/lib.c @@ -63,7 +63,7 @@ void debug_led(int state) led_off(LED_BLUE); } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { if (state) { if (bright > LED_BRIGHTNESS) bright = LED_BRIGHTNESS; diff --git a/platform/s90/lib.c b/platform/s90/lib.c index 5fd62d6a..0207e5ad 100644 --- a/platform/s90/lib.c +++ b/platform/s90/lib.c @@ -29,7 +29,7 @@ void debug_led(int state) p[0]=0x44; } -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { static char led_table[4]={0,1,9,10}; _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); } diff --git a/platform/sx1/lib.c b/platform/sx1/lib.c index 16a5cd62..5b6ab47c 100644 --- a/platform/sx1/lib.c +++ b/platform/sx1/lib.c @@ -33,7 +33,7 @@ void debug_led(int state) // *(int*)LED_PR=state ? 0x46 : 0x44; } -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { static char led_table[5]={4,5,7,8,9}; _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); } diff --git a/platform/sx10/lib.c b/platform/sx10/lib.c index 497901cc..a231da5e 100644 --- a/platform/sx10/lib.c +++ b/platform/sx10/lib.c @@ -32,7 +32,7 @@ void debug_led(int state) *(int*)LED_PR=state ? 0x46 : 0x44; } -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { static char led_table[5]={4,5,7,8,9}; _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); } diff --git a/platform/sx100is/wrappers.c b/platform/sx100is/wrappers.c index c876ad22..4799b788 100644 --- a/platform/sx100is/wrappers.c +++ b/platform/sx100is/wrappers.c @@ -17,7 +17,7 @@ long lens_get_target_distance() } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { struct led_control led_c; diff --git a/platform/sx110is/lib.c b/platform/sx110is/lib.c index 59fc3caf..aa16f5b2 100644 --- a/platform/sx110is/lib.c +++ b/platform/sx110is/lib.c @@ -47,7 +47,7 @@ void debug_led(int state) *(int*)LED_GRN=state ? 0x46 : 0x44; } -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { static char led_table[5]={4,5,7,8,9}; _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); } diff --git a/platform/sx20/lib.c b/platform/sx20/lib.c index 5ca12701..21ccc1f0 100644 --- a/platform/sx20/lib.c +++ b/platform/sx20/lib.c @@ -44,7 +44,7 @@ void debug_led(int state) //*(int*)LED_PR=state ? 0x46 : 0x44; } -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { static char led_table[5]={4,5,7,8,9}; _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); } diff --git a/platform/sx200is/lib.c b/platform/sx200is/lib.c index 54d8f9eb..467a22c5 100644 --- a/platform/sx200is/lib.c +++ b/platform/sx200is/lib.c @@ -32,7 +32,7 @@ void debug_led(int state) *(int*)LED_PR=state ? 0x46 : 0x44; } -void ubasic_set_led(int led, int state, int bright) { +void camera_set_led(int led, int state, int bright) { static char led_table[5]={4,5,7,8,9}; _LEDDrive(led_table[led%sizeof(led_table)], state<=1 ? !state : state); } diff --git a/platform/tx1/lib.c b/platform/tx1/lib.c index 44931b8b..7a5d4d53 100644 --- a/platform/tx1/lib.c +++ b/platform/tx1/lib.c @@ -66,7 +66,7 @@ void set_led(int led, int state) led_off(led); } -void ubasic_set_led(int led, int state, int bright) +void camera_set_led(int led, int state, int bright) { if (state) { if (bright > LED_BRIGHTNESS) bright = LED_BRIGHTNESS;