Flags track the occurrence of abnormal events.
A flag is a single-bit variable which can be set when an abnormal event occurs. The next response frame sent to the Host will have the flags-changed bit set, which informs the host it should send a GET_FLAGS command.
On receiving a GET_FLAGS command, the Device sends the packed flags structure as the message payload.
Files | |
file | flags.h |
The Flags Module. | |
Functions | |
void | Flags_Initialize (TransportTXFunction tx_cb) |
Initialize the Flags sub-system. More... | |
static bool | Flags_HasChanged () |
Check if the flags have changed since the last GET_FLAGS message. More... | |
static void | Flags_SetLogOverflow () |
Set the log overflow flag. More... | |
static void | Flags_SetTXDrop () |
Set the TX Drop flag. More... | |
static void | Flags_SetTXError () |
Set the TX Error flag. More... | |
void | Flags_SendResponse (uint8_t token) |
Send a flags message. More... | |
|
inlinestatic |
Check if the flags have changed since the last GET_FLAGS message.
void Flags_Initialize | ( | TransportTXFunction | tx_cb | ) |
Initialize the Flags sub-system.
tx_cb | The callback to use for sending messages when Flags_SendResponse() is called. This can be overridden, see the note below. |
If PIPELINE_TRANSPORT_TX is defined in app_pipeline.h, the macro will override the tx_cb argument.
void Flags_SendResponse | ( | uint8_t | token | ) |
Send a flags message.
token | The token to include in the response. |
This uses the TransportTXFunction passed in Flags_Initialize() to transmit the frame.
|
inlinestatic |
Set the log overflow flag.
This indicates the Logger buffer overflowed and some messages were dropped.
|
inlinestatic |
Set the TX Drop flag.
This indicates we tried to send a message to the host before the previous message completed sending.
|
inlinestatic |
Set the TX Error flag.
This indicates USB_DEVICE_EndpointWrite returned an error.