From 67d25d837ac55f28a366c0a3b262e439a6e75fc3 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 19 Aug 2017 12:15:28 +0200 Subject: Add AmForth --- amforth-6.5/avr8/drivers/usart_common.asm | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 amforth-6.5/avr8/drivers/usart_common.asm (limited to 'amforth-6.5/avr8/drivers/usart_common.asm') diff --git a/amforth-6.5/avr8/drivers/usart_common.asm b/amforth-6.5/avr8/drivers/usart_common.asm new file mode 100644 index 0000000..e6238ec --- /dev/null +++ b/amforth-6.5/avr8/drivers/usart_common.asm @@ -0,0 +1,30 @@ + +.set USART_C_VALUE = bm_ASYNC | bm_NO_PARITY | bm_1STOPBIT | bm_8BIT +.if WANT_INTERRUPTS == 0 + .if WANT_ISR_RX == 1 + .error "*** Config error. set WANT_ISR_RX to 0 too if you disable interrupts (WANT_INTERRUPTS is set to 0)" + .endif +.endif + +.if WANT_ISR_RX == 1 + .set USART_B_VALUE = bm_ENABLE_TX | bm_ENABLE_RX | bm_ENABLE_INT_RX + .include "drivers/usart-rx-buffer.asm" +; .include "drivers/timer-usart-isr.asm" + .set XT_RX = XT_RX_BUFFER + .set XT_RXQ = XT_RXQ_BUFFER + .set XT_USART_INIT_RX = XT_USART_INIT_RX_BUFFER +.else + .set USART_B_VALUE = bm_ENABLE_TX | bm_ENABLE_RX + .include "words/usart-rx-poll.asm" + .set XT_RX = XT_RX_POLL + .set XT_RXQ = XT_RXQ_POLL + .set XT_USART_INIT_RX = 0 +.endif + +.include "words/usart-tx-poll.asm" +.set XT_TX = XT_TX_POLL +.set XT_TXQ = XT_TXQ_POLL +.set XT_USART_INIT_TX = 0 + +.include "words/ubrr.asm" +.include "words/usart.asm" -- cgit v1.2.3