aboutsummaryrefslogtreecommitdiffstats
path: root/Projects/XPLAINBridge/Lib/SoftUART.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-07-15 11:01:31 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-07-15 11:01:31 +0000
commitdfe50ff34970eda173cafbb3d636a5f7bedc87bd (patch)
treefa40f50761a29781d5d3b6e3b94a784a18a19bc2 /Projects/XPLAINBridge/Lib/SoftUART.c
parent40631e9fe5f0782c1fbc3019904d1298ac365cd1 (diff)
downloadlufa-dfe50ff34970eda173cafbb3d636a5f7bedc87bd.tar.gz
lufa-dfe50ff34970eda173cafbb3d636a5f7bedc87bd.tar.bz2
lufa-dfe50ff34970eda173cafbb3d636a5f7bedc87bd.zip
Added ability to set the serial baud rate via the user's terminal in the XPLAINBridge project.
Diffstat (limited to 'Projects/XPLAINBridge/Lib/SoftUART.c')
-rw-r--r--Projects/XPLAINBridge/Lib/SoftUART.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Projects/XPLAINBridge/Lib/SoftUART.c b/Projects/XPLAINBridge/Lib/SoftUART.c
index 4ec8dcdc8..8710722e4 100644
--- a/Projects/XPLAINBridge/Lib/SoftUART.c
+++ b/Projects/XPLAINBridge/Lib/SoftUART.c
@@ -63,12 +63,13 @@ void SoftUART_Init(void)
EICRA = (1 << ISC01);
EIMSK = (1 << INT0);
- /* Set reception timer compare period and enable compare ISR */
- OCR1A = BIT_TIME;
+ /* Set the transmission and reception timer compare values for the default baud rate */
+ SoftUART_SetBaud(9600);
+
+ /* Setup reception timer compare ISR */
TIMSK1 = (1 << OCIE1A);
- /* Set transmission timer compare period, enable compare ISR and start the timer */
- OCR3A = BIT_TIME;
+ /* Setup transmission timer compare ISR and start the timer */
TIMSK3 = (1 << OCIE3A);
TCCR3B = ((1 << CS30) | (1 << WGM32));
}