summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/audiohw.h2
-rw-r--r--firmware/export/config.h14
-rw-r--r--firmware/export/config/application.h28
-rw-r--r--firmware/export/config/sim.h3
-rw-r--r--firmware/export/debug.h7
-rw-r--r--firmware/export/thread.h14
6 files changed, 53 insertions, 15 deletions
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h
index d4861aa..658dd13 100644
--- a/firmware/export/audiohw.h
+++ b/firmware/export/audiohw.h
@@ -66,7 +66,7 @@
#elif defined(HAVE_AK4537)
#include "ak4537.h"
#endif
-#if defined(HAVE_SDL_AUDIO)
+#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
/* #include <SDL_audio.h> gives errors in other code areas,
* we don't really need it here, so don't. but it should maybe be fixed */
#ifndef SIMULATOR /* simulator gets values from the target .h files */
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 1b8a782..3b59004 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -78,8 +78,10 @@
* bit fields to allow PLATFORM_HOSTED to be OR'ed e.g. with a
* possible future PLATFORM_ANDROID (some OSes might need totally different
* handling to run on them than a stand-alone application) */
-#define PLATFORM_NATIVE (1<<0)
-#define PLATFORM_HOSTED (1<<1)
+#define PLATFORM_NATIVE (1<<0)
+#define PLATFORM_HOSTED (1<<1)
+#define PLATFORM_ANDROID (1<<2)
+#define PLATFORM_SDL (1<<3)
/* CONFIG_KEYPAD */
#define PLAYER_PAD 1
@@ -427,6 +429,8 @@ Lyre prototype 1 */
#elif defined(APPLICATION)
#include "config/application.h"
+#define CONFIG_CPU 0
+#define CONFIG_STORAGE 0
#else
/* no known platform */
#endif
@@ -689,11 +693,17 @@ Lyre prototype 1 */
#define HAVE_EXTENDED_MESSAGING_AND_NAME
#define HAVE_WAKEUP_EXT_CB
+
+#if (CONFIG_PLATFORM & PLATFORM_ANDROID)
+#define HAVE_PRIORITY_SCHEDULING
+#endif
+
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
#define HAVE_PRIORITY_SCHEDULING
#define HAVE_SCHEDULER_BOOSTCTRL
#endif /* PLATFORM_NATIVE */
+
#define HAVE_SEMAPHORE_OBJECTS
#if defined(HAVE_USBSTACK) && CONFIG_USBOTG == USBOTG_ARC
diff --git a/firmware/export/config/application.h b/firmware/export/config/application.h
index a5583de..988f0d5 100644
--- a/firmware/export/config/application.h
+++ b/firmware/export/config/application.h
@@ -4,11 +4,13 @@
#define TARGET_TREE /* this target is using the target tree system */
/* We don't run on hardware directly */
-#define CONFIG_PLATFORM PLATFORM_HOSTED
+#ifdef ANDROID
+#define CONFIG_PLATFORM (PLATFORM_HOSTED|PLATFORM_ANDROID)
+#else
+#define CONFIG_PLATFORM (PLATFORM_HOSTED|PLATFORM_SDL)
+#endif
/* For Rolo and boot loader */
-/*
-#define MODEL_NUMBER 24
-*/
+#define MODEL_NUMBER 100
#define MODEL_NAME "Rockbox"
@@ -37,9 +39,17 @@
/* define this if you would like tagcache to build on this target */
#define HAVE_TAGCACHE
-/* LCD dimensions */
+/* LCD dimensions
+ *
+ * overriden by configure for application builds */
+#ifndef LCD_WIDTH
#define LCD_WIDTH 320
-#define LCD_HEIGHT 240
+#endif
+
+#ifndef LCD_HEIGHT
+#define LCD_HEIGHT 480
+#endif
+
#define LCD_DEPTH 16
#define LCD_PIXELFORMAT 565
@@ -62,10 +72,10 @@
#define CONFIG_CODEC SWCODEC
#define CONFIG_KEYPAD COWON_D2_PAD
+
+#if (CONFIG_PLATFORM & PLATFORM_SDL)
/* Use SDL audio/pcm in a SDL app build */
#define HAVE_SDL
-
-#ifdef HAVE_SDL
#define HAVE_SDL_AUDIO
#endif
@@ -92,3 +102,5 @@
/* Define this if a programmable hotkey is mapped */
//#define HAVE_HOTKEY
+
+#define BOOTDIR "/.rockbox"
diff --git a/firmware/export/config/sim.h b/firmware/export/config/sim.h
index 5dcb4f6..066201a 100644
--- a/firmware/export/config/sim.h
+++ b/firmware/export/config/sim.h
@@ -99,7 +99,8 @@
#define DEFAULT_BRIGHTNESS_SETTING MAX_BRIGHTNESS_SETTING
#endif
+#define CONFIG_PLATFORM (PLATFORM_HOSTED|PLATFORM_SDL)
#define HAVE_SDL
#define HAVE_SDL_AUDIO
-#define CONFIG_PLATFORM PLATFORM_HOSTED
+
#define _ISOC99_SOURCE 1
diff --git a/firmware/export/debug.h b/firmware/export/debug.h
index f7f0f32..f19a96c 100644
--- a/firmware/export/debug.h
+++ b/firmware/export/debug.h
@@ -21,6 +21,7 @@
#ifndef DEBUG_H
#define DEBUG_H
+#include "config.h"
#include "gcc_extensions.h"
extern void debug_init(void);
@@ -34,7 +35,11 @@ extern void ldebugf(const char* file, int line, const char *fmt, ...)
/* */
#if defined(SIMULATOR) && !defined(__PCTOOL__)
#define DEBUGF debugf
-#define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__)
+#define LDEBUGF(...) ldebugf(__FILE__, __LINE__, __VA_ARGS__) && defined(DEBUG)
+#elif (CONFIG_PLATFORM & PLATFORM_ANDROID)
+#include "system-target.h"
+#define DEBUGF LOG
+#define LDEBUGF(...)
#else
#if defined(DEBUG)
diff --git a/firmware/export/thread.h b/firmware/export/thread.h
index c4b7d1f..2853c0b 100644
--- a/firmware/export/thread.h
+++ b/firmware/export/thread.h
@@ -79,9 +79,19 @@
#define MAXTHREADS (BASETHREADS+TARGET_EXTRA_THREADS)
+/*
+ * We need more stack when we run under a host
+ * maybe more expensive C lib functions?
+ *
+ * simulator doesn't simulate stack usage anyway but well ... */
+#if ((CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(SIMULATOR))
#define DEFAULT_STACK_SIZE 0x400 /* Bytes */
+#else
+#define DEFAULT_STACK_SIZE 0x1000 /* Bytes */
+#endif
+
-#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
+#if (CONFIG_PLATFORM & (PLATFORM_NATIVE|PLATFORM_ANDROID))
/* Need to keep structures inside the header file because debug_menu
* needs them. */
#ifdef CPU_COLDFIRE
@@ -101,7 +111,7 @@ struct regs
uint32_t pr; /* 32 - Procedure register */
uint32_t start; /* 36 - Thread start address, or NULL when started */
};
-#elif defined(CPU_ARM)
+#elif defined(CPU_ARM) || (CONFIG_PLATFORM & PLATFORM_ANDROID)
struct regs
{
uint32_t r[8]; /* 0-28 - Registers r4-r11 */