hTimer SetTimerAfter(int delay, (*good_cb)(int, int), (*bad_cb)(int, int), int whatever);hTimer SetTimerWhen(int time, (*good_cb)(int, int), (*bad_cb)(int, int), int whatever);int CancelTimer(hTimer);[/tt]hHPTimer SetHPTimerAfterNow(int delay, (*good_cb)(int, int), (*bad_cb)(int, int), int whatever);hHPTimer SetHPTimerAfterTimeout(int time_base, int delay, (*good_cb)(int, int), (*bad_cb)(int, int), int whatever)int CancelHPTimer(hHPTimer);[/tt]
Any thoughts on how many of these are available?
Presumably the Canon f/w uses them. For the regular timers a single 1 tic timer servicing a linked list of callbacks seems probable. But does the HPTimer handler uses a single shared high frequency timer interrupt and another linked list of callbacks? Or do calls to that function get a dedicated h/w timer?
int led_state = 0;int do_nothing(){ }int led_blinking_function(){ if (led_state) { *((volatile int *) 0xc0220080) = 0x46; } else { *((volatile int *) 0xc0220080) = 0x44; } led_state = !led_state; _SetHPTimerAfterNow(256,led_blinking_function,do_nothing,0);// _SetTimerAfter(1,led_blinking_function,do_nothing,0); return 0;}int init_led_blinking_function(){ _SetHPTimerAfterNow(262144,led_blinking_function,do_nothing,0);// _SetTimerAfter(2000,led_blinking_function,do_nothing,0);}
int do_nothing(){ }int SOS_signal_step = 0;int SOS_step_delay = 524288; // half a second. NOTE cannot be more than 1048575int SOS_signal[36] = {1,0,1,0,1,0,0,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0};int send_SOS_signal(){ if (SOS_signal[SOS_signal_step]) { *((volatile int *) 0xc0220080) = 0x46; //WARNING Address is for IXUS 65 (AF LED)// *((volatile int *) 0xc022c200) = 0x93d800; //SX40 } else { *((volatile int *) 0xc0220080) = 0x44; //WARNING As above// *((volatile int *) 0xc022c200) = 0x83dc00; //SX40 } if (SOS_signal_step < 35) { SOS_signal_step++; } else { SOS_signal_step = 0; } _SetHPTimerAfterNow(SOS_step_delay,send_SOS_signal,do_nothing,0);}int init_send_SOS_signal(){ _SetHPTimerAfterNow(SOS_step_delay,send_SOS_signal,do_nothing,0);}
I'd be willing to write a patch file if there's any chance of it being included in the main trunk, somewhere in the miscellaneous menu?
How is int CancelHPTimer(hHPTimer); used? Do I just have to give it a pointer to the function I want to cancel?)
I'll have to redo those tests (of how accurate the pulses were) I was going to upload today, as I forgot which photos corresponded to which camera and settings. But one thing to note, they are quite messy and inaccurate (especially when faster than 1kHz) so some sort of bit-slip preventation may be nescesary.
SetHPTimerAfterNow works much better, 1kHz 512Hz was no problem, it even worked up to 4kHz 2kHz (with 256 as the delay), it also briefly worked with smaller delays, but then somehow it just stops (leaving the LED in the previous state it was at).
Note that the firmware is almost exclusively using the same callback functions as 'good_cb' and 'bad_cb', you may get better results if you follow that practice. Playback mode is recommended for this kind of abuse of the timer system (due to less timers running).
Few more here anyway.
For some reason, the photodiode seems way less responsive to the SX40's green AF lamp than on the other cams, perhaps because of the narrow beam focus.
As for the bits, well would something like this be a good idea?
Might also be different sensitivity at different frequencies.
What are you trying to achieve?
For example, how much information (i.e. exact # of bits needed) do you want to transmit from the master camera to the slave?
How often to you anticipate needing to send it?
How much latency can you tolerate at the slave?
Do you anticipate one packet with everything packed into it (plus maybe a short SHOOT command) ? Or is it worth the overhead of a protocol capable of sending any arbitrary data packet?
What happens when there is a communications error?
Started by fudgey General Discussion and Assistance
Started by srsa_4c « 1 2 » General Discussion and Assistance
Started by lipefrs « 1 2 » Script Writing
Started by reyalp DryOS Development
Started by reyalp General Discussion and Assistance