summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/SOURCES38
-rw-r--r--firmware/backlight.c5
-rw-r--r--firmware/buffer.c2
-rw-r--r--firmware/common/dircache.c8
-rw-r--r--firmware/drivers/button.c6
-rw-r--r--firmware/export/ata_idle_notify.h2
-rw-r--r--firmware/export/audio.h2
-rw-r--r--firmware/export/buffer.h6
-rw-r--r--firmware/export/config.h28
-rw-r--r--firmware/export/config/sim.h1
-rw-r--r--firmware/export/font.h2
-rw-r--r--firmware/export/hwcompat.h4
-rw-r--r--firmware/export/kernel.h2
-rw-r--r--firmware/export/power.h2
-rw-r--r--firmware/export/powermgmt.h4
-rw-r--r--firmware/export/storage.h4
-rw-r--r--firmware/export/system.h9
-rw-r--r--firmware/export/thread.h8
-rw-r--r--firmware/export/timer.h2
-rw-r--r--firmware/export/tuner.h4
-rw-r--r--firmware/include/dbgcheck.h4
-rw-r--r--firmware/include/dir_uncached.h6
-rw-r--r--firmware/include/dircache.h2
-rw-r--r--firmware/include/file.h5
-rw-r--r--firmware/logf.c2
-rw-r--r--firmware/panic.c2
-rw-r--r--firmware/powermgmt.c6
-rw-r--r--firmware/scroll_engine.c4
-rw-r--r--firmware/sound.c12
-rw-r--r--firmware/system.c2
30 files changed, 101 insertions, 83 deletions
diff --git a/firmware/SOURCES b/firmware/SOURCES
index c95946dd0d..bef2b772ad 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -10,7 +10,7 @@ usb.c
10logf.c 10logf.c
11#endif /* ROCKBOX_HAS_LOGF */ 11#endif /* ROCKBOX_HAS_LOGF */
12kernel.c 12kernel.c
13#ifndef SIMULATOR 13#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
14#ifdef RB_PROFILE 14#ifdef RB_PROFILE
15profile.c 15profile.c
16#endif /* RB_PROFILE */ 16#endif /* RB_PROFILE */
@@ -19,7 +19,7 @@ rolo.c
19#endif /* !defined(BOOTLOADER) || defined(CPU_SH) */ 19#endif /* !defined(BOOTLOADER) || defined(CPU_SH) */
20thread.c 20thread.c
21timer.c 21timer.c
22#endif /* SIMULATOR */ 22#endif /* PLATFORM_NATIVE */
23#ifdef HAVE_SDL 23#ifdef HAVE_SDL
24target/hosted/sdl/button-sdl.c 24target/hosted/sdl/button-sdl.c
25target/hosted/sdl/kernel-sdl.c 25target/hosted/sdl/kernel-sdl.c
@@ -40,13 +40,13 @@ panic.c
40debug.c 40debug.c
41 41
42/* Standard library */ 42/* Standard library */
43#if !defined(SIMULATOR) || defined(__MINGW32__) || defined(__CYGWIN__) 43#if (CONFIG_PLATFORM & PLATFORM_NATIVE) || defined(__MINGW32__) || defined(__CYGWIN__)
44libc/errno.c 44libc/errno.c
45libc/strtok.c 45libc/strtok.c
46/* alsa on linux requires a more advanced sprintf, i.e. not ours */ 46/* alsa on linux requires a more advanced sprintf, i.e. not ours */
47libc/sprintf.c 47libc/sprintf.c
48#endif /* !SIMULATOR || __MINGW32__ || __CYGWIN__ */ 48#endif /* PLATFORM_NATIVE || __MINGW32__ || __CYGWIN__ */
49#if !defined(SIMULATOR) 49#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
50libc/atoi.c 50libc/atoi.c
51libc/ctype.c 51libc/ctype.c
52libc/memcmp.c 52libc/memcmp.c
@@ -70,11 +70,11 @@ common/crc32.c
70#ifdef MI4_FORMAT 70#ifdef MI4_FORMAT
71common/crc32-mi4.c 71common/crc32-mi4.c
72#endif 72#endif
73#ifndef SIMULATOR 73#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
74common/dir_uncached.c 74common/dir_uncached.c
75common/file.c 75common/file.c
76common/disk.c 76common/disk.c
77#endif /* SIMULATOR */ 77#endif /* PLATFORM_NATIVE */
78#ifdef HAVE_DIRCACHE 78#ifdef HAVE_DIRCACHE
79common/dircache.c 79common/dircache.c
80#endif /* HAVE_DIRCACHE */ 80#endif /* HAVE_DIRCACHE */
@@ -143,21 +143,21 @@ backlight-sw-fading.c
143/* Misc. */ 143/* Misc. */
144drivers/led.c 144drivers/led.c
145drivers/button.c 145drivers/button.c
146#ifndef SIMULATOR 146#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
147#ifdef HAVE_DAC3550A 147#ifdef HAVE_DAC3550A
148drivers/dac.c 148drivers/dac.c
149#endif 149#endif
150#ifdef HAVE_SERIAL 150#ifdef HAVE_SERIAL
151drivers/serial.c 151drivers/serial.c
152#endif 152#endif
153#endif /* SIMULATOR */ 153#endif /* PLATFORM_NATIVE */
154#ifdef HAVE_TOUCHSCREEN 154#ifdef HAVE_TOUCHSCREEN
155drivers/touchscreen.c 155drivers/touchscreen.c
156#endif 156#endif
157 157
158 158
159/* Storage */ 159/* Storage */
160#ifndef SIMULATOR 160#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
161#if (CONFIG_STORAGE & STORAGE_MMC) 161#if (CONFIG_STORAGE & STORAGE_MMC)
162drivers/ata_mmc.c 162drivers/ata_mmc.c
163#endif 163#endif
@@ -184,7 +184,7 @@ drivers/fat.c
184#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD) 184#if (CONFIG_STORAGE & STORAGE_MMC) || (CONFIG_STORAGE & STORAGE_SD)
185sdmmc.c 185sdmmc.c
186#endif 186#endif
187#endif /* SIMULATOR */ 187#endif /* PLATFORM_NATIVE */
188 188
189/* EEPROM */ 189/* EEPROM */
190#ifdef HAVE_EEPROM 190#ifdef HAVE_EEPROM
@@ -195,7 +195,7 @@ eeprom_settings.c
195#endif /* HAVE_EEPROM */ 195#endif /* HAVE_EEPROM */
196 196
197/* RTC */ 197/* RTC */
198#ifndef SIMULATOR 198#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
199#if (CONFIG_RTC == RTC_M41ST84W) 199#if (CONFIG_RTC == RTC_M41ST84W)
200drivers/rtc/rtc_m41st84w.c 200drivers/rtc/rtc_m41st84w.c
201#elif (CONFIG_RTC == RTC_PCF50606) 201#elif (CONFIG_RTC == RTC_PCF50606)
@@ -225,13 +225,13 @@ drivers/rtc/rtc_s35390a.c
225#elif (CONFIG_RTC == RTC_D2) 225#elif (CONFIG_RTC == RTC_D2)
226drivers/rtc/rtc_d2.c 226drivers/rtc/rtc_d2.c
227#endif /* (CONFIG_RTC == RTC_) */ 227#endif /* (CONFIG_RTC == RTC_) */
228#endif /* SIMULATOR */ 228#endif /* PLATFORM_NATIVE */
229 229
230#ifndef BOOTLOADER 230#ifndef BOOTLOADER
231/* Tuner */ 231/* Tuner */
232#if CONFIG_TUNER 232#if CONFIG_TUNER
233tuner.c 233tuner.c
234#ifndef SIMULATOR 234#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
235#if (CONFIG_TUNER & LV24020LP) 235#if (CONFIG_TUNER & LV24020LP)
236drivers/tuner/lv24020lp.c 236drivers/tuner/lv24020lp.c
237#endif /* (CONFIG_TUNER & LV24020LP) */ 237#endif /* (CONFIG_TUNER & LV24020LP) */
@@ -254,7 +254,7 @@ drivers/tuner/ipod_remote_tuner.c
254#if (CONFIG_TUNER & RDA5802) 254#if (CONFIG_TUNER & RDA5802)
255drivers/tuner/rda5802.c 255drivers/tuner/rda5802.c
256#endif /* (CONFIG_TUNER & RDA5802) */ 256#endif /* (CONFIG_TUNER & RDA5802) */
257#endif /*SIMULATOR */ 257#endif /* PLATFORM_NATIVE */
258#endif /* CONFIG_TUNER */ 258#endif /* CONFIG_TUNER */
259#endif /* BOOTLOADER */ 259#endif /* BOOTLOADER */
260 260
@@ -285,7 +285,7 @@ drivers/mas.c
285#endif /* SWCODEC */ 285#endif /* SWCODEC */
286 286
287/* Audio codec */ 287/* Audio codec */
288#if !defined(SIMULATOR) && !defined(BOOTLOADER) 288#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER)
289#if defined(HAVE_UDA1380) 289#if defined(HAVE_UDA1380)
290drivers/audio/uda1380.c 290drivers/audio/uda1380.c
291#elif defined(HAVE_WM8751) \ 291#elif defined(HAVE_WM8751) \
@@ -319,7 +319,7 @@ drivers/audio/sdl.c
319#if CONFIG_CODEC == SWCODEC 319#if CONFIG_CODEC == SWCODEC
320target/hosted/sdl/pcm-sdl.c 320target/hosted/sdl/pcm-sdl.c
321#endif 321#endif
322#endif /* !defined(SIMULATOR) && !defined(BOOTLOADER) */ 322#endif /* (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER) */
323 323
324/* USB Stack */ 324/* USB Stack */
325#if !defined(SIMULATOR) 325#if !defined(SIMULATOR)
@@ -531,10 +531,10 @@ libc/memmove.c
531libc/memset.c 531libc/memset.c
532common/memset16.c 532common/memset16.c
533libc/strlen.c 533libc/strlen.c
534#ifndef SIMULATOR 534#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
535crt0.S 535crt0.S
536drivers/i2c.c 536drivers/i2c.c
537#endif /* SIMULATOR */ 537#endif /* PLATFORM_NATIVE */
538 538
539#endif /* defined(CPU_*) */ 539#endif /* defined(CPU_*) */
540 540
diff --git a/firmware/backlight.c b/firmware/backlight.c
index 27bc8a453f..6a5070df49 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -40,6 +40,9 @@
40#ifdef HAVE_REMOTE_LCD 40#ifdef HAVE_REMOTE_LCD
41#include "lcd-remote.h" 41#include "lcd-remote.h"
42#endif 42#endif
43
44#if defined(HAVE_BACKLIGHT) && defined(BACKLIGHT_FULL_INIT)
45
43#ifndef SIMULATOR 46#ifndef SIMULATOR
44#include "backlight-target.h" 47#include "backlight-target.h"
45#else 48#else
@@ -51,8 +54,6 @@
51#include "backlight-sw-fading.h" 54#include "backlight-sw-fading.h"
52#endif 55#endif
53 56
54#if defined(HAVE_BACKLIGHT) && defined(BACKLIGHT_FULL_INIT)
55
56#define BACKLIGHT_FADE_IN_THREAD \ 57#define BACKLIGHT_FADE_IN_THREAD \
57 (CONFIG_BACKLIGHT_FADING & (BACKLIGHT_FADING_SW_SETTING \ 58 (CONFIG_BACKLIGHT_FADING & (BACKLIGHT_FADING_SW_SETTING \
58 |BACKLIGHT_FADING_SW_HW_REG \ 59 |BACKLIGHT_FADING_SW_HW_REG \
diff --git a/firmware/buffer.c b/firmware/buffer.c
index 07d06cd4a0..015fc04b86 100644
--- a/firmware/buffer.c
+++ b/firmware/buffer.c
@@ -21,7 +21,7 @@
21#include <stdio.h> 21#include <stdio.h>
22#include "buffer.h" 22#include "buffer.h"
23 23
24#ifdef SIMULATOR 24#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
25unsigned char audiobuffer[(MEM*1024-256)*1024]; 25unsigned char audiobuffer[(MEM*1024-256)*1024];
26unsigned char *audiobufend = audiobuffer + sizeof(audiobuffer); 26unsigned char *audiobufend = audiobuffer + sizeof(audiobuffer);
27#else 27#else
diff --git a/firmware/common/dircache.c b/firmware/common/dircache.c
index f8365e1137..0a58175d53 100644
--- a/firmware/common/dircache.c
+++ b/firmware/common/dircache.c
@@ -171,7 +171,7 @@ static bool check_event_queue(void)
171 return false; 171 return false;
172} 172}
173 173
174#ifndef SIMULATOR 174#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
175/* scan and build static data (avoid redundancy on stack) */ 175/* scan and build static data (avoid redundancy on stack) */
176static struct 176static struct
177{ 177{
@@ -301,7 +301,7 @@ static int dircache_scan_and_build(IF_MV2(int volume,) struct dircache_entry *ce
301 301
302 return sab_process_dir(0, ce); 302 return sab_process_dir(0, ce);
303} 303}
304#else /* !SIMULATOR */ 304#elif (CONFIG_PLATFORM & PLATFORM_HOSTED) /* PLATFORM_HOSTED */
305static char sab_path[MAX_PATH]; 305static char sab_path[MAX_PATH];
306 306
307static int sab_process_dir(struct dircache_entry *ce) 307static int sab_process_dir(struct dircache_entry *ce)
@@ -400,7 +400,7 @@ static int dircache_scan_and_build(IF_MV2(int volume,) struct dircache_entry *ce
400 strlcpy(sab_path, "/", sizeof sab_path); 400 strlcpy(sab_path, "/", sizeof sab_path);
401 return sab_process_dir(ce); 401 return sab_process_dir(ce);
402} 402}
403#endif /* SIMULATOR */ 403#endif /* PLATFORM_NATIVE */
404 404
405/** 405/**
406 * Internal function to get a pointer to dircache_entry for a given filename. 406 * Internal function to get a pointer to dircache_entry for a given filename.
@@ -689,7 +689,7 @@ static void dircache_thread(void)
689 dircache_initialized = false; 689 dircache_initialized = false;
690 break ; 690 break ;
691 691
692#ifndef SIMULATOR 692#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
693 case SYS_USB_CONNECTED: 693 case SYS_USB_CONNECTED:
694 usb_acknowledge(SYS_USB_CONNECTED_ACK); 694 usb_acknowledge(SYS_USB_CONNECTED_ACK);
695 usb_wait_for_disconnect(&dircache_queue); 695 usb_wait_for_disconnect(&dircache_queue);
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index 16c0d2c16a..171acaaded 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -33,7 +33,7 @@
33#include "serial.h" 33#include "serial.h"
34#include "power.h" 34#include "power.h"
35#include "powermgmt.h" 35#include "powermgmt.h"
36#ifdef SIMULATOR 36#ifdef HAVE_SDL
37#include "button-sdl.h" 37#include "button-sdl.h"
38#else 38#else
39#include "button-target.h" 39#include "button-target.h"
@@ -215,7 +215,7 @@ static void button_tick(void)
215 215
216 /* Safety net for players without hardware 216 /* Safety net for players without hardware
217 poweroff */ 217 poweroff */
218#ifndef SIMULATOR 218#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
219 if(repeat_count > POWEROFF_COUNT * 10) 219 if(repeat_count > POWEROFF_COUNT * 10)
220 power_off(); 220 power_off();
221#endif 221#endif
@@ -440,7 +440,7 @@ static int button_flip(int button)
440{ 440{
441 int newbutton = button; 441 int newbutton = button;
442 442
443#ifndef SIMULATOR 443#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
444 newbutton &= 444 newbutton &=
445 ~(BUTTON_LEFT | BUTTON_RIGHT 445 ~(BUTTON_LEFT | BUTTON_RIGHT
446#if defined(BUTTON_UP) && defined(BUTTON_DOWN) 446#if defined(BUTTON_UP) && defined(BUTTON_DOWN)
diff --git a/firmware/export/ata_idle_notify.h b/firmware/export/ata_idle_notify.h
index 348165f1d1..439b883e41 100644
--- a/firmware/export/ata_idle_notify.h
+++ b/firmware/export/ata_idle_notify.h
@@ -43,7 +43,7 @@ enum {
43 DISK_EVENT_SPINUP = (EVENT_CLASS_DISK|1), 43 DISK_EVENT_SPINUP = (EVENT_CLASS_DISK|1),
44}; 44};
45 45
46#define USING_STORAGE_CALLBACK !defined(SIMULATOR) \ 46#define USING_STORAGE_CALLBACK (CONFIG_PLATFORM & PLATFORM_NATIVE) \
47 && ! ((CONFIG_STORAGE & STORAGE_NAND) \ 47 && ! ((CONFIG_STORAGE & STORAGE_NAND) \
48 && (CONFIG_NAND == NAND_IFP7XX)) \ 48 && (CONFIG_NAND == NAND_IFP7XX)) \
49 && !defined(BOOTLOADER) 49 && !defined(BOOTLOADER)
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index 1e09081ba5..b81597a892 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -36,7 +36,7 @@
36#endif /* CONFIG_CODEC == SWCODEC */ 36#endif /* CONFIG_CODEC == SWCODEC */
37 37
38 38
39#ifdef SIMULATOR 39#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
40#define audio_play(x) sim_audio_play(x) 40#define audio_play(x) sim_audio_play(x)
41#endif 41#endif
42 42
diff --git a/firmware/export/buffer.h b/firmware/export/buffer.h
index 4c80471b27..ae8886bffc 100644
--- a/firmware/export/buffer.h
+++ b/firmware/export/buffer.h
@@ -23,10 +23,10 @@
23 23
24#include "config.h" 24#include "config.h"
25/* defined in linker script */ 25/* defined in linker script */
26#ifdef SIMULATOR 26#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
27extern unsigned char *audiobufend;
28#else
29extern unsigned char audiobufend[]; 27extern unsigned char audiobufend[];
28#else
29extern unsigned char *audiobufend;
30#endif 30#endif
31 31
32extern unsigned char *audiobuf; 32extern unsigned char *audiobuf;
diff --git a/firmware/export/config.h b/firmware/export/config.h
index de84dc3742..c06e5d110a 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -74,6 +74,13 @@
74#define AT91SAM9260 9260 74#define AT91SAM9260 9260
75#define AS3525v2 35252 75#define AS3525v2 35252
76 76
77/* platforms
78 * bit fields to allow PLATFORM_HOSTED to be OR'ed e.g. with a
79 * possible future PLATFORM_ANDROID (some OSes might need totally different
80 * handling to run on them than a stand-alone application) */
81#define PLATFORM_NATIVE (1<<0)
82#define PLATFORM_HOSTED (1<<1)
83
77/* CONFIG_KEYPAD */ 84/* CONFIG_KEYPAD */
78#define PLAYER_PAD 1 85#define PLAYER_PAD 1
79#define RECORDER_PAD 2 86#define RECORDER_PAD 2
@@ -497,6 +504,10 @@ Lyre prototype 1 */
497#define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING 504#define CONFIG_BACKLIGHT_FADING BACKLIGHT_NO_FADING
498#endif 505#endif
499 506
507#ifndef CONFIG_PLATFORM
508#define CONFIG_PLATFORM PLATFORM_NATIVE
509#endif
510
500#ifndef CONFIG_TUNER 511#ifndef CONFIG_TUNER
501#define CONFIG_TUNER 0 512#define CONFIG_TUNER 0
502#endif 513#endif
@@ -675,10 +686,10 @@ Lyre prototype 1 */
675#define HAVE_EXTENDED_MESSAGING_AND_NAME 686#define HAVE_EXTENDED_MESSAGING_AND_NAME
676#define HAVE_WAKEUP_EXT_CB 687#define HAVE_WAKEUP_EXT_CB
677 688
678#ifndef SIMULATOR 689#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
679#define HAVE_PRIORITY_SCHEDULING 690#define HAVE_PRIORITY_SCHEDULING
680#define HAVE_SCHEDULER_BOOSTCTRL 691#define HAVE_SCHEDULER_BOOSTCTRL
681#endif /* SIMULATOR */ 692#endif /* PLATFORM_NATIVE */
682 693
683#define HAVE_SEMAPHORE_OBJECTS 694#define HAVE_SEMAPHORE_OBJECTS
684 695
@@ -744,7 +755,7 @@ Lyre prototype 1 */
744#endif 755#endif
745 756
746/* IRAM usage */ 757/* IRAM usage */
747#if !defined(SIMULATOR) && /* Not for simulators */ \ 758#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && /* Not for hosted environments */ \
748 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \ 759 (((CONFIG_CPU == SH7034) && !defined(PLUGIN)) || /* SH1 archos: core only */ \
749 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \ 760 defined(CPU_COLDFIRE) || /* Coldfire: core, plugins, codecs */ \
750 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \ 761 defined(CPU_PP) || /* PortalPlayer: core, plugins, codecs */ \
@@ -780,9 +791,10 @@ Lyre prototype 1 */
780#define IBSS_ATTR 791#define IBSS_ATTR
781#define STATICIRAM static 792#define STATICIRAM static
782#endif 793#endif
794
783#if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) || \ 795#if (defined(CPU_PP) || (CONFIG_CPU == AS3525) || (CONFIG_CPU == AS3525v2) || \
784 (CONFIG_CPU == IMX31L)) \ 796 (CONFIG_CPU == IMX31L)) \
785 && !defined(SIMULATOR) && !defined(BOOTLOADER) 797 && (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(BOOTLOADER)
786/* Functions that have INIT_ATTR attached are NOT guaranteed to survive after 798/* Functions that have INIT_ATTR attached are NOT guaranteed to survive after
787 * root_menu() has been called. Their code may be overwritten by other data or 799 * root_menu() has been called. Their code may be overwritten by other data or
788 * code in order to save RAM, and references to them might point into 800 * code in order to save RAM, and references to them might point into
@@ -799,7 +811,7 @@ Lyre prototype 1 */
799#define INIT_ATTR 811#define INIT_ATTR
800#endif 812#endif
801 813
802#if defined(SIMULATOR) && defined(__APPLE__) 814#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && defined(__APPLE__)
803#define DATA_ATTR __attribute__ ((section("__DATA, .data"))) 815#define DATA_ATTR __attribute__ ((section("__DATA, .data")))
804#else 816#else
805#define DATA_ATTR __attribute__ ((section(".data"))) 817#define DATA_ATTR __attribute__ ((section(".data")))
@@ -923,7 +935,7 @@ Lyre prototype 1 */
923 935
924#else /* BOOTLOADER */ 936#else /* BOOTLOADER */
925 937
926#ifndef SIMULATOR 938#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
927//#define USB_ENABLE_SERIAL 939//#define USB_ENABLE_SERIAL
928#define USB_ENABLE_STORAGE 940#define USB_ENABLE_STORAGE
929 941
@@ -941,11 +953,11 @@ Lyre prototype 1 */
941/* This attribute can be used to enable to detection of plugin file handles leaks. 953/* This attribute can be used to enable to detection of plugin file handles leaks.
942 * When enabled, the plugin core will monitor open/close/creat and when the plugin exits 954 * When enabled, the plugin core will monitor open/close/creat and when the plugin exits
943 * will display an error message if the plugin leaked some file handles */ 955 * will display an error message if the plugin leaked some file handles */
944#ifndef SIMULATOR 956#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
945#define HAVE_PLUGIN_CHECK_OPEN_CLOSE 957#define HAVE_PLUGIN_CHECK_OPEN_CLOSE
946#endif 958#endif
947 959
948#if defined(HAVE_DIRCACHE) && !defined(SIMULATOR) 960#if defined(HAVE_DIRCACHE) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
949#define HAVE_IO_PRIORITY 961#define HAVE_IO_PRIORITY
950#endif 962#endif
951 963
diff --git a/firmware/export/config/sim.h b/firmware/export/config/sim.h
index d65b0fbbf8..5dcb4f6f2d 100644
--- a/firmware/export/config/sim.h
+++ b/firmware/export/config/sim.h
@@ -101,4 +101,5 @@
101 101
102#define HAVE_SDL 102#define HAVE_SDL
103#define HAVE_SDL_AUDIO 103#define HAVE_SDL_AUDIO
104#define CONFIG_PLATFORM PLATFORM_HOSTED
104#define _ISOC99_SOURCE 1 105#define _ISOC99_SOURCE 1
diff --git a/firmware/export/font.h b/firmware/export/font.h
index f6915d9c09..7284564380 100644
--- a/firmware/export/font.h
+++ b/firmware/export/font.h
@@ -28,7 +28,7 @@
28 */ 28 */
29#include "config.h" 29#include "config.h"
30 30
31#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR) 31#if defined(HAVE_LCD_BITMAP) || (CONFIG_PLATFORM & PLATFORM_HOSTED)
32#ifndef __PCTOOL__ 32#ifndef __PCTOOL__
33#include "font_cache.h" 33#include "font_cache.h"
34#include "sysfont.h" 34#include "sysfont.h"
diff --git a/firmware/export/hwcompat.h b/firmware/export/hwcompat.h
index 27fcb25e36..c37add49f9 100644
--- a/firmware/export/hwcompat.h
+++ b/firmware/export/hwcompat.h
@@ -24,7 +24,7 @@
24#include <stdbool.h> 24#include <stdbool.h>
25#include "config.h" 25#include "config.h"
26 26
27#if (CONFIG_CPU == SH7034) && !defined(SIMULATOR) 27#if (CONFIG_CPU == SH7034) && (CONFIG_PLATFORM & PLATFORM_NATIVE)
28 28
29#define ROM_VERSION (*(short *)0x020000fe) 29#define ROM_VERSION (*(short *)0x020000fe)
30 30
@@ -49,7 +49,7 @@ static inline int tuner_detect_type(void)
49} 49}
50#endif 50#endif
51 51
52#endif /* (CONFIG_CPU == SH7034) && !SIMULATOR */ 52#endif /* (CONFIG_CPU == SH7034) && (CONFIG_PLATFORM & PLATFORM_NATIVE) */
53 53
54#ifdef ARCHOS_PLAYER 54#ifdef ARCHOS_PLAYER
55bool is_new_player(void); 55bool is_new_player(void);
diff --git a/firmware/export/kernel.h b/firmware/export/kernel.h
index bcf51c1723..9ef5af8c0c 100644
--- a/firmware/export/kernel.h
+++ b/firmware/export/kernel.h
@@ -201,7 +201,7 @@ static inline void call_tick_tasks(void)
201} 201}
202#endif 202#endif
203 203
204#if defined(SIMULATOR) && !defined(PLUGIN) && !defined(CODEC) 204#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && !defined(PLUGIN) && !defined(CODEC)
205#define sleep(x) sim_sleep(x) 205#define sleep(x) sim_sleep(x)
206#endif 206#endif
207 207
diff --git a/firmware/export/power.h b/firmware/export/power.h
index 107158767f..137f40cb01 100644
--- a/firmware/export/power.h
+++ b/firmware/export/power.h
@@ -81,7 +81,7 @@ void ide_power_enable(bool on);
81bool charging_state(void); 81bool charging_state(void);
82#endif 82#endif
83 83
84#ifndef SIMULATOR 84#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
85 85
86void power_init(void) INIT_ATTR; 86void power_init(void) INIT_ATTR;
87 87
diff --git a/firmware/export/powermgmt.h b/firmware/export/powermgmt.h
index d86118cd9b..03b9d34d54 100644
--- a/firmware/export/powermgmt.h
+++ b/firmware/export/powermgmt.h
@@ -74,7 +74,7 @@ extern unsigned int power_thread_inputs;
74#include "powermgmt-target.h" 74#include "powermgmt-target.h"
75#endif 75#endif
76 76
77#ifndef SIMULATOR 77#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
78 78
79/* Generic current values that are intentionally meaningless - config header 79/* Generic current values that are intentionally meaningless - config header
80 * should define proper numbers.*/ 80 * should define proper numbers.*/
@@ -129,7 +129,7 @@ extern const unsigned short percent_to_volt_charge[11];
129/* Start up power management thread */ 129/* Start up power management thread */
130void powermgmt_init(void) INIT_ATTR; 130void powermgmt_init(void) INIT_ATTR;
131 131
132#endif /* SIMULATOR */ 132#endif /* PLATFORM_NATIVE */
133 133
134/* Returns battery statust */ 134/* Returns battery statust */
135int battery_level(void); /* percent */ 135int battery_level(void); /* percent */
diff --git a/firmware/export/storage.h b/firmware/export/storage.h
index e62cf0d902..e59a5e5bf6 100644
--- a/firmware/export/storage.h
+++ b/firmware/export/storage.h
@@ -51,7 +51,7 @@ struct storage_info
51 char *revision; 51 char *revision;
52}; 52};
53 53
54#if !defined(SIMULATOR) && !defined(CONFIG_STORAGE_MULTI) 54#if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(CONFIG_STORAGE_MULTI)
55/* storage_spindown, storage_sleep and storage_spin are passed as 55/* storage_spindown, storage_sleep and storage_spin are passed as
56 * pointers, which doesn't work with argument-macros. 56 * pointers, which doesn't work with argument-macros.
57 */ 57 */
@@ -185,7 +185,7 @@ struct storage_info
185 #else 185 #else
186 //#error No storage driver! 186 //#error No storage driver!
187 #endif 187 #endif
188#else /* NOT CONFIG_STORAGE_MULTI and NOT SIMULATOR*/ 188#else /* NOT CONFIG_STORAGE_MULTI and PLATFORM_NATIVE*/
189 189
190/* Simulator and multi-driver use normal functions */ 190/* Simulator and multi-driver use normal functions */
191 191
diff --git a/firmware/export/system.h b/firmware/export/system.h
index 5ac92e015d..7a04422b06 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -125,7 +125,7 @@ int get_cpu_boost_counter(void);
125 125
126 126
127/* newer? SDL includes endian.h, So we ignore it */ 127/* newer? SDL includes endian.h, So we ignore it */
128#if defined(SIMULATOR) || defined(__PCTOOL__) 128#if (CONFIG_PLATFORM & PLATFORM_HOSTED) || defined(__PCTOOL__)
129#undef letoh16 129#undef letoh16
130#undef letoh32 130#undef letoh32
131#undef htole16 131#undef htole16
@@ -234,8 +234,11 @@ enum {
234 234
235#if !defined(SIMULATOR) && !defined(__PCTOOL__) 235#if !defined(SIMULATOR) && !defined(__PCTOOL__)
236#include "system-target.h" 236#include "system-target.h"
237#elif defined(HAVE_SDL) /* SIMULATOR */ 237#elif defined(HAVE_SDL) /* SDL build */
238#include "system-sdl.h" 238#include "system-sdl.h"
239#endif
240
241#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
239static inline uint16_t swap16(uint16_t value) 242static inline uint16_t swap16(uint16_t value)
240 /* 243 /*
241 result[15..8] = value[ 7..0]; 244 result[15..8] = value[ 7..0];
@@ -268,7 +271,7 @@ static inline uint32_t swap_odd_even32(uint32_t value)
268 return (t >> 8) | ((t ^ value) << 8); 271 return (t >> 8) | ((t ^ value) << 8);
269} 272}
270 273
271#endif /* !SIMULATOR */ 274#endif /* PLATFORM_HOSTED */
272 275
273#ifndef BIT_N 276#ifndef BIT_N
274#define BIT_N(n) (1U << (n)) 277#define BIT_N(n) (1U << (n))
diff --git a/firmware/export/thread.h b/firmware/export/thread.h
index d907e5dc95..c4b7d1fa22 100644
--- a/firmware/export/thread.h
+++ b/firmware/export/thread.h
@@ -81,7 +81,7 @@
81 81
82#define DEFAULT_STACK_SIZE 0x400 /* Bytes */ 82#define DEFAULT_STACK_SIZE 0x400 /* Bytes */
83 83
84#ifndef SIMULATOR 84#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
85/* Need to keep structures inside the header file because debug_menu 85/* Need to keep structures inside the header file because debug_menu
86 * needs them. */ 86 * needs them. */
87#ifdef CPU_COLDFIRE 87#ifdef CPU_COLDFIRE
@@ -135,15 +135,15 @@ struct regs
135 uint32_t start; /* 44 - Thread start address, or NULL when started */ 135 uint32_t start; /* 44 - Thread start address, or NULL when started */
136}; 136};
137#endif /* CONFIG_CPU */ 137#endif /* CONFIG_CPU */
138#else 138#elif (CONFIG_PLATFORM & PLATFORM_HOSTED)
139struct regs 139struct regs
140{ 140{
141 void *t; /* Simulator OS thread */ 141 void *t; /* OS thread */
142 void *told; /* Last thread in slot (explained in thead-sdl.c) */ 142 void *told; /* Last thread in slot (explained in thead-sdl.c) */
143 void *s; /* Semaphore for blocking and wakeup */ 143 void *s; /* Semaphore for blocking and wakeup */
144 void (*start)(void); /* Start function */ 144 void (*start)(void); /* Start function */
145}; 145};
146#endif /* !SIMULATOR */ 146#endif /* PLATFORM_NATIVE */
147 147
148/* NOTE: The use of the word "queue" may also refer to a linked list of 148/* NOTE: The use of the word "queue" may also refer to a linked list of
149 threads being maintained that are normally dealt with in FIFO order 149 threads being maintained that are normally dealt with in FIFO order
diff --git a/firmware/export/timer.h b/firmware/export/timer.h
index b070acae31..b12ec55881 100644
--- a/firmware/export/timer.h
+++ b/firmware/export/timer.h
@@ -26,7 +26,7 @@
26#include "config.h" 26#include "config.h"
27#include "cpu.h" 27#include "cpu.h"
28 28
29#if defined(SIMULATOR) 29#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
30#define TIMER_FREQ 1000000 30#define TIMER_FREQ 1000000
31#endif 31#endif
32 32
diff --git a/firmware/export/tuner.h b/firmware/export/tuner.h
index fa894a4b6c..461c9a3fcb 100644
--- a/firmware/export/tuner.h
+++ b/firmware/export/tuner.h
@@ -90,7 +90,7 @@ extern const struct fm_region_data fm_region_data[TUNER_NUM_REGIONS];
90 90
91#if CONFIG_TUNER 91#if CONFIG_TUNER
92 92
93#ifdef SIMULATOR 93#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
94int tuner_set(int setting, int value); 94int tuner_set(int setting, int value);
95int tuner_get(int setting); 95int tuner_get(int setting);
96#ifdef HAVE_RDS_CAP 96#ifdef HAVE_RDS_CAP
@@ -142,7 +142,7 @@ extern int (*tuner_get)(int setting);
142#include "ipod_remote_tuner.h" 142#include "ipod_remote_tuner.h"
143#endif 143#endif
144 144
145#endif /* SIMULATOR */ 145#endif /* PLATFORM_HOSTED */
146 146
147/* Additional messages that get enumerated after tuner driver headers */ 147/* Additional messages that get enumerated after tuner driver headers */
148 148
diff --git a/firmware/include/dbgcheck.h b/firmware/include/dbgcheck.h
index e1f7aefbdb..0b38627d11 100644
--- a/firmware/include/dbgcheck.h
+++ b/firmware/include/dbgcheck.h
@@ -4,7 +4,7 @@
4#include <stdbool.h> 4#include <stdbool.h>
5 5
6#ifdef DEBUG 6#ifdef DEBUG
7 #ifndef SIMULATOR 7 #if (CONFIG_PLATFORM & PLATFORM_NATIVE)
8 /* check whether a function is inside the valid memory location */ 8 /* check whether a function is inside the valid memory location */
9 #define IS_FUNCPTR(fp) ({/ 9 #define IS_FUNCPTR(fp) ({/
10 extern char _text[];/ 10 extern char _text[];/
@@ -21,4 +21,4 @@
21#endif 21#endif
22 22
23 23
24#endif // #ifndef __DBGCHECK_H__ \ No newline at end of file 24#endif // #ifndef __DBGCHECK_H__
diff --git a/firmware/include/dir_uncached.h b/firmware/include/dir_uncached.h
index 4e5acf34d1..f225cf8e39 100644
--- a/firmware/include/dir_uncached.h
+++ b/firmware/include/dir_uncached.h
@@ -32,7 +32,7 @@
32#define ATTR_ARCHIVE 0x20 32#define ATTR_ARCHIVE 0x20
33#define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */ 33#define ATTR_VOLUME 0x40 /* this is a volume, not a real directory */
34 34
35#ifdef SIMULATOR 35#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
36#define dirent_uncached sim_dirent 36#define dirent_uncached sim_dirent
37#define DIR_UNCACHED SIM_DIR 37#define DIR_UNCACHED SIM_DIR
38#define opendir_uncached sim_opendir 38#define opendir_uncached sim_opendir
@@ -57,7 +57,7 @@ struct dirent_uncached {
57#include "fat.h" 57#include "fat.h"
58 58
59typedef struct { 59typedef struct {
60#ifndef SIMULATOR 60#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
61 bool busy; 61 bool busy;
62 long startcluster; 62 long startcluster;
63 struct fat_dir fatdir; 63 struct fat_dir fatdir;
@@ -66,7 +66,7 @@ typedef struct {
66 int volumecounter; /* running counter for faked volume entries */ 66 int volumecounter; /* running counter for faked volume entries */
67#endif 67#endif
68#else 68#else
69 /* simulator: */ 69 /* simulator/application: */
70 void *dir; /* actually a DIR* dir */ 70 void *dir; /* actually a DIR* dir */
71 char *name; 71 char *name;
72#endif 72#endif
diff --git a/firmware/include/dircache.h b/firmware/include/dircache.h
index 9fd55fab6f..4472d5fbe0 100644
--- a/firmware/include/dircache.h
+++ b/firmware/include/dircache.h
@@ -36,7 +36,7 @@ struct travel_data {
36 struct dircache_entry *first; 36 struct dircache_entry *first;
37 struct dircache_entry *ce; 37 struct dircache_entry *ce;
38 struct dircache_entry *down_entry; 38 struct dircache_entry *down_entry;
39#ifdef SIMULATOR 39#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
40 DIR_UNCACHED *dir, *newdir; 40 DIR_UNCACHED *dir, *newdir;
41 struct dirent_uncached *entry; 41 struct dirent_uncached *entry;
42#else 42#else
diff --git a/firmware/include/file.h b/firmware/include/file.h
index f66cc6c60e..9502f5999a 100644
--- a/firmware/include/file.h
+++ b/firmware/include/file.h
@@ -26,6 +26,7 @@
26#define MAX_PATH 260 26#define MAX_PATH 260
27 27
28#include <sys/types.h> 28#include <sys/types.h>
29#include "config.h"
29#include "_ansi.h" 30#include "_ansi.h"
30 31
31#define MAX_OPEN_FILES 11 32#define MAX_OPEN_FILES 11
@@ -49,7 +50,7 @@
49#define O_TRUNC 0x10 50#define O_TRUNC 0x10
50#endif 51#endif
51 52
52#if defined(SIMULATOR) && !defined(PLUGIN) && !defined(CODEC) 53#if (CONFIG_PLATFORM & PLATFORM_HOSTED) && !defined(PLUGIN) && !defined(CODEC)
53#define open(x, ...) sim_open(x, __VA_ARGS__) 54#define open(x, ...) sim_open(x, __VA_ARGS__)
54#define creat(x,m) sim_creat(x,m) 55#define creat(x,m) sim_creat(x,m)
55#define remove(x) sim_remove(x) 56#define remove(x) sim_remove(x)
@@ -78,7 +79,7 @@ extern int fsync(int fd);
78extern ssize_t read(int fd, void *buf, size_t count); 79extern ssize_t read(int fd, void *buf, size_t count);
79extern off_t lseek(int fildes, off_t offset, int whence); 80extern off_t lseek(int fildes, off_t offset, int whence);
80extern int file_creat(const char *pathname); 81extern int file_creat(const char *pathname);
81#ifndef SIMULATOR 82#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
82/* posix compatibility function */ 83/* posix compatibility function */
83static inline int creat(const char *pathname, mode_t mode) 84static inline int creat(const char *pathname, mode_t mode)
84{ 85{
diff --git a/firmware/logf.c b/firmware/logf.c
index 6bdda3f424..0136600e92 100644
--- a/firmware/logf.c
+++ b/firmware/logf.c
@@ -208,7 +208,7 @@ void _logf(const char *fmt, ...)
208 208
209 va_start(ap, fmt); 209 va_start(ap, fmt);
210 210
211#ifdef SIMULATOR 211#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
212 char buf[1024]; 212 char buf[1024];
213 vsnprintf(buf, sizeof buf, fmt, ap); 213 vsnprintf(buf, sizeof buf, fmt, ap);
214 DEBUGF("%s\n", buf); 214 DEBUGF("%s\n", buf);
diff --git a/firmware/panic.c b/firmware/panic.c
index 36eec67f12..bd2c719607 100644
--- a/firmware/panic.c
+++ b/firmware/panic.c
@@ -41,7 +41,7 @@ void panicf( const char *fmt, ...)
41{ 41{
42 va_list ap; 42 va_list ap;
43 43
44#ifndef SIMULATOR 44#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
45 /* Disable interrupts */ 45 /* Disable interrupts */
46#ifdef CPU_ARM 46#ifdef CPU_ARM
47 disable_interrupt(IRQ_FIQ_STATUS); 47 disable_interrupt(IRQ_FIQ_STATUS);
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index f1dd83ef52..c5f981d1f6 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -44,7 +44,7 @@
44#endif 44#endif
45#include "logf.h" 45#include "logf.h"
46#include "lcd-remote.h" 46#include "lcd-remote.h"
47#ifdef SIMULATOR 47#if (CONFIG_PLATFORM & PLATFORM_HOSTED)
48#include <time.h> 48#include <time.h>
49#endif 49#endif
50 50
@@ -73,7 +73,7 @@ enum charge_state_type charge_state = DISCHARGING;
73#endif 73#endif
74#endif /* CONFIG_CHARGING */ 74#endif /* CONFIG_CHARGING */
75 75
76#ifndef SIMULATOR 76#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
77static int shutdown_timeout = 0; 77static int shutdown_timeout = 0;
78/* 78/*
79 * Average battery voltage and charger voltage, filtered via a digital 79 * Average battery voltage and charger voltage, filtered via a digital
@@ -830,7 +830,7 @@ void cancel_shutdown(void)
830 830
831 shutdown_timeout = 0; 831 shutdown_timeout = 0;
832} 832}
833#endif /* SIMULATOR */ 833#endif /* PLATFORM_NATIVE */
834 834
835/* Send system battery level update events on reaching certain significant 835/* Send system battery level update events on reaching certain significant
836 levels. This must be called after battery_percent has been updated. */ 836 levels. This must be called after battery_percent has been updated. */
diff --git a/firmware/scroll_engine.c b/firmware/scroll_engine.c
index b7e0601150..4fee7ed1d6 100644
--- a/firmware/scroll_engine.c
+++ b/firmware/scroll_engine.c
@@ -242,7 +242,7 @@ static bool scroll_process_message(int delay)
242 usb_wait_for_disconnect(&scroll_queue); 242 usb_wait_for_disconnect(&scroll_queue);
243 sync_display_ticks(); 243 sync_display_ticks();
244 return true; 244 return true;
245#ifndef SIMULATOR 245#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
246 case SYS_REMOTE_PLUGGED: 246 case SYS_REMOTE_PLUGGED:
247 if (!remote_initialized) 247 if (!remote_initialized)
248 sync_display_ticks(); 248 sync_display_ticks();
@@ -280,7 +280,7 @@ static void scroll_thread(void)
280 delay = current_tick; 280 delay = current_tick;
281 281
282 if ( 282 if (
283#ifndef SIMULATOR 283#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
284 !remote_initialized || 284 !remote_initialized ||
285#endif 285#endif
286 (tick_remote = lcd_remote_scroll_info.last_scroll + 286 (tick_remote = lcd_remote_scroll_info.last_scroll +
diff --git a/firmware/sound.c b/firmware/sound.c
index dccca12264..76f1dd0df6 100644
--- a/firmware/sound.c
+++ b/firmware/sound.c
@@ -27,7 +27,7 @@
27#include "system.h" 27#include "system.h"
28#include "i2c.h" 28#include "i2c.h"
29#include "mas.h" 29#include "mas.h"
30#ifndef SIMULATOR 30#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
31#if CONFIG_CPU == PNX0101 31#if CONFIG_CPU == PNX0101
32#include "pnx0101.h" 32#include "pnx0101.h"
33#endif 33#endif
@@ -257,7 +257,7 @@ static void set_prescaled_volume(void)
257 dsp_callback(DSP_CALLBACK_SET_SW_VOLUME, 0); 257 dsp_callback(DSP_CALLBACK_SET_SW_VOLUME, 0);
258#endif 258#endif
259 259
260#ifndef SIMULATOR 260#ifndef HAVE_SDL_AUDIO
261#if CONFIG_CODEC == MAS3507D 261#if CONFIG_CODEC == MAS3507D
262 dac_volume(tenthdb2reg(l), tenthdb2reg(r), false); 262 dac_volume(tenthdb2reg(l), tenthdb2reg(r), false);
263#elif defined(HAVE_UDA1380) || defined(HAVE_WM8975) || defined(HAVE_WM8758) \ 263#elif defined(HAVE_UDA1380) || defined(HAVE_WM8975) || defined(HAVE_WM8758) \
@@ -276,9 +276,9 @@ static void set_prescaled_volume(void)
276#elif defined(HAVE_JZ4740_CODEC) || defined(HAVE_SDL_AUDIO) 276#elif defined(HAVE_JZ4740_CODEC) || defined(HAVE_SDL_AUDIO)
277 audiohw_set_volume(current_volume); 277 audiohw_set_volume(current_volume);
278#endif 278#endif
279#else /* SIMULATOR */ 279#else /* HAVE_SDL_AUDIO */
280 audiohw_set_volume(current_volume); 280 audiohw_set_volume(current_volume);
281#endif /* !SIMULATOR */ 281#endif /* !HAVE_SDL_AUDIO */
282} 282}
283#endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */ 283#endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */
284 284
@@ -714,7 +714,7 @@ void sound_set(int setting, int value)
714 && !defined(HAVE_WM8758) && !defined(HAVE_TSC2100) \ 714 && !defined(HAVE_WM8758) && !defined(HAVE_TSC2100) \
715 && !defined (HAVE_WM8711) && !defined (HAVE_WM8721) \ 715 && !defined (HAVE_WM8711) && !defined (HAVE_WM8721) \
716 && !defined (HAVE_WM8731) && !defined (HAVE_WM8978) \ 716 && !defined (HAVE_WM8731) && !defined (HAVE_WM8978) \
717 && !defined(HAVE_AK4537)) || defined(SIMULATOR) 717 && !defined(HAVE_AK4537)) || (CONFIG_PLATFORM & PLATFORM_HOSTED)
718int sound_val2phys(int setting, int value) 718int sound_val2phys(int setting, int value)
719{ 719{
720#if CONFIG_CODEC == MAS3587F 720#if CONFIG_CODEC == MAS3587F
@@ -820,7 +820,7 @@ int sound_val2phys(int setting, int value)
820 return value; 820 return value;
821#endif 821#endif
822} 822}
823#endif /* !defined(HAVE_AS3514) || defined(SIMULATOR) */ 823#endif /* CONFIG_CODECs || PLATFORM_HOSTED */
824 824
825#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) 825#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
826/* This function works by telling the decoder that we have another 826/* This function works by telling the decoder that we have another
diff --git a/firmware/system.c b/firmware/system.c
index 87fc40850f..7e269ee119 100644
--- a/firmware/system.c
+++ b/firmware/system.c
@@ -26,7 +26,7 @@
26#include "string.h" 26#include "string.h"
27#include "file.h" 27#include "file.h"
28 28
29#ifndef SIMULATOR 29#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
30long cpu_frequency SHAREDBSS_ATTR = CPU_FREQ; 30long cpu_frequency SHAREDBSS_ATTR = CPU_FREQ;
31#endif 31#endif
32 32