Script size limitations - Script Writing - CHDK Forum supplierdeeply

Script size limitations

  • 0 Replies
  • 3300 Views
*

Offline fudgey

  • *****
  • 1705
  • a570is
Script size limitations
« on: 18 / May / 2008, 07:09:24 »
Advertisements
Hi all,

According to the wiki there is a 8k script size limit in current builds. But are there other limits, such as a maximum number of rows, and do we know these limits and are they camera model dependent?

I'm asking this because yesterday I experimented with my MD script a bit (I was testing a shadow hilight feature) but it script started crashing: script freezes, camera doesn't take any button presses, LCD updates normally for a while, then camera shuts down due to watchdog without retracting the lens.

It seems "goto" statements were to blame: if the target is too far in the script code, the script freezes the camera. If I moved the target code closer to the start of the script, it would work until some other goto would need to go close to the end. The thing is, my script was only about 6k in size, with about 250 lines (I carefully stripped it to be below 255 but it didn't help).

Have I reached a point where CHDK is too slow to scan the script though for goto targets before the key scan timeslot expires or should that even matter? And if this is the case, is there a way to predict this and maybe warn the user instead of crashing?

Note that the camera definitely doesn't shut down during the goto scan, it first freezes for a number of seconds (the scan can't take THAT long). It is possible that my script has something else in it to upset the interpreter, but I'd like some input before I go head first into hunting this further. (The script does have a set_av96_direct during half-shutter which also seems to do this very same freeze... I haven't investigated this further...but this is another thing completely unless there is a suitable bug in ubasic...with the ubasic bug that was found yesterday I'm not sure what to think. :D)

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal