aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPerry Hung <iperry@alum.mit.edu>2010-03-22 23:19:36 -0400
committerPerry Hung <iperry@alum.mit.edu>2010-03-22 23:19:36 -0400
commit76e746273c8fb0dc8952a04de87ff23c14916466 (patch)
treead90f663a0e784de78239f4156d69996b9c0a725
parent8be3c78e0ad7a36ce6beaffcf3ec755861f23ca0 (diff)
downloadlibrambutan-76e746273c8fb0dc8952a04de87ff23c14916466.tar.gz
librambutan-76e746273c8fb0dc8952a04de87ff23c14916466.zip
Add a carriage return for println, remove it from the usart send
routine.
-rw-r--r--src/lib/usart.c14
-rw-r--r--src/main.cpp1
-rw-r--r--src/wiring/Print.cpp2
3 files changed, 8 insertions, 9 deletions
diff --git a/src/lib/usart.c b/src/lib/usart.c
index 0fd4e05..9987641 100644
--- a/src/lib/usart.c
+++ b/src/lib/usart.c
@@ -306,13 +306,13 @@ uint32 usart_data_available(uint8 usart_num) {
/**
- * @brief Output a character out the uart
+ * @brief Output a byte out the uart
*
* @param[in] usart_num usart number to output on
- * @param[in] ch character to send
+ * @param[in] byte byte to send
*
*/
-void usart_putc(uint8 usart_num, uint8 ch) {
+void usart_putc(uint8 usart_num, uint8 byte) {
ASSERT((usart_num <= NR_USARTS) && (usart_num > 0));
usart_port *port;
@@ -331,11 +331,11 @@ void usart_putc(uint8 usart_num, uint8 ch) {
ASSERT(0);
}
- if (ch == '\n') {
- usart_putc(usart_num, '\r');
- }
+// if (ch == '\n') {
+// usart_putc(usart_num, '\r');
+// }
- port->DR = ch;
+ port->DR = byte;
/* Wait for transmission to complete */
while ((port->SR & USART_TXE) == 0)
diff --git a/src/main.cpp b/src/main.cpp
index 6f210e5..9c988ec 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -16,7 +16,6 @@ void loop() {
digitalWrite(ledPin, toggle);
toggle ^= 1;
delay(1000);
- Usb.println("hello world!");
}
int main(void) {
diff --git a/src/wiring/Print.cpp b/src/wiring/Print.cpp
index c7e0cc6..efe3eef 100644
--- a/src/wiring/Print.cpp
+++ b/src/wiring/Print.cpp
@@ -98,7 +98,7 @@ void Print::print(double n)
void Print::println(void)
{
-// print('\r');
+ print('\r');
print('\n');
}