Hi,
We have issues with mBed's Thread::wait() in mBed 5.7.2, which causes our interrupts to stop working. Below is a small example that can be used to test this. By removing Thread::wait(), the code works. It does however work with Thread::wait() for a small time, before it hangs (deadlock?)
#include "mbed.h" DigitalOut led1(LED1); #define SIGNAL_EVENT_TIMEOUT 0x0200 static osThreadId sThreadId = NULL; static Timeout sTimeOut; static void myWaitCallback() { osSignalSet(sThreadId, SIGNAL_EVENT_TIMEOUT); // Notify thread that the timer has expired } static void myWait(float timeOut) { sThreadId = osThreadGetId(); bool exit = false; sTimeOut.attach(myWaitCallback, timeOut); while (!exit) { osEvent event = osSignalWait(SIGNAL_EVENT_TIMEOUT, osWaitForever); if (event.status == osEventSignal) { if (event.value.signals & SIGNAL_EVENT_TIMEOUT) { exit = true; } } } sTimeOut.detach(); } // main() runs in its own thread in the OS int main() { while (true) { led1 = !led1; //wait(0.5); myWait(0.5); Thread::wait(500); } }