MCPcopy Create free account
hub / github.com/SmingHub/Sming / invokeCallbacks

Method invokeCallbacks

Sming/Core/HardwareSerial.cpp:96–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void HardwareSerial::invokeCallbacks()
97{
98 (void)smg_uart_disable_interrupts();
99 auto status = callbackStatus;
100 callbackStatus = 0;
101 callbackQueued = false;
102 smg_uart_restore_interrupts();
103
104 // Transmit complete ?
105 if((status & UART_STATUS_TXFIFO_EMPTY) != 0 && transmitComplete) {
106 transmitComplete(*this);
107 }
108
109 // RX FIFO Full or RX FIFO Timeout or RX Overflow ?
110 if(status & (UART_STATUS_RXFIFO_FULL | UART_STATUS_RXFIFO_TOUT | UART_STATUS_RXFIFO_OVF)) {
111 auto receivedChar = smg_uart_peek_last_char(uart);
112 if(HWSDelegate) {
113 HWSDelegate(*this, receivedChar, smg_uart_rx_available(uart));
114 }
115 }
116}
117
118unsigned HardwareSerial::getStatus()
119{

Callers 1

staticOnStatusChangeMethod · 0.80

Calls 4

smg_uart_peek_last_charFunction · 0.85
smg_uart_rx_availableFunction · 0.50

Tested by

no test coverage detected