void AppProtocolSendMessageWithVarArg(const OUTGOING_MESSAGE* msg, const void* data, int size) { if (state != STATE_OPEN) return; BYTE prev = SyncInterruptLevel(1); ByteQueuePushBuffer(&tx_queue, (const BYTE*) msg, OutgoingMessageLength(msg)); ByteQueuePushBuffer(&tx_queue, data, size); SyncInterruptLevel(prev); }
void AppProtocolSendMessageWithVarArgSplit(const OUTGOING_MESSAGE* msg, const void* data1, int size1, const void* data2, int size2) { BYTE prev = SyncInterruptLevel(1); ByteQueuePushBuffer(&tx_queue, (const BYTE*) msg, OutgoingMessageLength(msg)); ByteQueuePushBuffer(&tx_queue, data1, size1); ByteQueuePushBuffer(&tx_queue, data2, size2); SyncInterruptLevel(prev); }
void UARTTransmit(int uart_num, const void* data, int size) { log_printf("UARTTransmit(%d, %p, %d)", uart_num, data, size); SAVE_UART_FOR_LOG(uart_num); BYTE_QUEUE* q = &uarts[uart_num].tx_queue; PRIORITY(TX_PRIORITY) { ByteQueuePushBuffer(q, data, size); AssignUxTXIE(uart_num, 1); // enable TX int. } }
void BootProtocolSendMessage(const OUTGOING_MESSAGE* msg) { ByteQueuePushBuffer(&tx_queue, (const BYTE*) msg, OutgoingMessageLength(msg)); }
void AppProtocolSendMessage(const OUTGOING_MESSAGE* msg) { BYTE prev = SyncInterruptLevel(1); ByteQueuePushBuffer(&tx_queue, (const BYTE*) msg, OutgoingMessageLength(msg)); SyncInterruptLevel(prev); }