From 5f037ac015e6d76d030a163753db5ff58cdff49b Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Tue, 8 Feb 2011 20:05:25 +0000 Subject: Initial maemo platform support Adds Nokia N900, N810 and N800 support. Features: - Introduce maemo specific platform defines - Play audio in silent mode - Stop playback on incoming calls - Battery level readout - Bluetooth headset support - Save CPU by disabling screen updates if the display is off or the app doesn't have input focus - N900: GStreamer audio backend Kudos to kugel for the code review. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29248 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config.h | 10 +++++++++- firmware/export/config/application.h | 13 ++++++++++--- firmware/export/debug.h | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) (limited to 'firmware/export') diff --git a/firmware/export/config.h b/firmware/export/config.h index d59b259fb9..3063e1f06d 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -83,6 +83,9 @@ #define PLATFORM_HOSTED (1<<1) #define PLATFORM_ANDROID (1<<2) #define PLATFORM_SDL (1<<3) +#define PLATFORM_MAEMO4 (1<<4) +#define PLATFORM_MAEMO5 (1<<5) +#define PLATFORM_MAEMO (PLATFORM_MAEMO4|PLATFORM_MAEMO5) /* CONFIG_KEYPAD */ #define PLAYER_PAD 1 @@ -500,7 +503,12 @@ Lyre prototype 1 */ #endif /* define for all cpus from ARM family */ -#if (CONFIG_CPU == IMX31L) +#if (CONFIG_PLATFORM & PLATFORM_MAEMO5) && defined(MAEMO_ARM_BUILD) +#define CPU_ARM +#define ARM_ARCH 7 /* ARMv7 */ + +#elif (CONFIG_CPU == IMX31L) \ + || ((CONFIG_PLATFORM & PLATFORM_MAEMO4) && defined(MAEMO_ARM_BUILD)) #define CPU_ARM #define ARM_ARCH 6 /* ARMv6 */ diff --git a/firmware/export/config/application.h b/firmware/export/config/application.h index b731f0cf76..64ebbf3685 100644 --- a/firmware/export/config/application.h +++ b/firmware/export/config/application.h @@ -6,6 +6,10 @@ /* We don't run on hardware directly */ #ifdef ANDROID #define CONFIG_PLATFORM (PLATFORM_HOSTED|PLATFORM_ANDROID) +#elif MAEMO5 +#define CONFIG_PLATFORM (PLATFORM_HOSTED|PLATFORM_MAEMO5) +#elif MAEMO4 +#define CONFIG_PLATFORM (PLATFORM_HOSTED|PLATFORM_MAEMO4) #else #define CONFIG_PLATFORM (PLATFORM_HOSTED|PLATFORM_SDL) #endif @@ -75,17 +79,20 @@ /* Define this if you do software codec */ #define CONFIG_CODEC SWCODEC +#if (CONFIG_PLATFORM & (PLATFORM_ANDROID|PLATFORM_MAEMO)) +#define HAVE_MULTIMEDIA_KEYS +#endif + #if (CONFIG_PLATFORM & PLATFORM_ANDROID) #define CONFIG_KEYPAD ANDROID_PAD -#define HAVE_MULTIMEDIA_KEYS -#elif (CONFIG_PLATFORM & PLATFORM_SDL) +#elif (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO)) #define HAVE_SCROLLWHEEL #define CONFIG_KEYPAD SDL_PAD #else #error unknown platform #endif -#if (CONFIG_PLATFORM & PLATFORM_SDL) +#if (CONFIG_PLATFORM & (PLATFORM_SDL|PLATFORM_MAEMO)) /* Use SDL audio/pcm in a SDL app build */ #define HAVE_SDL #define HAVE_SDL_AUDIO diff --git a/firmware/export/debug.h b/firmware/export/debug.h index 043ec26bbb..99cdf42c05 100644 --- a/firmware/export/debug.h +++ b/firmware/export/debug.h @@ -34,7 +34,7 @@ extern void ldebugf(const char* file, int line, const char *fmt, ...) /* */ #if defined(SIMULATOR) && !defined(__PCTOOL__) \ - || ((CONFIG_PLATFORM & PLATFORM_ANDROID) && defined(DEBUG)) + || ((CONFIG_PLATFORM & (PLATFORM_ANDROID|PLATFORM_MAEMO)) && defined(DEBUG)) #define DEBUGF debugf #define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__) #else -- cgit v1.2.3