Changeset 1432 for trunk


Ignore:
Timestamp:
11/26/11 21:56:33 (18 months ago)
Author:
philmoz
Message:

Add ability to save ROM crash dump to SD card from CHDK menu. Allows log to be captured on cameras without native calls enabled which can't run the romlog.lua script.
http://chdk.setepontos.com/index.php?topic=7133.0

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CHDK/LANG/english.lng

    r1395 r1432  
    577577465 "USB Remote" 
    578578466 "Show USB Remote Status" 
     579 
     580467 "Save ROM crash log" 
     581468 "ERROR: SystemEventInit and System.Create failed" 
     582469 "ROM crash log could not be saved" 
     583470 "ROM crash log saved to ROMLOG.LOG" 
  • trunk/core/gui.c

    r1424 r1432  
    2929#ifdef OPT_DEBUGGING 
    3030#include "gui_debug.h" 
     31#include "gui_bench.h" 
    3132#endif 
    3233#include "gui_fselect.h" 
     
    4041#ifdef OPT_CALENDAR 
    4142        #include "gui_calendar.h" 
    42 #endif 
    43 #ifdef OPT_DEBUGGING 
    44 #include "gui_bench.h" 
    4543#endif 
    4644#include "gui_grid.h" 
     
    169167        static void gui_draw_debug(int arg); 
    170168        static void gui_draw_bench(int arg); 
     169    void gui_compare_props(int arg); 
     170    static void gui_menuproc_break_card(int arg); 
     171        static void gui_debug_shortcut(void); 
     172        static void save_romlog(int arg); 
    171173#endif 
    172174static void gui_draw_fselect(int arg); 
     
    186188static void gui_draw_load_lang(int arg); 
    187189static void gui_menuproc_mkbootdisk(int arg); 
    188 #ifdef OPT_DEBUGGING 
    189 void gui_compare_props(int arg); 
    190 #endif 
    191190#ifndef OPTIONS_AUTOSAVE 
    192191static void gui_menuproc_save(int arg); 
     
    195194static void gui_grid_lines_load(int arg); 
    196195static void gui_raw_develop(int arg); 
    197 #ifdef OPT_DEBUGGING 
    198 static void gui_menuproc_break_card(int arg); 
    199 #endif 
    200196static void gui_menuproc_swap_partitions(int arg); 
    201197static void gui_menuproc_reset_files(int arg); 
     
    233229        static const char* gui_conf_curve_enum(int change, int arg); 
    234230#endif 
    235 #ifdef OPT_DEBUGGING 
    236         static void gui_debug_shortcut(void); 
    237 #endif 
    238231 
    239232#ifdef OPT_EDGEOVERLAY 
     
    391384#endif 
    392385#if CAM_MULTIPART 
    393     MENU_ITEM(0x33,LANG_MENU_DEBUG_CREATE_MULTIPART , MENUITEM_PROC,            gui_menuproc_break_card, 0 ), 
    394 #endif 
     386    MENU_ITEM(0x33,LANG_MENU_DEBUG_CREATE_MULTIPART , MENUITEM_PROC,          gui_menuproc_break_card, 0 ), 
     387#endif 
     388    MENU_ITEM(0x2a,LANG_SAVE_ROMLOG,                  MENUITEM_PROC,          save_romlog, 0 ), 
    395389    MENU_ITEM(0x51,LANG_MENU_BACK,                    MENUITEM_UP, 0, 0 ), 
    396390    {0} 
     
    26502644    gui_debug_init((void*)conf.mem_view_addr_init); 
    26512645} 
    2652 #endif 
    2653 //------------------------------------------------------------------- 
    2654 #ifdef OPT_DEBUGGING 
     2646 
     2647//------------------------------------------------------------------- 
    26552648void gui_draw_bench(int arg) { 
    26562649    gui_set_mode(GUI_MODE_BENCH); 
     
    29322925} 
    29332926 
    2934 #endif 
     2927// Save camera romlog to A/ROMLOG.LOG file 
     2928void save_romlog(int arg) 
     2929{ 
     2930    extern unsigned _ExecuteEventProcedure(const char *name,...); 
     2931 
     2932    struct stat st; 
     2933    if (stat("A/ROMLOG.LOG",&st)    == 0) remove("A/ROMLOG.LOG"); 
     2934    if (stat("A/RomLogErr.txt",&st) == 0) remove("A/RomLogErr.txt"); 
     2935 
     2936    unsigned args[3]; 
     2937    args[0] = (unsigned)"SystemEventInit"; 
     2938    if (call_func_ptr(_ExecuteEventProcedure,args,1) == -1) 
     2939    { 
     2940        args[0] = (unsigned)"System.Create"; 
     2941        if (call_func_ptr(_ExecuteEventProcedure,args,1) == -1) 
     2942        { 
     2943            gui_mbox_init(LANG_ERROR, LANG_SAVE_ROMLOG_INIT_ERROR, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); 
     2944            return; 
     2945        } 
     2946    } 
     2947 
     2948    args[0] = (unsigned)"GetLogToFile"; 
     2949    args[1] = (unsigned)"A/ROMLOG.LOG"; 
     2950    args[2] = 1; 
     2951    if (call_func_ptr(_ExecuteEventProcedure,args,3) == -1) 
     2952    { 
     2953        gui_mbox_init(LANG_ERROR, LANG_SAVE_ROMLOG_FAIL, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); 
     2954    } 
     2955    else 
     2956    { 
     2957        gui_mbox_init(LANG_INFORMATION, LANG_SAVE_ROMLOG_OK, MBOX_BTN_OK|MBOX_TEXT_CENTER, NULL); 
     2958    } 
     2959} 
     2960 
     2961#endif 
  • trunk/core/gui_lang.h

    r1350 r1432  
    581581#define LANG_OSD_LAYOUT_EDITOR_USB_INFO         465 
    582582#define LANG_MENU_USB_SHOW_INFO                 466 
     583 
     584// Save ROM crash log messages 
     585#define LANG_SAVE_ROMLOG            467 
     586#define LANG_SAVE_ROMLOG_INIT_ERROR 468 
     587#define LANG_SAVE_ROMLOG_FAIL       469 
     588#define LANG_SAVE_ROMLOG_OK         470 
     589 
    583590//------------------------------------------------------------------- 
    584591 
    585 #define GUI_LANG_ITEMS                  466 
     592#define GUI_LANG_ITEMS                  470 
    586593 
    587594//------------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.