From 3c7e299cf35fa4f8cadaaed4afe9cb164871c586 Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Sat, 7 Feb 2009 11:15:30 +0000 Subject: Simplify conditions for including serial port support (it's now HAVE_SERIAL). This should save a little binsize and RAM for target that don't have/use a serial port. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19936 a1c6a512-1295-4272-9138-f99709370657 --- apps/main.c | 2 +- firmware/SOURCES | 2 ++ firmware/drivers/serial.c | 30 +----------------------------- firmware/export/config-ipod4g.h | 1 + firmware/export/config-ipodcolor.h | 1 + firmware/export/config-ipodnano.h | 1 + firmware/export/config-ipodvideo.h | 1 + firmware/export/config-player.h | 2 ++ firmware/export/config-recorder.h | 2 ++ 9 files changed, 12 insertions(+), 30 deletions(-) diff --git a/apps/main.c b/apps/main.c index 94a9231d7f..24a89eca56 100644 --- a/apps/main.c +++ b/apps/main.c @@ -388,7 +388,7 @@ static void init(void) #ifdef DEBUG debug_init(); #else -#if !defined(HAVE_FMADC) && !(CONFIG_STORAGE & STORAGE_MMC) +#ifdef HAVE_SERIAL serial_setup(); #endif #endif diff --git a/firmware/SOURCES b/firmware/SOURCES index c08d8f2d66..67a6a8a93a 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -108,7 +108,9 @@ drivers/button.c #ifdef HAVE_DAC3550A drivers/dac.c #endif +#ifdef HAVE_SERIAL drivers/serial.c +#endif #endif /* SIMULATOR */ diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c index f66221b561..694ddef79d 100644 --- a/firmware/drivers/serial.c +++ b/firmware/drivers/serial.c @@ -41,9 +41,6 @@ /* FIX: this doesn't work on iRiver or iPod yet */ /* iFP7xx has no remote */ -#if !defined(HAVE_FMADC) /* Recorder FM/V2 has no remote control pin */ \ - && !(CONFIG_STORAGE & STORAGE_MMC) /* MMC takes serial port 1, so don't mess with it */ - /* Received byte identifiers */ #define PLAY 0xC1 #define STOP 0xC2 @@ -177,8 +174,7 @@ int remote_control_rx(void) return ret; } -#endif /* !HAVE_FMADC && !STORAGE_MMC */ -#elif defined(CPU_COLDFIRE) && defined(HAVE_SERIAL) +#elif defined(CPU_COLDFIRE) void serial_setup (void) { @@ -428,30 +424,6 @@ void SERIAL0(void) } } -#else /* Other targets */ -void serial_setup (void) -{ - /* a dummy */ -} - -int tx_rdy(void) -{ - /* a dummy */ - return 1; -} - -int rx_rdy(void) -{ - /* a dummy */ - return 0; -} - -void tx_writec(const unsigned char c) -{ - (void)c; - /* a dummy */ -} - #endif void dprintf(const char * str, ... ) diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h index f6c71f39d8..e2aaa96ded 100644 --- a/firmware/export/config-ipod4g.h +++ b/firmware/export/config-ipod4g.h @@ -187,5 +187,6 @@ #define ICODE_ATTR_TREMOR_NOT_MDCT #define IPOD_ACCESSORY_PROTOCOL +#define HAVE_SERIAL #endif diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h index 58a888a969..e7395919d6 100644 --- a/firmware/export/config-ipodcolor.h +++ b/firmware/export/config-ipodcolor.h @@ -167,5 +167,6 @@ #define ICODE_ATTR_TREMOR_NOT_MDCT #define IPOD_ACCESSORY_PROTOCOL +#define HAVE_SERIAL #endif diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h index 1d82ec4428..3bf44b3abe 100644 --- a/firmware/export/config-ipodnano.h +++ b/firmware/export/config-ipodnano.h @@ -177,5 +177,6 @@ #define ICODE_ATTR_TREMOR_NOT_MDCT #define IPOD_ACCESSORY_PROTOCOL +#define HAVE_SERIAL #endif diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h index b658a9b3f8..d3e8dc0140 100644 --- a/firmware/export/config-ipodvideo.h +++ b/firmware/export/config-ipodvideo.h @@ -199,5 +199,6 @@ #define ICODE_ATTR_TREMOR_NOT_MDCT #define IPOD_ACCESSORY_PROTOCOL +#define HAVE_SERIAL #endif diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h index 9008212a17..91d97abd97 100644 --- a/firmware/export/config-player.h +++ b/firmware/export/config-player.h @@ -100,3 +100,5 @@ #define MAX_CONTRAST_SETTING 31 #define DEFAULT_CONTRAST_SETTING 30 +#define HAVE_SERIAL + diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h index ff74eef402..f0a513851f 100644 --- a/firmware/export/config-recorder.h +++ b/firmware/export/config-recorder.h @@ -120,3 +120,5 @@ #define MIN_CONTRAST_SETTING 5 #define MAX_CONTRAST_SETTING 63 +#define HAVE_SERIAL + -- cgit v1.2.3