projects
/
avr_serial_lcd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
17a6ade
)
Move C ISR code to a static function
author
Kevin Rosenberg
<kevin@rosenberg.net>
Sun, 6 Jun 2010 17:56:22 +0000
(11:56 -0600)
committer
Kevin Rosenberg
<kevin@rosenberg.net>
Sun, 6 Jun 2010 17:56:22 +0000
(11:56 -0600)
serial_lcd.c
patch
|
blob
|
history
diff --git
a/serial_lcd.c
b/serial_lcd.c
index b611fa1cfe7302ecbc05df35383f73f939c2156b..bef0e8c463f004adf5e54eed0adaaca9be901741 100644
(file)
--- a/
serial_lcd.c
+++ b/
serial_lcd.c
@@
-419,14
+419,9
@@
unsigned char LcdBusyWait (void) {
return (LCDStatus);
\r
}
\r
\r
return (LCDStatus);
\r
}
\r
\r
-#if defined(__IMAGECRAFT__)
\r
-#pragma interrupt_handler usart_rx_handler:iv_USART0_RXC
\r
-void usart_rx_handler(void)
\r
-#else
\r
-ISR(USART_RX_vect)
\r
-#endif
\r
-{
\r
- unsigned char rx, tmphead;
\r
+INLINE_FUNC_DECLARE(static void UartStoreRx (uint8_t rx));
\r
+static inline void UartStoreRx (uint8_t rx) {
\r
+ unsigned char tmphead;
\r
\r
if (UCSRA & (1<<FE)) {
\r
// framing error. Currrently, this is silently ignored
\r
\r
if (UCSRA & (1<<FE)) {
\r
// framing error. Currrently, this is silently ignored
\r
@@
-440,7
+435,6
@@
ISR(USART_RX_vect)
}
\r
#endif
\r
\r
}
\r
#endif
\r
\r
- rx = UDR;
\r
// Calculate next buffer position.
\r
tmphead = sUartRxHead;
\r
if (tmphead == UART_RX_BUFFER_SIZE-1)
\r
// Calculate next buffer position.
\r
tmphead = sUartRxHead;
\r
if (tmphead == UART_RX_BUFFER_SIZE-1)
\r
@@
-468,6
+462,16
@@
ISR(USART_RX_vect)
#endif
\r
}
\r
\r
#endif
\r
}
\r
\r
+#if defined(__IMAGECRAFT__)
\r
+#pragma interrupt_handler usart_rx_handler:iv_USART0_RXC
\r
+void usart_rx_handler(void)
\r
+#else
\r
+ISR(USART_RX_vect)
\r
+#endif
\r
+{
\r
+ UartStoreRx(UDR);
\r
+}
\r
+
\r
static unsigned char WaitRxChar (void) {
\r
// waits for next RX character, then return it
\r
unsigned char tail;
\r
static unsigned char WaitRxChar (void) {
\r
// waits for next RX character, then return it
\r
unsigned char tail;
\r