Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 11 months ago.
Timeout, Ticker - nrf51822
Hello, If I use a timeout or ticker in my program - everything freezes. When I debugging the following example, everything works fine until the interrupt occurrence. - timer interrupt is executed, - whole returns to the main loop, - freezing occurs on "wait(0.3)" - asm 0x0001631C 4817 LDR r0,[pc,#92] ; @0x0001637C
When I use Ticker everything works fine until I use detach() - the same symptom: everything freezes.
Can you help me with this?
EXAMPLE:
- include "mbed.h"
Timeout flipper; DigitalOut led1(p14); DigitalOut led2(p14);
void flip() { led2 = !led2; }
int main() { led2 = 1; flipper.attach(&flip, 2.0); setup flipper to call flip after 2 seconds
spin in a main loop. flipper will interrupt it to call flip while(1) { led1 = !led1; wait(0.3); } }