Have you observed every output pulse from the micro-controller on an oscilloscope?
Have you tried Lua? Perhaps it works better than uBasic for something like this?
:main a = 0 do a = get_usb_power sleep_for 45 until (a > 0) cls print " time: ", a goto "main
In main.c, createHook creates physw_hook.(I am not sure how 'hooks' work).physw_hook runs mykbd_task().How often is that function called ?
mykbd_task() does something with a new stack (what?) and calls mykbd_task_proceed().
mykbd_task_proceed() runs in an endless loop while physw_status is true.(maybe physw_status is only false when you turn the camera off ? )
Every ten milliseconds, wrap_kbd_p1_f() is called which calls my_kbd_read_keys().
That calls kbd_process() and if a script is running, process_script() is called to process any stack operations.
It is also possible for the other stuff executing in this loop to take longer than ten ms.
remote_key = (physw_status[2] & USB_MASK)==USB_MASK; // USB V+ present ? if (remote_key) // Yes { remote_count += 1; // so increment 1/100 sec counter // TEST // toggle led toggle = !toggle; ubasic_set_led(9,toggle,100); }
Thanks, useful information.Do we know when physw_run is false ?
Are you saying that occasionally the usb_power counter will not be incremented ?
Do all CHDK tasks have to yield to certain Canon tasks ?
When not capturing an image or movie or writing to a file, are the CHDK tasks allocated equal time ?
Presumably, we have absolutely no control how tasks are allocated ?
Priority is one of the parameters to CreateTask.
.The only true CHDK task (doesn't exist in stock firmware) is spytask.
In createHook() we have :- char *name = (char*)(*(long*)((char*)pNewTcb+0x34));A lot of type-casting going on there, what does it all mean ?
What does 'void (*task)(void *)' define ?
char *name = (char*)(*(long*)((char*)pNewTcb+0x34));A lot of type-casting going on there, what does it all mean ?
Started by Mr Cat « 1 2 3 » Script Writing
Started by gwenger Script Writing
Started by dvip Script Writing
Started by Andre-K General Help and Assistance on using CHDK stable releases
Started by rustbell « 1 2 » Script Writing