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.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
I'm seeing some weird behavior with the online mbed compiler. Above are two snippets of code. The first is a function named get_sample() that is called repeatedly by Ticker at a rate of 44.1kHz. The seconds is a section of the main function where get_sample() gets attached to Ticker and a while loops spins as it waits for a buffer to get filled.
The odd part is when I removed the line "dout = !dout;" from the second chunk of code, that while loop never breaks out. I know that in spite of this, the get_sample() function does fill up the buffer and subsequently detach itself from ticker. Why does this while loop need that useless line of code?