summaryrefslogtreecommitdiffstats
path: root/hal/uart.tpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hal/uart.tpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/hal/uart.tpp b/hal/uart.tpp
index 0ecd615..359722e 100644
--- a/hal/uart.tpp
+++ b/hal/uart.tpp
@@ -193,8 +193,9 @@ io_pin<3> led_green(&LATBbits, &TRISBbits, &PORTBbits);
void __ISR(_UART_1_VECTOR, IPL1AUTO) usart_1_isr()
{
if (IFS1bits.U1RXIF) {
- // debug
+ #ifdef DEBUG
led_blue.toggle();
+ #endif
// wait for data to be available
while (!U1STAbits.URXDA);
@@ -213,10 +214,12 @@ void __ISR(_UART_1_VECTOR, IPL1AUTO) usart_1_isr()
}
// on each interrupt call, send one character
else if (IFS1bits.U1TXIF) {
+ #ifdef DEBUG
+ led_green.toggle();
+ #endif
// disable TX interrupt flag
IEC1bits.U1TXIE = 0;
- led_green.toggle();
// write data
U1TXREG = static_cast<decltype(U1TXREG)>(uart::tx_buffer<1>().front());
@@ -298,6 +301,14 @@ namespace uart
CFGCONbits.IOLOCK = 1; // lock PPS
hw::reglock();
}
+
+#if 0
+ template<>
+ void set_baudrate<1>(long baud)
+ {
+
+ }
+#endif
}
#endif \ No newline at end of file