Hi! I remember having read that a Lua script can do some clean-up when interrupted by defining the function "restore()". However, I don't seem to get this to work:
function restore()
printf("Restoring camera")
-- unlock AF
set_aflock(0)
-- close log
log:close()
-- restore the original dial mode
capmode.set(initial_mode)
-- restore display
set_backlight(1)
end
It should print "Restoring camera" when I press the shutter to interrupt the script, but it does not. All I get is the usual "*** INTERRUPTED ***" message. If it helps, "printf" is defined elsewhere as "print(string.format(...))".
Is this supposed to work? At this point, I don't even know if I dreamed it.