* device/include/tinibios.h: removed defines for putchar and getchar
authorMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 10 Dec 2006 16:21:42 +0000 (16:21 +0000)
committerMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sun, 10 Dec 2006 16:21:42 +0000 (16:21 +0000)
* device/lib/ds390/Makefile.in: added putchar.c
* device/lib/ds390/putchar.c: new, added, fixes bug 1465671

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4509 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
device/include/tinibios.h
device/lib/ds390/Makefile.in
device/lib/ds390/putchar.c [new file with mode: 0644]

index 54969365a471a6219ec258bd04cafcdacc2ea405..1b32e960c31119ce9e70adabf19d6be840733fe2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@
        * src/cdbFile.c(spacesToUnderscores): new function,
          (cdbWriteEndFunction, cdbWriteCLine): use spacesToUnderscores, fixes bug
          1068030
+       * device/include/tinibios.h: removed defines for putchar and getchar
+       * device/lib/ds390/Makefile.in: added putchar.c
+       * device/lib/ds390/putchar.c: new, added, fixes bug 1465671
 
 2006-12-09 Borut Razem <borut.razem AT siol.net>
 
index 8c192745dcaa421447c83c460ca7ececa201cf66..4ab9b8751e5c05f6702c5490bb23d9266cf7b10c 100755 (executable)
@@ -5,9 +5,6 @@
 #include <ds80c390.h>
 #include <time.h>
 
-#define Serial0GetChar getchar
-#define Serial0PutChar putchar
-
 void Serial0Init (unsigned long baud, unsigned char buffered);
 char Serial0GetChar(void);
 void Serial0PutChar(char);
@@ -47,7 +44,7 @@ void ClockMicroSecondsDelay(unsigned int us);
 /* Set the cpu speed in clocks per machine cycle, valid values are:
    1024: Divide-by-1024 (power management) mode (screws ALL timers and serial)
       4: Standard 8051 divide-by-4 mode
-      2: Use 2x xtal multiplier 
+      2: Use 2x xtal multiplier
       1: Use 4x xtal multiplier (Don't do this with a TINI at 18.432MHz)
 */
 #define CPU_SPEED 2
@@ -79,10 +76,10 @@ extern void LcdLPrintf(unsigned int collumnRow, const char *format, ...) __reent
 extern char I2CReset(void);
 extern char I2CStart(void);
 extern char I2CStop(void);
-extern char I2CSendStop(char addr, char count, 
+extern char I2CSendStop(char addr, char count,
                        char send_stop);
 extern char I2CReceive(char addr, char count);
-extern char I2CSendReceive(char addr, char tx_count, 
+extern char I2CSendReceive(char addr, char tx_count,
                           char rx_count);
 //extern char I2CByteOut(char);
 //extern void I2CDumpError(char);
@@ -109,7 +106,7 @@ void ClockIrqHandler (void) __interrupt 1 __naked;
 // functions for dealing with the ds400 ROM firmware.
 
 // A wrapper which calls rom_init allocating all available RAM in CE0
-// to the heap, sets the serial port to SERIAL_0_BAUD, sets up the 
+// to the heap, sets the serial port to SERIAL_0_BAUD, sets up the
 // millisecond timer, and diddles the clock multiplier.
 
 // Values for the romInit "speed" parameter.
index d09dcaaf42c0cb441707bec84e946d0248f46da1..b9d1be79f4efdf9a5433824dd000682e13d16ec9 100755 (executable)
@@ -5,7 +5,7 @@ CC = ../../../bin/sdcc
 
 #VERBOSE = --verbose
 
-OBJECTS = tinibios.rel memcpyx.rel  lcd390.rel i2c390.rel rtc390.rel
+OBJECTS = tinibios.rel memcpyx.rel  lcd390.rel i2c390.rel rtc390.rel putchar.rel
 
 SOURCES = $(patsubst %.rel,%.c,$(OBJECTS))
 
@@ -15,7 +15,7 @@ CFLAGS = -mds390 $(CPPFLAGS) $(VERBOSE)
 all: $(OBJECTS) libds390.lib
 
 clean:
-       rm -f *.lst *.rel *.sym *.cdb *.asm \#* *~ *.rst *.hex 
+       rm -f *.lst *.rel *.sym *.cdb *.asm \#* *~ *.rst *.hex
        rm -f *.ihx temp.lnk *.map *.lib
 
 distclean: clean
diff --git a/device/lib/ds390/putchar.c b/device/lib/ds390/putchar.c
new file mode 100644 (file)
index 0000000..b2df1d6
--- /dev/null
@@ -0,0 +1,36 @@
+/*-------------------------------------------------------------------------\r
+  putchar.c - putchar implementation for DS80C390\r
+\r
+   Written By - Maarten Brock, sourceforge.brock@dse.nl\r
+\r
+   This program is free software; you can redistribute it and/or modify it\r
+   under the terms of the GNU General Public License as published by the\r
+   Free Software Foundation; either version 2, or (at your option) any\r
+   later version.\r
+\r
+   This program is distributed in the hope that it will be useful,\r
+   but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+   GNU General Public License for more details.\r
+\r
+   You should have received a copy of the GNU General Public License\r
+   along with this program; if not, write to the Free Software\r
+   Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\r
+\r
+   In other words, you are welcome to use, share and improve this program.\r
+   You are forbidden to forbid anyone else to use, share and improve\r
+   what you give them.   Help stamp out software-hoarding!\r
+-------------------------------------------------------------------------*/\r
+\r
+#include <tinibios.h>\r
+#include <stdio.h>\r
+\r
+void putchar (char c)\r
+{\r
+       Serial0PutChar(c);\r
+}\r
+\r
+extern char getchar(void)\r
+{\r
+       return Serial0GetChar();\r
+}\r