Subdirectory provided by Embedded Artists
Dependencies: DM_FATFileSystem DM_HttpServer DM_USBHost EthernetInterface USBDevice mbed-rpc mbed-rtos mbed-src
Dependents: lpc4088_displaymodule_hello_world_Sept_2018
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 134 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 95 of file RtosLog.cpp.
Generated on Wed Jul 13 2022 02:57:24 by 1.7.2