From de110ea5be432feb3db300ec6c26783a93e74ba6 Mon Sep 17 00:00:00 2001 From: Rainer Mueller Date: Sat, 6 Aug 2011 21:42:17 +0200 Subject: [PATCH 1/6] Fix update-bridge-files.sh for BSD find BSD find outputs a trailing slash when given on the command line, GNU find does not. This can lead to path like firmware//lcd/image.c which would fail with the used dirname and sed combination. --- simulat0r/bin/update-bridge-files.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simulat0r/bin/update-bridge-files.sh b/simulat0r/bin/update-bridge-files.sh index 441bc53..d85524e 100755 --- a/simulat0r/bin/update-bridge-files.sh +++ b/simulat0r/bin/update-bridge-files.sh @@ -13,7 +13,7 @@ exit fi echo "Updating directories" -for i in `find firmware/ -type d ` +for i in `find firmware -type d ` do if test -d simulat0r/$i then verbmsg "OK Directory already exists: $i" @@ -22,7 +22,7 @@ fi done echo "Updating bridge files for C source" -for i in `find firmware/ \! -path firmware/lcd/allfonts.h \! -path firmware/l0dable/usetable.h -type f -iname \*.[ch]` +for i in `find firmware \! -path firmware/lcd/allfonts.h \! -path firmware/l0dable/usetable.h -type f -iname \*.[ch]` do if test -f simulat0r/$i; then @@ -34,7 +34,7 @@ do done echo "Updating bridge files for Makefiles" -for i in `find firmware/ -type f -iname Makefile` +for i in `find firmware -type f -iname Makefile` do if test -f simulat0r/$i; then From f9982c226f3bc85248847ea0c156f964a13ee3fa Mon Sep 17 00:00:00 2001 From: Rainer Mueller Date: Sun, 31 Jul 2011 21:49:02 +0200 Subject: [PATCH 2/6] Avoid duplicate symbols in usbhid.o and usbmsc.o --- firmware/usb/usbhid.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/firmware/usb/usbhid.c b/firmware/usb/usbhid.c index 5072b0b..4f7975d 100644 --- a/firmware/usb/usbhid.c +++ b/firmware/usb/usbhid.c @@ -44,9 +44,9 @@ #include "usbconfig.h" #include "usbhid.h" -USB_DEV_INFO DeviceInfo; -HID_DEVICE_INFO HidDevInfo; -ROM ** rom = (ROM **)0x1fff1ff8; +static USB_DEV_INFO DeviceInfo; +static HID_DEVICE_INFO HidDevInfo; +static ROM ** rom = (ROM **)0x1fff1ff8; typedef struct usbhid_out_s { From 083fd79adc4c72906e2ee080da7236cad1747cbe Mon Sep 17 00:00:00 2001 From: Rainer Mueller Date: Sun, 31 Jul 2011 21:44:50 +0200 Subject: [PATCH 3/6] Remove duplicated libbasic --- simulat0r/tui/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/simulat0r/tui/Makefile b/simulat0r/tui/Makefile index a74e2f7..84a2447 100644 --- a/simulat0r/tui/Makefile +++ b/simulat0r/tui/Makefile @@ -6,7 +6,6 @@ CFLAGS += -I../firmware CFLAGS += -I../firmware/core # for gpio.h including projectconfig.h without path CFLAGS += -I../simcore -OBJS+= ../firmware/basic/*.o OBJS+= ../firmware/core/*.o OBJS+= ../firmware/core/*/*.o LIBS+= ../firmware/applications/libapp.a From 8af2fb3f08455b8a2237339d716b00a6dbfa716d Mon Sep 17 00:00:00 2001 From: Rainer Mueller Date: Tue, 2 Aug 2011 06:29:14 +0200 Subject: [PATCH 4/6] Use $(CC) for linking --- simulat0r/tui/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/simulat0r/tui/Makefile b/simulat0r/tui/Makefile index 84a2447..a81d347 100644 --- a/simulat0r/tui/Makefile +++ b/simulat0r/tui/Makefile @@ -31,7 +31,6 @@ OBJS += simulat0r.o all : simulat0r simulat0r : $(OBJS) $(LIBS) - $(LD) $(OBJS) $(LIBS) -lc -o $@ clean: $(RM) simulat0r.o From 35b92adcfc16c13b15b0a778964c118bda45b89b Mon Sep 17 00:00:00 2001 From: Rainer Mueller Date: Fri, 5 Aug 2011 14:23:27 +0200 Subject: [PATCH 5/6] No section attribute on Mac OS X This attribute isn't compatible with Mach-O, so avoid this when building simulat0r on Mac OS X. --- firmware/l0dable/mktable.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/firmware/l0dable/mktable.pl b/firmware/l0dable/mktable.pl index ad54420..254ca2c 100755 --- a/firmware/l0dable/mktable.pl +++ b/firmware/l0dable/mktable.pl @@ -77,7 +77,12 @@ sub wanted { File::Find::find({wanted => \&wanted}, '.'); print C ""; -print C qq!__attribute__ ((used, section("table"))) const void * TheTable[]={!; +print C < Date: Fri, 5 Aug 2011 14:45:20 +0200 Subject: [PATCH 6/6] Weak aliasing is not supported with Mach-O This fixes the simulator for Mac OS X. --- simulat0r/firmware/lcd/display.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/simulat0r/firmware/lcd/display.c b/simulat0r/firmware/lcd/display.c index de1d975..90fce64 100644 --- a/simulat0r/firmware/lcd/display.c +++ b/simulat0r/firmware/lcd/display.c @@ -1,8 +1,14 @@ +#ifdef __APPLE__ +#define lcdRefresh _hideaway_lcdRefresh +#endif #define lcdDisplay _hideaway_lcdDisplay #define lcdInit _hideaway_lcdInit #include "../../../firmware/lcd/display.c" #undef lcdDisplay #undef lcdInit +#ifdef __APPLE__ +#undef lcdRefresh +#endif #include "simulator.h" @@ -10,5 +16,11 @@ void lcdDisplay() { simlcdDisplayUpdate(); } +#ifdef __APPLE__ +void lcdRefresh() { + lcdDisplay(); +} +#endif + void lcdInit() { }