From 9488cb329c72dffc6d48d0b14d4f6c908fc0400a Mon Sep 17 00:00:00 2001 From: Simen Svale Skogsrud Date: Fri, 3 Jun 2011 15:36:14 +0200 Subject: [PATCH] cleaned up function definitions for serial and print modules and added a comment about the deeply flawed printFloat method --- print.c | 3 +++ print.h | 4 ++++ serial.h | 8 +++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/print.c b/print.c index de3a1ad..697ffb5 100644 --- a/print.c +++ b/print.c @@ -71,6 +71,9 @@ void printInteger(long n) printIntegerInBase(n, 10); } +// TODO: This is nasty. I can't remember where I got this, but this monster +// will truncate leading zeroes from the fractional part so that +// 3.5, 3.05 and 3.000005 all will print as 3.5!!! Needs fixing fast. void printFloat(double n) { double integer_part, fractional_part; diff --git a/print.h b/print.h index c2b76a6..b2581ba 100644 --- a/print.h +++ b/print.h @@ -25,9 +25,13 @@ #define print_h void printString(const char *s); + void printPgmString(const char *s); + void printInteger(long n); + void printIntegerInBase(unsigned long n, unsigned long base); + void printFloat(double n); #endif \ No newline at end of file diff --git a/serial.h b/serial.h index ec41433..4991d5c 100644 --- a/serial.h +++ b/serial.h @@ -24,8 +24,10 @@ #ifndef serial_h #define serial_h -void serial_init(long); -void serial_write(uint8_t); -uint8_t serial_read(void); +void serial_init(long baud); + +void serial_write(uint8_t data); + +uint8_t serial_read(); #endif