/* mprintf.h */ // Paula Keezer added a macro and mutex for a thread safe printf // This is the variadic macro for mprintf #ifndef mprintf_h #define mprintf_h #include #include "DuinOS/FreeRTOS.h" #include "DuinOS/semphr.h" #include "DuinOS/queue.h" extern xSemaphoreHandle pMutex; void mprintf_init(); #define mprintf(...) while (xSemaphoreTake(pMutex,1000)!=pdTRUE) {}\ printf(__VA_ARGS__);\ xSemaphoreGive(pMutex);\ #endif