AFAIK this will just move the point where it may hang.
Ye of little faith! Let's see if the test fixes the bug or not, i..e. doesn't hang AND doesn't miss shots. If my fix hangs or misses shots, and I can't figure out how to get it working, then maybe you're right.
http://chdk.setepontos.com/index.php?topic=9118.msg95189#msg95189if the firmware decides that the shot cannot be taken for whatever reason...
Yes, I understand how your fix works. But I don't think the firmware decides the shot cannot be taken "for whatever reason." As I've described in perhaps too much detail, the firmware decides to take a shot if the shutter button is down when it finishes the last shot and is ready for the next shot. The current shoot() code has the possibility it could release the shoot button BEFORE the camera is ready to take the next shot. There also might be a camera requirement that the shoot button has to be down for a certain period of time to take a shot. This helps prevent inadvertent shots from "key bounce".
Maybe get_shooting() goes true before the camera is finished focusing, and the shutter is up by the time it's really ready. The combination of focusing and flash charging may change the timing. You're counting on the camera being ready to shoot immediately after get_shooting() goes true. I don't think you can count on that.
Let's work together and figure this out, Phil. We're not in competition here. With your knowledge of CHDK task processing, maybe you have a better way to test if the camera started the shot, i.e. before shutter open, and that works on all cameras. Let's find a better way to do this than skipping shots, and figure out what's happening instead of "whatever reason."
I don't think it will be necessary, but we could add a timeout to my code if needed. My changes also make shoot() work at 1 shot per second with shoot_full_only. That's a significant capability, but it only works by holding shoot_full until the camera takes the shot.
Your method stops the hanging, but doesn't really solve the problem. But together, we can figure it out.