diff options
author | Nao Pross <naopross@thearcway.org> | 2018-05-05 18:35:39 +0200 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-05-05 18:35:39 +0200 |
commit | 7c6e90299de97b51f6ba17d1a50cedb824d0c82f (patch) | |
tree | 2a032bbec8a11e1b5f7a189ff2750936982576fc /hal/uart.tpp | |
parent | Fix split() (diff) | |
download | SAMLiquidSmoke-7c6e90299de97b51f6ba17d1a50cedb824d0c82f.tar.gz SAMLiquidSmoke-7c6e90299de97b51f6ba17d1a50cedb824d0c82f.zip |
Add gpio::is_set() to read from _latch register, update command parsing
Diffstat (limited to '')
-rw-r--r-- | hal/uart.tpp | 15 |
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 |