50 if (!__HAL_UART_GET_IT(&
uartHandle, UART_IT_TXE)) {
54 if (pkt->ch1Size == 0) {
62 __HAL_UART_ENABLE_IT(&
uartHandle, UART_IT_TXE);
74 if (!__HAL_UART_GET_IT(&
uartHandle, UART_IT_TXE)) {
78 if (pkt->ch2Size == 0) {
85 txBuf->
put(pkt->ch2Data + 1, pkt->ch2Size - 1);
86 __HAL_UART_ENABLE_IT(&
uartHandle, UART_IT_TXE);
size_t put(const T *buf, size_t items)
Insert a number of items to the buffer.
DeviceBuffer< uint8_t > * txBuf
transmit buffer
uintptr_t expectedFeedbackKey_
What should be the feedback key in the packet.
void start_cutout() override
Called at the beginning of the first window.
const DCCFeedback * ch1Pkt_
The packet to send in channel 1. Externally owned.
void middle_cutout() override
Called at the beginning of the middle window.
const DCCFeedback * ch2Pkt_
The packet to send in channel 2. Externally owned.
UART_HandleTypeDef uartHandle
Handle to the UART setup.
uint8_t ch1Data[2]
Payload of channel 1.
uint8_t ch2Data[6]
Payload of channel 2.