4 years, 9 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:

  1. 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); } }

Question relating to:

Comment on this question
Be the first to answer this question.

You need to log in to post a question