(Adding categories) |
(→Portable romlog script: tested on ixus 130) |
||
Line 5: | Line 5: | ||
* sucessfully tested on: |
* sucessfully tested on: |
||
− | :: ''[[A540]] [[D10]] (reyalp) '' |
+ | :: ''[[A540]] [[D10]] (reyalp), [[SD1400IS|SD1400IS / IXUS 130]] (emlyn) '' |
<source lang="thinbasic"> |
<source lang="thinbasic"> |
||
' get the camera log to file |
' get the camera log to file |
Revision as of 11:34, 24 October 2010
Portable romlog script
Save canon crash log (ROMLOG) to A/ROMLOG.TXT Compatible with vxworks and dryos. Some cameras may dump the log in a binary format, see http://chdk.setepontos.com/index.php/topic,5394.0.html
- sucessfully tested on:
- A540 D10 (reyalp), SD1400IS / IXUS 130 (emlyn)
' get the camera log to file
' logs status to GETLOG.LOG
' on older (mostly vxworks) cameras, the log may be in a binary format
DIM lcdmsg=0
DIM msgstr=0
PRIVATE SUB RegisterProcs()
' Newest cams (Dryos rel 43 and later) only have System.Create()
' on older dryos cams SystemEventInit is an alias for System.Create()
' ExecuteEventProcedure does is not registered by default on vx,
' but calling an unregistered is not fatal
if System.Create() = -1 then
SystemEventInit()
end if
if ExecuteEventProcedure("UI_RegistDebugEventProc") = -1 then
ExecuteEventProcedure("UI.CreatePublic")
end if
END SUB
PRIVATE SUB InitMsg()
lcdmsg = ExecuteEventProcedure("LCDMsg_Create")
' not default black
if lcdmsg >= 0 then
LCDMsg_ChangeColor(lcdmsg,2)
LCDMsg_SetStr(lcdmsg,"started")
end if
msgstr = AllocateMemory(80)
' truncate log
msgfile = Fopen_Fut("A/GETLOG.LOG","w")
if msgfile <> 0 then
Fclose_Fut(msgfile)
end if
END SUB
PRIVATE SUB PutMsg(msg)
if lcdmsg >= 0 then
LCDMsg_SetStr(lcdmsg,msg)
end if
msgfile = Fopen_Fut("A/GETLOG.LOG","a")
if msgfile <> 0 then
Fwrite_Fut(msg,strlen(msg),1,msgfile)
Fwrite_Fut("\n",1,1,msgfile)
Fclose_Fut(msgfile)
end if
END SUB
PRIVATE SUB Initialize()
RegisterProcs()
InitMsg()
PutMsg("Getting log")
GetLogToFile("A/ROMLOG.TXT",1)
PutMsg("done")
END SUB
Original romlog script by pixeldoc
- script does save (last) Error in Camera ROM log to romlog.txt.
- sucessfully tested on:
- SD4000IS (pixeldoc), SD1400IS / IXUS 130 (emlyn), SD940, D10 (reyalp)
- failed on
- A540 (reyalp)
Probably Dryos only.
private sub Initialize()
UI.CreatePublic()
a=LCDMsg_Create()
LCDMsg_SetStr(a,"Get ROM Log to file")
System.Create()
GetLogToFile("A/romlog.txt",1)
LCDMsg_SetStr(a,"done")
end sub