From: MaartenBrock Date: Sun, 10 Dec 2006 16:21:42 +0000 (+0000) Subject: * device/include/tinibios.h: removed defines for putchar and getchar X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=f547d7d89a0c75329d3bdb98ec3e6bf57c81fd77;p=fw%2Fsdcc * 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 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4509 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 54969365..1b32e960 100644 --- 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 diff --git a/device/include/tinibios.h b/device/include/tinibios.h index 8c192745..4ab9b875 100755 --- a/device/include/tinibios.h +++ b/device/include/tinibios.h @@ -5,9 +5,6 @@ #include #include -#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. diff --git a/device/lib/ds390/Makefile.in b/device/lib/ds390/Makefile.in index d09dcaaf..b9d1be79 100755 --- a/device/lib/ds390/Makefile.in +++ b/device/lib/ds390/Makefile.in @@ -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 index 00000000..b2df1d61 --- /dev/null +++ b/device/lib/ds390/putchar.c @@ -0,0 +1,36 @@ +/*------------------------------------------------------------------------- + putchar.c - putchar implementation for DS80C390 + + Written By - Maarten Brock, sourceforge.brock@dse.nl + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + In other words, you are welcome to use, share and improve this program. + You are forbidden to forbid anyone else to use, share and improve + what you give them. Help stamp out software-hoarding! +-------------------------------------------------------------------------*/ + +#include +#include + +void putchar (char c) +{ + Serial0PutChar(c); +} + +extern char getchar(void) +{ + return Serial0GetChar(); +}