I tried to run a script with the newest ML.
The scripts, that came with the source code for example wb_shoot.lua works fine.
But when I try to run a script which worked before:
PROP_REMOTE_SW1 = 0x80020015
msleep(1000)
setbutton = function()
setprop(PROP_REMOTE_SW1, 1);
msleep(100)
setprop(PROP_REMOTE_SW1, 0);
end
msleep(1000)
setbutton()
it should trigger a half button pressed to take a silent pic, but it produces a warning on the screen and a
ASSERT00.LOG file:
ML ASSERT:
PROP_LEN(80020015) correct:2 called:4
at ../../src/property.c:242 (prop_request_change), task TASK
lv:0 mode:3
Magic Lantern version : v2.3.NEXT.2012Dec01.550D109
Mercurial changeset : a077bad5e286+ (unified) tip
Built on 2012-12-01 00:28:15 by wolf@localhost.
Free Memory : 305K + 1834K
Does anybody know what this means?
Dirty fix:
lua-handler.c:
- prop_request_change( id, &data, 4);
+ prop_request_change( id, &data, 0); // 0 = autodetect
Long answer:
Properties are dangerous. We are trying to make sure the call is correct before continuing, and I'm also thinking to add a central place when one can select what properties can be changed, and with what restrictions (valid values, range checking). Canon code does not always validate them, sometimes they just save the bad setting into ROM and brick the camera.
Currently ML has range checks, but not in the Lua implementation.
Thanks for these safety feature, it stopped me bricking my camera eventually.