(start documenting registration event procs, cleanup) |
|||
Line 5: | Line 5: | ||
=Overview= |
=Overview= |
||
− | An event procedure (or eventproc) is a function in the canon firmware associated with a text name. An API exists in the canon firmware to register, execute and un-register them. |
+ | An event procedure (or eventproc) is a function in the canon firmware associated with a text name. An API exists in the canon firmware to register, execute and un-register them. |
+ | |||
+ | Event procedures are available from [[Canon Basic]] |
||
=Event Procedure API functions= |
=Event Procedure API functions= |
Revision as of 02:08, 6 September 2010
Starting a draft page to document eventprocs this is an incomplete draft please update with your observations. Thread http://chdk.setepontos.com/index.php/topic,4417.0.html
Overview
An event procedure (or eventproc) is a function in the canon firmware associated with a text name. An API exists in the canon firmware to register, execute and un-register them.
Event procedures are available from Canon Basic
Event Procedure API functions
- int ExecuteEventProcedure(const char *name,...)
executes the named eventproc, with the supplied arguments. Returns -1 if the eventproc isn't registered. Otherwise, returns the eventprocs return value.
- void ExportToEventProcedure(const char *name,void *pfunc)
registers eventproc pfunc with name.
Lua interface
Event procedures may be called from lua using the LUA/LUA Reference/Native Function Calls interface.
Known event procedures
Below are some event procedures which have been found to be interesting or useful. Note that the existence, behavior and arguments expected are known to vary between camera models. When if something varies from the descriptions below for your camera, please note it.
Registration functions
Many event procedures are not registered by default. The following are known. Unless otherwise specified, they take no arguments and return 0 on completion.
SystemEventInit
registers AllocateMemory, FreeMemory, sprintf, memcpy, Fut functions, log ...
UI_RegistDebugEventProc
registers capture mode functions, PTM_ functions and much more
RegisterProductTestEvent
registers PT_ functions
Note: present on vxworks + digic II (A540) missing on dryos + digic III / digic 4 (A470,SD990). Functions may be registered by default on these cameras ?