A board support package for the LPC4088 Display Module.
Dependencies: DM_HttpServer DM_USBHost
Dependents: lpc4088_displaymodule_emwin lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI ... more
Fork of DMSupport by
RtosLog Class Reference
All threads can independantly call the printf function in the RtosLog class without risk of getting the output tangled up. More...
#include <RtosLog.h>
Public Member Functions | |
void | init () |
Starts the logger thread, called from DMBoard::instance().init() | |
int | printf (const char *format,...) |
Printf that works in an RTOS. | |
int | isr_printf (const char *format,...) |
Printf that works in an RTOS. |
Detailed Description
All threads can independantly call the printf function in the RtosLog class without risk of getting the output tangled up.
The RtosLog class uses a Thread to process the messages one at a time.
Example of using the RtosLog class:
#include "mbed.h" #include "DMBoard.h" void myTask(void const*args) { RtosLog* log = DMBoard::instance().logger(); ... log->printf("Hello world!\n"); ... }
Definition at line 50 of file RtosLog.h.
Member Function Documentation
void init | ( | ) |
Starts the logger thread, called from DMBoard::instance().init()
Definition at line 88 of file RtosLog.cpp.
int isr_printf | ( | const char * | format, |
... | |||
) |
Printf that works in an RTOS.
This function will create a string from the specified format and optional extra arguments and put it into a message that the RtosLog thread will write to the log.
Note that if the underlying queue is full then this function discards the message and returns immediately.
- Parameters:
-
format format string ... optional extra arguments
Definition at line 135 of file RtosLog.cpp.
int printf | ( | const char * | format, |
... | |||
) |
Printf that works in an RTOS.
This function will create a string from the specified format and optional extra arguments and put it into a message that the RtosLog thread will write to the log.
Note that if the underlying queue is full then this function will block until an entry becomes available. This is required to make sure that all printf calls actually get printed. If this happens too often then increase the priority of the RtosLog thread or reduce the number of printed messages.
- Parameters:
-
format format string ... optional extra arguments
Definition at line 96 of file RtosLog.cpp.
Generated on Tue Jul 12 2022 14:18:31 by 1.7.2