summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/alarm_menu.c4
-rw-r--r--apps/debug_menu.c14
-rw-r--r--apps/main_menu.c12
-rw-r--r--apps/menu.h6
-rw-r--r--apps/playlist.c2
-rw-r--r--apps/plugin.c4
-rw-r--r--apps/plugin.h4
-rw-r--r--apps/plugins/battery_test.c2
-rw-r--r--apps/plugins/chessclock.c22
-rw-r--r--apps/plugins/metronome.c6
-rw-r--r--apps/plugins/splitedit.c8
-rw-r--r--apps/plugins/stopwatch.c8
-rw-r--r--apps/plugins/viewer.c18
-rw-r--r--apps/recorder/keyboard.c4
-rw-r--r--apps/recorder/radio.c8
-rw-r--r--apps/recorder/radio.h2
-rw-r--r--apps/recorder/recording.c4
-rw-r--r--apps/screens.c4
-rw-r--r--apps/screens.h2
-rw-r--r--apps/settings.c16
-rw-r--r--apps/settings.h10
-rw-r--r--apps/settings_menu.c6
-rw-r--r--apps/sound_menu.c10
-rw-r--r--apps/status.c2
-rw-r--r--apps/tree.c2
-rw-r--r--apps/tree.h6
-rw-r--r--apps/wps.c12
-rw-r--r--apps/wps.h2
-rw-r--r--firmware/drivers/ata.c14
-rw-r--r--firmware/drivers/button.c8
-rw-r--r--firmware/drivers/fmradio.c2
-rw-r--r--firmware/drivers/mas.c6
-rw-r--r--firmware/drivers/serial.c2
-rw-r--r--firmware/export/button.h10
-rw-r--r--firmware/export/config-fmrecorder.h8
-rw-r--r--firmware/export/config-h100.h2
-rw-r--r--firmware/export/config-ondiofm.h8
-rw-r--r--firmware/export/config-ondiosp.h8
-rw-r--r--firmware/export/config-player.h6
-rw-r--r--firmware/export/config-recorder.h6
-rw-r--r--firmware/export/config-recorderv2.h8
-rw-r--r--firmware/export/config.h21
-rw-r--r--firmware/export/mas.h8
-rw-r--r--firmware/export/mp3_playback.h4
-rw-r--r--firmware/export/mpeg.h2
-rw-r--r--firmware/mp3_playback.c76
-rw-r--r--firmware/mpeg.c64
-rw-r--r--firmware/powermgmt.c4
-rw-r--r--uisimulator/battery.c2
-rw-r--r--uisimulator/common/fmradio.c2
-rw-r--r--uisimulator/win32/button.c4
-rw-r--r--uisimulator/x11/button-x11.c4
52 files changed, 250 insertions, 229 deletions
diff --git a/apps/alarm_menu.c b/apps/alarm_menu.c
index 6e2519bd38..20b2f51821 100644
--- a/apps/alarm_menu.c
+++ b/apps/alarm_menu.c
@@ -130,7 +130,7 @@ bool alarm_screen(void)
h = 23;
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
/* inc(h) */
case BUTTON_UP:
case BUTTON_UP | BUTTON_REPEAT:
@@ -144,7 +144,7 @@ bool alarm_screen(void)
break;
#endif
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_OFF:
#else
case BUTTON_STOP:
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index 26052d0b32..7a1c2a3df8 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -51,7 +51,7 @@
#include "widgets.h"
#include "peakmeter.h"
#endif
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
#include "radio.h"
#endif
@@ -790,7 +790,7 @@ bool dbg_mas(void)
return false;
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
bool dbg_mas_codec(void)
{
char buf[32];
@@ -999,7 +999,7 @@ bool view_battery(void)
#endif
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
bool dbg_mas_info(void)
{
int button;
@@ -1457,7 +1457,7 @@ bool dbg_save_roms(void)
return false;
}
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
extern int debug_fm_detection;
bool dbg_fm_radio(void)
@@ -1535,11 +1535,11 @@ bool debug_menu(void)
#endif /* HAVE_LCD_BITMAP */
{ "View OS stacks", dbg_os },
{ "Catch mem accesses", dbg_set_memory_guard },
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
{ "View MAS info", dbg_mas_info },
#endif
{ "View MAS regs", dbg_mas },
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
{ "View MAS codec", dbg_mas_codec },
#endif
#ifdef HAVE_LCD_BITMAP
@@ -1560,7 +1560,7 @@ bool debug_menu(void)
#endif /* PM_DEBUG */
#endif /* HAVE_LCD_BITMAP */
{ "View runtime", view_runtime },
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
{ "FM Radio", dbg_fm_radio },
#endif
};
diff --git a/apps/main_menu.c b/apps/main_menu.c
index d642fc56fe..d47fc5148e 100644
--- a/apps/main_menu.c
+++ b/apps/main_menu.c
@@ -46,13 +46,13 @@
#include "screens.h"
#include "playlist_menu.h"
#include "talk.h"
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
#include "radio.h"
#endif
#include "misc.h"
#include "lang.h"
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
#include "recording.h"
#endif
@@ -263,14 +263,14 @@ static bool plugin_browse(void)
return rockbox_browse(PLUGIN_DIR, SHOW_PLUGINS);
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
static bool recording_settings(void)
{
return recording_menu(false);
}
#endif
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
bool rec_menu(void)
{
@@ -335,14 +335,14 @@ bool main_menu(void)
items[i].desc = ID2P(LANG_GENERAL_SETTINGS);
items[i++].function = settings_menu;
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
if(radio_hardware_present()) {
items[i].desc = ID2P(LANG_FM_RADIO);
items[i++].function = radio_screen;
}
#endif
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
items[i].desc = ID2P(LANG_RECORDING);
items[i++].function = rec_menu;
#endif
diff --git a/apps/menu.h b/apps/menu.h
index 99ef3443ba..7ebfbf316c 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -23,7 +23,7 @@
#include <stdbool.h>
/* button definitions */
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
#define MENU_NEXT BUTTON_DOWN
#define MENU_PREV BUTTON_UP
#define MENU_EXIT (BUTTON_LEFT | BUTTON_REL)
@@ -32,14 +32,14 @@
#define MENU_ENTER (BUTTON_RIGHT | BUTTON_REL)
#define MENU_ENTER2 (BUTTON_PLAY | BUTTON_REL)
-#elif defined HAVE_PLAYER_KEYPAD
+#elif CONFIG_KEYPAD == PLAYER_PAD
#define MENU_NEXT BUTTON_RIGHT
#define MENU_PREV BUTTON_LEFT
#define MENU_EXIT (BUTTON_STOP | BUTTON_REL)
#define MENU_EXIT2 (BUTTON_MENU | BUTTON_REL)
#define MENU_ENTER (BUTTON_PLAY | BUTTON_REL)
-#elif defined HAVE_ONDIO_KEYPAD
+#elif CONFIG_KEYPAD == ONDIO_PAD
#define MENU_NEXT BUTTON_DOWN
#define MENU_PREV BUTTON_UP
#define MENU_EXIT (BUTTON_LEFT | BUTTON_REL)
diff --git a/apps/playlist.c b/apps/playlist.c
index ecdb45c104..e514530aea 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -1050,7 +1050,7 @@ static void display_playlist_count(int count, const char *fmt)
#endif
splash(0, true, fmt, count,
-#ifdef HAVE_PLAYER_KEYPAD
+#if CONFIG_KEYPAD == PLAYER_PAD
str(LANG_STOP_ABORT)
#else
str(LANG_OFF_ABORT)
diff --git a/apps/plugin.c b/apps/plugin.c
index 9a7a397bea..51f7a610dd 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -211,7 +211,7 @@ static const struct plugin_api rockbox_api = {
mas_writemem,
mas_readreg,
mas_writereg,
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
mas_codec_writereg,
mas_codec_readreg,
#endif
@@ -244,7 +244,7 @@ static const struct plugin_api rockbox_api = {
/* new stuff at the end, sort into place next time
the API gets incompatible */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
mpeg_set_pitch,
peak_meter_scale_value,
diff --git a/apps/plugin.h b/apps/plugin.h
index 078dc12217..445427ffd5 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -239,7 +239,7 @@ struct plugin_api {
int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len);
int (*mas_readreg)(int reg);
int (*mas_writereg)(int reg, unsigned int val);
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
int (*mas_codec_writereg)(int reg, unsigned int val);
int (*mas_codec_readreg)(int reg);
#endif
@@ -277,7 +277,7 @@ struct plugin_api {
/* new stuff at the end, sort into place next time
the API gets incompatible */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
void (*mpeg_set_pitch)(int pitch);
unsigned short (*peak_meter_scale_value)(unsigned short val,
diff --git a/apps/plugins/battery_test.c b/apps/plugins/battery_test.c
index c7dac01a47..04be9b0070 100644
--- a/apps/plugins/battery_test.c
+++ b/apps/plugins/battery_test.c
@@ -97,7 +97,7 @@ enum plugin_status loop(void)
/* Check if we shall exit the plugin */
if (button==BUTTON_ON ||
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
button==BUTTON_OFF
#else
button==BUTTON_STOP
diff --git a/apps/plugins/chessclock.c b/apps/plugins/chessclock.c
index b647a0fa76..4df169669a 100644
--- a/apps/plugins/chessclock.c
+++ b/apps/plugins/chessclock.c
@@ -227,7 +227,7 @@ static int run_timer(int nr)
button = rb->button_get_w_tmo(10);
switch (button) {
/* OFF/MENU key to exit */
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_OFF:
#else
case BUTTON_ON:
@@ -299,7 +299,7 @@ static int run_timer(int nr)
break;
/* UP (RIGHT/+) = Scroll Lap timer up */
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_UP:
#else
case BUTTON_RIGHT:
@@ -309,7 +309,7 @@ static int run_timer(int nr)
break;
/* DOWN (LEFT/-) = Scroll Lap timer down */
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_DOWN:
#else
case BUTTON_LEFT:
@@ -364,7 +364,7 @@ static int chessclock_set_int(char* string,
#endif
button = rb->button_get_w_tmo(HZ/2);
switch(button) {
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_UP:
case BUTTON_UP | BUTTON_REPEAT:
#else
@@ -374,7 +374,7 @@ static int chessclock_set_int(char* string,
*variable += step;
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_DOWN:
case BUTTON_DOWN | BUTTON_REPEAT:
#else
@@ -384,7 +384,7 @@ static int chessclock_set_int(char* string,
*variable -= step;
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_LEFT:
case BUTTON_PLAY:
#else
@@ -393,7 +393,7 @@ static int chessclock_set_int(char* string,
done = true;
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_OFF:
#else
case BUTTON_STOP:
@@ -442,7 +442,7 @@ static int simple_menu(int nr, char **strarr)
rb->lcd_puts_scroll(0, 0, strarr[show]);
button = rb->button_get(false);
switch(button) {
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_UP:
case BUTTON_UP | BUTTON_REPEAT:
#else
@@ -452,7 +452,7 @@ static int simple_menu(int nr, char **strarr)
show++;
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_DOWN:
case BUTTON_DOWN | BUTTON_REPEAT:
#else
@@ -462,7 +462,7 @@ static int simple_menu(int nr, char **strarr)
show--;
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_LEFT:
case BUTTON_PLAY:
#else
@@ -471,7 +471,7 @@ static int simple_menu(int nr, char **strarr)
return show;
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_OFF:
#else
case BUTTON_STOP:
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c
index dbccd03697..74b7663f3f 100644
--- a/apps/plugins/metronome.c
+++ b/apps/plugins/metronome.c
@@ -200,7 +200,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter){
while (true){
switch (rb->button_get(true)) {
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_OFF:
#else
case BUTTON_STOP:
@@ -220,7 +220,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter){
draw_display();
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_UP:
case BUTTON_UP | BUTTON_REPEAT:
#else
@@ -231,7 +231,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter){
calc_period();
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_DOWN:
case BUTTON_DOWN | BUTTON_REPEAT:
#else
diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c
index db99c5bb77..b76a08cb80 100644
--- a/apps/plugins/splitedit.c
+++ b/apps/plugins/splitedit.c
@@ -230,7 +230,7 @@ static void update_icons(void)
LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
BMPWIDTH, BMPHEIGHT, true);
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
/* The scale icon */
rb->lcd_bitmap(SCALE_BMP[rb->peak_meter_get_use_dbfs()],
2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
@@ -849,7 +849,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
{
/* read volume info */
unsigned short volume;
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
volume = rb->mas_codec_readreg(0x0c);
volume += rb->mas_codec_readreg(0x0d);
volume = volume / 2;
@@ -1003,7 +1003,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
lastx = time_to_xpos(mp3->elapsed);
break;
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
case BUTTON_ON | BUTTON_RIGHT:
rb->mpeg_set_pitch(1500);
splitedit_invalidate_osci();
@@ -1060,7 +1060,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
break;
case BUTTON_F3:
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
rb->peak_meter_set_use_dbfs(rb->peak_meter_get_use_dbfs() +1);
#endif
splitedit_invalidate_osci();
diff --git a/apps/plugins/stopwatch.c b/apps/plugins/stopwatch.c
index f71c4fe454..370a1b51a6 100644
--- a/apps/plugins/stopwatch.c
+++ b/apps/plugins/stopwatch.c
@@ -103,7 +103,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
{
/* OFF/MENU key to exit */
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_OFF:
#else
case BUTTON_MENU:
@@ -127,7 +127,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
break;
/* LEFT = Reset timer */
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_LEFT:
#else
case BUTTON_STOP:
@@ -148,7 +148,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
break;
/* UP (RIGHT/+) = Scroll Lap timer up */
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_UP:
#else
case BUTTON_RIGHT:
@@ -161,7 +161,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
break;
/* DOWN (LEFT/-) = Scroll Lap timer down */
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_DOWN:
#else
case BUTTON_LEFT:
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index a593da28e7..eb15127704 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -746,7 +746,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
while (!exit) {
switch (rb->button_get(true)) {
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_OFF:
#else
case BUTTON_STOP:
@@ -755,7 +755,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
exit = true;
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_F1:
#else
case BUTTON_ON | BUTTON_LEFT:
@@ -776,7 +776,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
viewer_draw(col);
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_F2:
#else
case BUTTON_ON | BUTTON_MENU | BUTTON_RIGHT:
@@ -802,7 +802,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
viewer_draw(col);
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_F3:
#else
case BUTTON_ON | BUTTON_RIGHT:
@@ -843,7 +843,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
viewer_draw(col);
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_UP:
case BUTTON_UP | BUTTON_REPEAT:
#else
@@ -861,7 +861,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
viewer_draw(col);
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_DOWN:
case BUTTON_DOWN | BUTTON_REPEAT:
#else
@@ -875,7 +875,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
viewer_draw(col);
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_LEFT:
case BUTTON_LEFT | BUTTON_REPEAT:
#else
@@ -895,7 +895,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
viewer_draw(col);
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_RIGHT:
case BUTTON_RIGHT | BUTTON_REPEAT:
#else
@@ -915,7 +915,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
viewer_draw(col);
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_ON:
/*Go to On-btn combinations */
col = viewer_recorder_on_button(col);
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c
index c1bd25e0aa..b1a28c29b4 100644
--- a/apps/recorder/keyboard.c
+++ b/apps/recorder/keyboard.c
@@ -33,7 +33,7 @@
#define KEYBOARD_LINES 4
#define KEYBOARD_PAGES 3
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
static void kbd_setupkeys(const char* line[KEYBOARD_LINES], int page)
{
switch (page) {
@@ -77,7 +77,7 @@ void kbd_spellchar(char c)
int kbd_input(char* text, int buflen)
{
-#ifndef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD != RECORDER_PAD
(void)text;
(void)buflen;
splash(HZ*2, true, "Keyboard not implemented yet");
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index c163cc4552..3d03dc30c9 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -48,7 +48,7 @@
#include "recording.h"
#include "talk.h"
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
#define MAX_FREQ (108000000)
#define MIN_FREQ (87500000)
@@ -167,7 +167,7 @@ static void remember_frequency(void)
bool radio_screen(void)
{
-#ifndef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD != RECORDER_PAD
splash(HZ*2, true, "Radio not supported yet");
return false;
#else
@@ -668,7 +668,7 @@ static bool radio_add_preset(void)
static int handle_radio_presets_menu_cb(int key, int m)
{
(void)m;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
switch(key)
{
case BUTTON_F3:
@@ -732,7 +732,7 @@ bool handle_radio_presets_menu(void)
int handle_radio_presets_cb(int key, int m)
{
-#ifdef HAVE_ONDIO_KEYPAD
+#if CONFIG_KEYPAD == ONDIO_PAD
(void)key;
(void)m;
return BUTTON_NONE;
diff --git a/apps/recorder/radio.h b/apps/recorder/radio.h
index 5ddbf13d6b..76a4af3b9f 100644
--- a/apps/recorder/radio.h
+++ b/apps/recorder/radio.h
@@ -19,7 +19,7 @@
#ifndef RADIO_H
#define RADIO_H
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
bool radio_screen(void);
void radio_stop(void);
bool radio_hardware_present(void);
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c
index 3a2505b6ae..98c2b27008 100644
--- a/apps/recorder/recording.c
+++ b/apps/recorder/recording.c
@@ -166,7 +166,7 @@ int rec_create_directory(void)
bool recording_screen(void)
{
-#ifndef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD != RECORDER_PAD
splash(HZ*2, true, "Recording not supported yet");
return false;
#else
@@ -625,7 +625,7 @@ bool recording_screen(void)
#endif
}
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
bool f2_rec_screen(void)
{
bool exit = false;
diff --git a/apps/screens.c b/apps/screens.c
index b0d95e0a7a..64382cc0ed 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -286,7 +286,7 @@ int charging_screen(void)
#endif /* HAVE_BATTERIES */
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
/* returns:
0 if no key was pressed
1 if a key was pressed (or if ON was held down long enough to repeat)
@@ -1112,7 +1112,7 @@ bool set_time_screen(const char* string, struct tm *tm)
}
#endif
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
bool shutdown_screen(void)
{
int button;
diff --git a/apps/screens.h b/apps/screens.h
index 9f15ff3228..47b85af821 100644
--- a/apps/screens.h
+++ b/apps/screens.h
@@ -26,7 +26,7 @@ void usb_screen(void);
int charging_screen(void);
void charging_splash(void);
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
int pitch_screen(void);
bool quick_screen(const int, const int);
#endif
diff --git a/apps/settings.c b/apps/settings.c
index bd1abc240d..a13abecfc7 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -63,7 +63,7 @@
#include "keyboard.h"
#include "version.h"
#include "rtc.h"
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
void dac_line_in(bool enable);
#endif
struct user_settings global_settings;
@@ -164,7 +164,7 @@ static const struct bit_entry rtc_bits[] =
{8 | SIGNED, S_O(balance), 0, "balance", NULL }, /* -100...100 */
{5 | SIGNED, S_O(bass), 0, "bass", NULL }, /* -15..+15 / -12..+12 */
{5 | SIGNED, S_O(treble), 0, "treble", NULL }, /* -15..+15 / -12..+12 */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
{5, S_O(loudness), 0, "loudness", NULL }, /* 0...17 */
{3, S_O(avc), 0, "auto volume", "off,20ms,2,4,8" },
{1, S_O(superbass), false, "superbass", off_on },
@@ -221,7 +221,7 @@ static const struct bit_entry rtc_bits[] =
/* new stuff to be added here */
/* If values are just added to the end, no need to bump the version. */
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
{1, S_O(fm_force_mono), false, "force fm mono", off_on },
{8, S_O(last_frequency), 0, NULL, NULL }, /* Default: MIN_FREQ */
#endif
@@ -295,7 +295,7 @@ static const struct bit_entry hd_bits[] =
{7, S_O(peak_meter_min), 60, "peak meter min", NULL }, /* 0...100 */
{7, S_O(peak_meter_max), 0, "peak meter max", NULL }, /* 0...100 */
#endif
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
/* recording */
{1, S_O(rec_editable), false, "editable recordings", off_on },
{4, S_O(rec_timesplit), 0, "rec timesplit", /* 0...13 */
@@ -315,7 +315,7 @@ static const struct bit_entry hd_bits[] =
{1, S_O(rec_directory), 0, /* rec_base_directory */
"rec directory", REC_BASE_DIR ",current" },
#endif
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
{1, S_O(line_in), false, "line in", off_on },
#endif
/* voice */
@@ -710,7 +710,7 @@ void sound_settings_apply(void)
mpeg_sound_set(SOUND_BALANCE, global_settings.balance);
mpeg_sound_set(SOUND_VOLUME, global_settings.volume);
mpeg_sound_set(SOUND_CHANNELS, global_settings.channel_config);
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
mpeg_sound_set(SOUND_LOUDNESS, global_settings.loudness);
mpeg_sound_set(SOUND_AVC, global_settings.avc);
mpeg_sound_set(SOUND_MDB_STRENGTH, global_settings.mdb_strength);
@@ -735,7 +735,7 @@ void settings_apply(void)
backlight_set_timeout(global_settings.backlight_timeout);
backlight_set_on_when_charging(global_settings.backlight_on_when_charging);
ata_spindown(global_settings.disk_spindown);
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
dac_line_in(global_settings.line_in);
#endif
#ifdef HAVE_ATA_POWER_OFF
@@ -1513,7 +1513,7 @@ bool set_option(const char* string, void* variable, enum optiontype type,
return false;
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
/* This array holds the record timer interval lengths, in seconds */
static const unsigned long rec_timer_seconds[] =
{
diff --git a/apps/settings.h b/apps/settings.h
index aa408ea2cc..b6d37a0aab 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -34,7 +34,7 @@
#define MAX_FILENAME 20
/* button definitions */
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
#define SETTINGS_INC BUTTON_UP
#define SETTINGS_DEC BUTTON_DOWN
#define SETTINGS_OK (BUTTON_PLAY|BUTTON_REL)
@@ -42,14 +42,14 @@
#define SETTINGS_CANCEL (BUTTON_OFF|BUTTON_REL)
#define SETTINGS_CANCEL2 (BUTTON_F1|BUTTON_REL)
-#elif defined HAVE_PLAYER_KEYPAD
+#elif CONFIG_KEYPAD == PLAYER_PAD
#define SETTINGS_INC BUTTON_RIGHT
#define SETTINGS_DEC BUTTON_LEFT
#define SETTINGS_OK (BUTTON_PLAY|BUTTON_REL)
#define SETTINGS_CANCEL (BUTTON_STOP|BUTTON_REL)
#define SETTINGS_CANCEL2 (BUTTON_MENU|BUTTON_REL)
-#elif defined HAVE_ONDIO_KEYPAD
+#elif CONFIG_KEYPAD == ONDIO_PAD
#define SETTINGS_INC BUTTON_UP
#define SETTINGS_DEC BUTTON_DOWN
#define SETTINGS_OK (BUTTON_RIGHT|BUTTON_REL)
@@ -239,7 +239,7 @@ struct user_settings
bool fade_on_stop; /* fade on pause/unpause/stop */
bool caption_backlight; /* turn on backlight at end and start of track */
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
int fm_freq_step; /* Frequency step for manual tuning, in kHz */
bool fm_force_mono; /* Forces Mono mode if true */
bool fm_full_range; /* Enables full 10MHz-160MHz range if true, else
@@ -306,7 +306,7 @@ bool set_time_screen(const char* string, struct tm *tm);
int read_line(int fd, char* buffer, int buffer_size);
void set_file(char* filename, char* setting, int maxlen);
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
unsigned int rec_timesplit_seconds(void);
#endif
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 9e95fe9d9a..624274520f 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -48,7 +48,7 @@
#include "peakmeter.h"
#endif
#include "lang.h"
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
void dac_line_in(bool enable);
#endif
#ifdef HAVE_ALARM_MOD
@@ -775,7 +775,7 @@ static bool spindown(void)
ata_spindown, 1, 3, 254 );
}
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
static bool line_in(void)
{
bool rc = set_bool(str(LANG_LINE_IN), &global_settings.line_in);
@@ -1335,7 +1335,7 @@ static bool system_settings_menu(void)
{ ID2P(LANG_ALARM_MOD_ALARM_MENU), alarm_screen },
#endif
{ ID2P(LANG_LIMITS_MENU), limits_settings_menu },
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
{ ID2P(LANG_LINE_IN), line_in },
#endif
{ ID2P(LANG_CAR_ADAPTER_MODE), car_adapter_mode },
diff --git a/apps/sound_menu.c b/apps/sound_menu.c
index fdb2043171..1cb10c6a81 100644
--- a/apps/sound_menu.c
+++ b/apps/sound_menu.c
@@ -137,7 +137,7 @@ bool set_sound(const char* string,
}
if (changed) {
mpeg_sound_set(setting, *variable);
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
if(setting == SOUND_BALANCE)
mpeg_sound_set(SOUND_VOLUME, global_settings.volume);
#endif
@@ -168,7 +168,7 @@ static bool treble(void)
return set_sound(str(LANG_TREBLE), &global_settings.treble, SOUND_TREBLE);
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
static bool loudness(void)
{
return set_sound(str(LANG_LOUDNESS), &global_settings.loudness,
@@ -370,7 +370,7 @@ static bool recdirectory(void)
names, 2, NULL );
}
-#endif /* HAVE_MAS3587F */
+#endif /* MAS3587F */
static void set_chanconf(int val)
{
@@ -406,7 +406,7 @@ bool sound_menu(void)
{ ID2P(LANG_TREBLE), treble },
{ ID2P(LANG_BALANCE), balance },
{ ID2P(LANG_CHANNEL_MENU), chanconf },
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
{ ID2P(LANG_LOUDNESS), loudness },
{ ID2P(LANG_AUTOVOL), avc },
{ ID2P(LANG_SUPERBASS), superbass },
@@ -426,7 +426,7 @@ bool sound_menu(void)
return result;
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
bool recording_menu(bool no_source)
{
int m;
diff --git a/apps/status.c b/apps/status.c
index f144adebef..84a3f8d6c2 100644
--- a/apps/status.c
+++ b/apps/status.c
@@ -84,7 +84,7 @@ int current_playmode(void)
else
return STATUS_PLAY;
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
else
{
if(mpeg_stat & MPEG_STATUS_RECORD)
diff --git a/apps/tree.c b/apps/tree.c
index 44ade04d29..1ffbaa47fe 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -1351,7 +1351,7 @@ static bool dirbrowse(const char *root, const int *dirfilter)
break;
#endif
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
case BUTTON_F2:
if (*dirfilter < NUM_FILTER_MODES)
{
diff --git a/apps/tree.h b/apps/tree.h
index eb4f0cd00c..398c676f05 100644
--- a/apps/tree.h
+++ b/apps/tree.h
@@ -21,7 +21,7 @@
#include <stdbool.h>
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
#define TREE_NEXT BUTTON_DOWN
#define TREE_PREV BUTTON_UP
#define TREE_EXIT BUTTON_LEFT
@@ -37,7 +37,7 @@
#define TREE_RC_ENTER BUTTON_RC_PLAY
#define TREE_RC_RUN BUTTON_RC_PLAY
-#elif defined HAVE_PLAYER_KEYPAD
+#elif CONFIG_KEYPAD == PLAYER_PAD
#define TREE_NEXT BUTTON_RIGHT
#define TREE_PREV BUTTON_LEFT
#define TREE_EXIT BUTTON_STOP
@@ -52,7 +52,7 @@
#define TREE_RC_ENTER BUTTON_RC_PLAY
#define TREE_RC_RUN BUTTON_RC_PLAY
-#elif defined HAVE_ONDIO_KEYPAD
+#elif CONFIG_KEYPAD == ONDIO_PAD
#define TREE_NEXT BUTTON_DOWN
#define TREE_PREV BUTTON_UP
#define TREE_EXIT BUTTON_LEFT
diff --git a/apps/wps.c b/apps/wps.c
index 8d49b5a478..d5c3d82eca 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -62,7 +62,7 @@ static struct mp3entry* nid3 = NULL;
static char current_track_path[MAX_PATH+1];
/* button definitions */
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
#define WPS_NEXT (BUTTON_RIGHT | BUTTON_REL)
#define WPS_PREV (BUTTON_LEFT | BUTTON_REL)
#define WPS_FFWD (BUTTON_RIGHT | BUTTON_REPEAT)
@@ -84,7 +84,7 @@ static char current_track_path[MAX_PATH+1];
#define WPS_RC_DECVOL BUTTON_RC_VOL_DOWN
#define WPS_RC_EXIT BUTTON_RC_STOP
-#elif defined HAVE_PLAYER_KEYPAD
+#elif CONFIG_KEYPAD == PLAYER_PAD
#define WPS_NEXT BUTTON_RIGHT
#define WPS_PREV BUTTON_LEFT
#define WPS_FFWD (BUTTON_RIGHT | BUTTON_REPEAT)
@@ -106,7 +106,7 @@ static char current_track_path[MAX_PATH+1];
#define WPS_RC_DECVOL BUTTON_RC_VOL_DOWN
#define WPS_RC_EXIT BUTTON_RC_STOP
-#elif defined HAVE_ONDIO_KEYPAD
+#elif CONFIG_KEYPAD == ONDIO_PAD
#define WPS_NEXT (BUTTON_RIGHT | BUTTON_REL)
#define WPS_PREV (BUTTON_LEFT | BUTTON_REL)
#define WPS_FFWD (BUTTON_RIGHT | BUTTON_REPEAT)
@@ -218,7 +218,7 @@ static bool ffwd_rew(int button)
{
if (!paused)
mpeg_pause();
-#ifdef HAVE_PLAYER_KEYPAD
+#if CONFIG_KEYPAD == PLAYER_PAD
lcd_stop_scroll();
#endif
if (direction > 0)
@@ -629,7 +629,7 @@ int wps_show(void)
case WPS_RC_NEXT:
#endif
case WPS_NEXT:
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
if (lastbutton & BUTTON_REPEAT)
break;
#endif
@@ -664,7 +664,7 @@ int wps_show(void)
waitfor_nokey();
break;
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
/* play settings */
case BUTTON_F2:
if (quick_screen(CONTEXT_WPS, BUTTON_F2))
diff --git a/apps/wps.h b/apps/wps.h
index c6cec3fdce..bc2e30e7c0 100644
--- a/apps/wps.h
+++ b/apps/wps.h
@@ -28,7 +28,7 @@ int wps_show(void);
bool refresh_wps(bool refresh_scroll);
void handle_usb(void);
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
bool f2_screen(void);
bool f3_screen(void);
#endif
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 1e889a3339..4ba5829f56 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -33,7 +33,7 @@
/* skip whole file for an MMC-based system, FIXME in makefile */
#ifndef HAVE_MMC
-#ifdef HAVE_SCF5249
+#if CONFIG_CPU == SCF5249
/* don't use sh7034 assembler routines */
#define PREFER_C_READING
@@ -43,7 +43,7 @@
#define ATA_DATA (*((volatile unsigned short*)ATA_IOBASE))
#define ATA_CONTROL (*((volatile unsigned short*)ATA_IOBASE + 0xe))
-#elif defined HAVE_SH7034
+#elif CONFIG_CPU == SH7034
#define ATA_IOBASE 0x06100100
#define ATA_DATA (*((volatile unsigned short*)0x06104100))
@@ -879,7 +879,7 @@ int ata_hard_reset(void)
{
int ret;
-#ifdef HAVE_SH7034
+#if CONFIG_CPU == SH7034
/* state HRR0 */
and_b(~0x02, &PADRH); /* assert _RESET */
sleep(1); /* > 25us */
@@ -979,7 +979,7 @@ static int master_slave_detect(void)
return 0;
}
-#ifdef HAVE_SH7034 /* special archos quirk */
+#if CONFIG_CPU == SH7034 /* special archos quirk */
static int io_address_detect(void)
{ /* now, use the HW mask instead of probing */
if (read_hw_mask() & ATA_ADDRESS_200)
@@ -1001,7 +1001,7 @@ static int io_address_detect(void)
void ata_enable(bool on)
{
-#ifdef HAVE_SH7034
+#if CONFIG_CPU == SH7034
if(on)
and_b(~0x80, &PADRL); /* enable ATA */
else
@@ -1129,7 +1129,7 @@ int ata_init(void)
led(false);
-#ifdef HAVE_SH7034
+#if CONFIG_CPU == SH7034
/* Port A setup */
or_b(0x02, &PAIORH); /* output for ATA reset */
or_b(0x02, &PADRH); /* release ATA reset */
@@ -1159,7 +1159,7 @@ int ata_init(void)
if (rc)
return -10 + rc;
-#ifdef HAVE_SH7034
+#if CONFIG_CPU == SH7034
rc = io_address_detect();
if (rc)
return -20 + rc;
diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index ebe3389454..d05f81bb45 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
@@ -36,7 +36,7 @@
struct event_queue button_queue;
static int lastbtn; /* Last valid button status */
-#if defined(HAVE_RECORDER_KEYPAD) || defined(HAVE_ONDIO_KEYPAD)
+#if (CONFIG_KEYPAD == RECORDER_PAD) || (CONFIG_KEYPAD == ONDIO_PAD)
static int last_read; /* Last button status, for debouncing/filtering */
static bool flipped; /* bottons can be flipped to match the LCD flip */
#endif
@@ -179,7 +179,7 @@ int button_get_w_tmo(int ticks)
return (ev.id != SYS_TIMEOUT)? ev.id: BUTTON_NONE;
}
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
/* AJBR buttons are connected to the CPU as follows:
*
@@ -348,7 +348,7 @@ static int button_read(void)
return retval;
}
-#elif defined(HAVE_PLAYER_KEYPAD)
+#elif CONFIG_KEYPAD == PLAYER_PAD
/* The player has two buttons on port pins:
@@ -397,7 +397,7 @@ static int button_read(void)
return btn;
}
-#elif defined HAVE_ONDIO_KEYPAD
+#elif CONFIG_KEYPAD == ONDIO_PAD
/*
* helper function to swap UP/DOWN, LEFT/RIGHT
diff --git a/firmware/drivers/fmradio.c b/firmware/drivers/fmradio.c
index 604005b884..a0394b2a57 100644
--- a/firmware/drivers/fmradio.c
+++ b/firmware/drivers/fmradio.c
@@ -23,7 +23,7 @@
#include "debug.h"
#include "system.h"
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
/* Signals:
DI (Data In) - PB0 (doubles as data pin for the LCD)
diff --git a/firmware/drivers/mas.c b/firmware/drivers/mas.c
index a6fd1d1a21..9f6e0943c7 100644
--- a/firmware/drivers/mas.c
+++ b/firmware/drivers/mas.c
@@ -132,7 +132,7 @@ int mas_writemem(int bank, int addr, const unsigned long* src, int len)
j = 0;
while(len--) {
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
buf[i++] = 0;
buf[i++] = ptr[j+1];
buf[i++] = ptr[j+2];
@@ -232,7 +232,7 @@ static int mas_devread(unsigned long *dest, int len)
if (i2c_getack()) {
for (i=0;len;i++) {
len--;
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
i2c_inb(0); /* Dummy read */
ptr[i*4+0] = 0;
ptr[i*4+1] = i2c_inb(0) & 0x0f;
@@ -266,7 +266,7 @@ static int mas_devread(unsigned long *dest, int len)
return ret;
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
void mas_reset(void)
{
or_b(0x01, &PAIORH);
diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c
index bf2b26b866..8a16cfb3b5 100644
--- a/firmware/drivers/serial.c
+++ b/firmware/drivers/serial.c
@@ -87,7 +87,7 @@ int remote_control_rx(void)
}
else
{
-#ifndef HAVE_ONDIO_KEYPAD
+#if CONFIG_KEYPAD != ONDIO_PAD
switch (btn)
{
case STOP:
diff --git a/firmware/export/button.h b/firmware/export/button.h
index 50a9b1d8fd..562344ea44 100644
--- a/firmware/export/button.h
+++ b/firmware/export/button.h
@@ -30,7 +30,7 @@ int button_get (bool block);
int button_get_w_tmo(int ticks);
int button_status(void);
void button_clear_queue(void);
-#if defined(HAVE_RECORDER_KEYPAD) || defined(HAVE_ONDIO_KEYPAD)
+#if CONFIG_KEYPAD == RECORDER_PAD || CONFIG_KEYPAD == ONDIO_PAD
void button_set_flip(bool flip); /* turn 180 degrees */
#endif
@@ -51,7 +51,7 @@ void button_set_flip(bool flip); /* turn 180 degrees */
#define BUTTON_RC_LEFT (BUTTON_LEFT | BUTTON_REMOTE)
#define BUTTON_RC_RIGHT (BUTTON_RIGHT| BUTTON_REMOTE)
-#ifdef HAVE_RECORDER_KEYPAD
+#if CONFIG_KEYPAD == RECORDER_PAD
/* Recorder specific button codes */
#define BUTTON_ON 0x0001
@@ -66,7 +66,7 @@ void button_set_flip(bool flip); /* turn 180 degrees */
#define BUTTON_RC_PLAY (BUTTON_PLAY | BUTTON_REMOTE)
#define BUTTON_RC_STOP (BUTTON_OFF | BUTTON_REMOTE)
-#elif defined(HAVE_PLAYER_KEYPAD)
+#elif CONFIG_KEYPAD == PLAYER_PAD
/* Jukebox 6000 and Studio specific button codes */
#define BUTTON_ON 0x0001
@@ -77,7 +77,7 @@ void button_set_flip(bool flip); /* turn 180 degrees */
#define BUTTON_RC_PLAY (BUTTON_PLAY | BUTTON_REMOTE)
#define BUTTON_RC_STOP (BUTTON_STOP | BUTTON_REMOTE)
-#elif defined HAVE_ONDIO_KEYPAD
+#elif CONFIG_KEYPAD == ONDIO_PAD
/* Ondio specific button codes */
#define BUTTON_OFF 0x0002
@@ -85,7 +85,7 @@ void button_set_flip(bool flip); /* turn 180 degrees */
#define BUTTON_DOWN 0x0020
#define BUTTON_MENU 0x0100
-#endif /* HAVE_RECORDER/PLAYER/ONDIO_KEYPAD */
+#endif /* RECORDER/PLAYER/ONDIO KEYPAD */
#endif /* _BUTTON_H_ */
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h
index 4f9decf74b..af7ca91315 100644
--- a/firmware/export/config-fmrecorder.h
+++ b/firmware/export/config-fmrecorder.h
@@ -9,7 +9,7 @@
#define LCD_HEIGHT 64
/* define this if you have a Recorder style 10-key keyboard */
-#define HAVE_RECORDER_KEYPAD 1
+#define CONFIG_KEYPAD RECORDER_PAD
/* define this if you have a real-time clock */
#define HAVE_RTC 1
@@ -17,10 +17,10 @@
#ifndef SIMULATOR
/* Define this if you have a MAS3587F */
-#define HAVE_MAS3587F
+#define CONFIG_HWCODEC MAS3587F
/* Define this if you have a SH7034 */
-#define HAVE_SH7034
+#define CONFIG_CPU SH7034
/* Define this if you have a FM Recorder key system */
#define HAVE_FMADC 1
@@ -56,7 +56,7 @@
#define HAVE_ALARM_MOD 1
/* Define this if you have an FM Radio */
-#define HAVE_FMRADIO 1
+#define CONFIG_TUNER S1A0903X01
/* How to detect USB */
#define USB_FMRECORDERSTYLE 1
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 9917b63e68..6343ebd9e2 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -9,7 +9,7 @@
#define LCD_HEIGHT 128
/* define this if you have the Recorder's 10-key keyboard */
-#define HAVE_RECORDER_KEYPAD 1
+#define CONFIG_KEYPAD RECORDER_PAD
#ifndef SIMULATOR
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h
index 36fd095507..d27444840b 100644
--- a/firmware/export/config-ondiofm.h
+++ b/firmware/export/config-ondiofm.h
@@ -9,15 +9,15 @@
#define LCD_HEIGHT 64
/* define this if you have an Ondio style 6-key keyboard */
-#define HAVE_ONDIO_KEYPAD
+#define CONFIG_KEYPAD ONDIO_PAD
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
-#define HAVE_SH7034
+#define CONFIG_CPU SH7034
/* Define this if you have a MAS3587F */
-#define HAVE_MAS3587F
+#define CONFIG_HWCODEC MAS3587F
/* Define this if you have a LiIon battery */
/* #define HAVE_LIION */
@@ -50,7 +50,7 @@
/* #define HAVE_ALARM_MOD 1 */
/* Define this if you have an FM Radio */
-#define HAVE_FMRADIO 1
+#define CONFIG_TUNER TEA5767
/* How to detect USB */
#define USB_FMRECORDERSTYLE 1 /* like FM, on AN1 */
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h
index 4b276db54f..0a270e8ae5 100644
--- a/firmware/export/config-ondiosp.h
+++ b/firmware/export/config-ondiosp.h
@@ -9,15 +9,15 @@
#define LCD_HEIGHT 64
/* define this if you have an Ondio style 6-key keyboard */
-#define HAVE_ONDIO_KEYPAD
+#define CONFIG_KEYPAD ONDIO_PAD
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
-#define HAVE_SH7034
+#define CONFIG_CPU SH7034
-/* Define this if you have a MAS3587F */
-#define HAVE_MAS3587F
+/* Define this if you have a MAS3539F */
+#define CONFIG_HWCODEC MAS3587F /* will be MAS3539F once prepared */
/* Define this if you have a LiIon battery */
/* #define HAVE_LIION */
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h
index 99d5a61240..8bd63c42e6 100644
--- a/firmware/export/config-player.h
+++ b/firmware/export/config-player.h
@@ -6,15 +6,15 @@
#define LCD_HEIGHT (4*16+2*24) /* 4*char + 2*icons */
/* define this if you have the Player's keyboard */
-#define HAVE_PLAYER_KEYPAD 1
+#define CONFIG_KEYPAD PLAYER_PAD
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
-#define HAVE_SH7034
+#define CONFIG_CPU SH7034
/* Define this if you have a MAS3507D */
-#define HAVE_MAS3507D
+#define CONFIG_HWCODEC MAS3507D
/* Define this if you have a DAC3550A */
#define HAVE_DAC3550A
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h
index 704e9e6d8d..89e19f32f6 100644
--- a/firmware/export/config-recorder.h
+++ b/firmware/export/config-recorder.h
@@ -9,7 +9,7 @@
#define LCD_HEIGHT 64
/* define this if you have the Recorder's 10-key keyboard */
-#define HAVE_RECORDER_KEYPAD 1
+#define CONFIG_KEYPAD RECORDER_PAD
/* define this if you have a real-time clock */
#define HAVE_RTC 1
@@ -17,10 +17,10 @@
#ifndef SIMULATOR
/* Define this if you have a MAS3587F */
-#define HAVE_MAS3587F
+#define CONFIG_HWCODEC MAS3587F
/* Define this if you have a SH7034 */
-#define HAVE_SH7034
+#define CONFIG_CPU SH7034
/* Define this if you have charging control */
#define HAVE_CHARGE_CTRL
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h
index efec9c20d1..56967cfa10 100644
--- a/firmware/export/config-recorderv2.h
+++ b/firmware/export/config-recorderv2.h
@@ -9,7 +9,7 @@
#define LCD_HEIGHT 64
/* define this if you have a Recorder style 10-key keyboard */
-#define HAVE_RECORDER_KEYPAD 1
+#define CONFIG_KEYPAD RECORDER_PAD
/* define this if you have a real-time clock */
#define HAVE_RTC 1
@@ -17,10 +17,10 @@
#ifndef SIMULATOR
/* Define this if you have a SH7034 */
-#define HAVE_SH7034
+#define CONFIG_CPU SH7034
/* Define this if you have a MAS3587F */
-#define HAVE_MAS3587F
+#define CONFIG_HWCODEC MAS3587F
/* Define this if you have a FM Recorder key system */
#define HAVE_FMADC 1
@@ -56,7 +56,7 @@
#define HAVE_ALARM_MOD 1
/* Define this if you have an FM Radio */
-#define HAVE_FMRADIO 1
+#define CONFIG_TUNER S1A0903X01
/* How to detect USB */
#define USB_FMRECORDERSTYLE 1
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 49306d4e81..524a2249d3 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -20,6 +20,27 @@
#ifndef __CONFIG_H__
#define __CONFIG_H__
+/* symbolic names for multiple choice configurations: */
+
+/* CONFIG_TUNER */
+#define S1A0903X01 0 /* Samsung */
+#define TEA5767 1 /* Philips */
+
+/* CONFIG_HWCODEC */
+#define MAS3587F 3587
+#define MAS3507D 3507
+#define MAS3539F 3539
+
+/* CONFIG_CPU */
+#define SH7034 7034
+#define SCF5249 5249
+
+/* CONFIG_KEYPAD */
+#define PLAYER_PAD 0
+#define RECORDER_PAD 1
+#define ONDIO_PAD 2
+
+/* now go and pick yours */
#if defined(ARCHOS_PLAYER)
#include "config-player.h"
#elif defined(ARCHOS_RECORDER)
diff --git a/firmware/export/mas.h b/firmware/export/mas.h
index 8a60389ade..dac946ea63 100644
--- a/firmware/export/mas.h
+++ b/firmware/export/mas.h
@@ -27,7 +27,7 @@
/*
MAS I2C defs
*/
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
#define MAS_ADR 0x3c
#define MAS_DEV_WRITE (MAS_ADR | 0x00)
#define MAS_DEV_READ (MAS_ADR | 0x01)
@@ -38,7 +38,7 @@
#endif
/* registers..*/
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
#define MAS_DATA_WRITE 0x68
#define MAS_DATA_READ 0x69
#define MAS_CODEC_WRITE 0x6c
@@ -62,7 +62,7 @@
#define MAS_REG_KPRESCALE 0xe7
#define MAS_REG_KBASS 0x6b
#define MAS_REG_KTREBLE 0x6f
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
#define MAS_REG_KMDB_SWITCH 0x21
#define MAS_REG_KMDB_STR 0x22
#define MAS_REG_KMDB_HAR 0x23
@@ -78,7 +78,7 @@
/*
* MAS commands
*/
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
#define MAS_CMD_READ_ANCILLARY 0x50
#define MAS_CMD_FAST_PRG_DL 0x60
#define MAS_CMD_READ_IC_VER 0x70
diff --git a/firmware/export/mp3_playback.h b/firmware/export/mp3_playback.h
index 12ef734bfe..dd56940c37 100644
--- a/firmware/export/mp3_playback.h
+++ b/firmware/export/mp3_playback.h
@@ -39,13 +39,13 @@ int mpeg_val2phys(int setting, int value);
const char *mpeg_sound_unit(int setting);
int mpeg_sound_numdecimals(int setting);
int mpeg_sound_steps(int setting);
-#if defined(HAVE_MAS3587F) || defined(SIMULATOR)
+#if CONFIG_HWCODEC == MAS3587F || defined(SIMULATOR)
void mpeg_set_pitch(int percent);
#endif
/* exported just for mpeg.c, to keep the recording there */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
void demand_irq_enable(bool on);
#endif
diff --git a/firmware/export/mpeg.h b/firmware/export/mpeg.h
index 3088dc5ffd..66e6ad950c 100644
--- a/firmware/export/mpeg.h
+++ b/firmware/export/mpeg.h
@@ -74,7 +74,7 @@ struct mp3entry* mpeg_current_track(void);
struct mp3entry* mpeg_next_track(void);
bool mpeg_has_changed_track(void);
int mpeg_status(void);
-#if defined(HAVE_MAS3587F) || defined(SIMULATOR)
+#if (CONFIG_HWCODEC == MAS3587F) || defined(SIMULATOR)
void mpeg_init_recording(void);
void mpeg_init_playback(void);
void mpeg_record(const char *filename);
diff --git a/firmware/mp3_playback.c b/firmware/mp3_playback.c
index 7f96ee075a..fae8377c4b 100644
--- a/firmware/mp3_playback.c
+++ b/firmware/mp3_playback.c
@@ -35,7 +35,7 @@
#endif
/* hacking into mpeg.c, recording is still there */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
enum
{
MPEG_DECODER,
@@ -44,7 +44,7 @@ enum
extern unsigned long shadow_7f1;
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #ifdef MAS3587F */
/**** globals ****/
@@ -124,7 +124,7 @@ static const int steps[] =
static const int minval[] =
{
0, /* Volume */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
-12, /* Bass */
-12, /* Treble */
#else
@@ -149,7 +149,7 @@ static const int minval[] =
static const int maxval[] =
{
100, /* Volume */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
12, /* Bass */
12, /* Treble */
#else
@@ -174,7 +174,7 @@ static const int maxval[] =
static const int defaultval[] =
{
70, /* Volume */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
6, /* Bass */
6, /* Treble */
#else
@@ -238,7 +238,7 @@ static bool mpeg_is_initialized = false;
unsigned long mas_version_code;
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
static const unsigned int bass_table[] =
{
@@ -333,7 +333,7 @@ static const unsigned int prescale_table[] =
bool dma_on; /* The DMA is active */
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
static void mas_poll_start(int interval_in_ms)
{
unsigned int count;
@@ -393,7 +393,7 @@ static void postpone_dma_tick(void)
#endif
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
void demand_irq_enable(bool on)
{
int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
@@ -408,7 +408,7 @@ void demand_irq_enable(bool on)
set_irq_level(oldlevel);
}
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
void play_tick(void)
@@ -455,10 +455,10 @@ void IMIA1(void) /* Timer 1 interrupt */
if(playing)
play_tick();
TSR1 &= ~0x01;
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
/* Disable interrupt */
IPRC &= ~0x000f;
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
}
#pragma interrupt
@@ -467,7 +467,7 @@ void IRQ6(void) /* PB14: MAS stop demand IRQ */
SCR0 &= ~0x80;
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
#pragma interrupt
void IRQ3(void) /* PA15: MAS demand IRQ */
{
@@ -479,7 +479,7 @@ void IRQ3(void) /* PA15: MAS demand IRQ */
else
postpone_dma_tick();
}
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
static void setup_sci0(void)
{
@@ -519,7 +519,7 @@ static void setup_sci0(void)
}
#endif /* SIMULATOR */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
static void init_playback(void)
{
unsigned long val;
@@ -577,10 +577,10 @@ static void init_playback(void)
DEBUGF("MAS Decoding application started\n");
}
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
#ifndef SIMULATOR
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
int current_left_volume = 0; /* all values in tenth of dB */
int current_right_volume = 0; /* all values in tenth of dB */
int current_treble = 0;
@@ -613,10 +613,10 @@ void set_prescaled_volume(void)
dac_volume(tenthdb2reg(l), tenthdb2reg(r), false);
}
-#endif /* HAVE_MAS3507D */
+#endif /* MAS3507D */
#endif /* !SIMULATOR */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
unsigned long mdb_shape_shadow = 0;
unsigned long loudness_shadow = 0;
#endif
@@ -626,7 +626,7 @@ void mpeg_sound_set(int setting, int value)
#ifdef SIMULATOR
setting = value;
#else
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
int l, r;
#else
int tmp;
@@ -638,7 +638,7 @@ void mpeg_sound_set(int setting, int value)
switch(setting)
{
case SOUND_VOLUME:
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
tmp = 0x7f00 * value / 100;
mas_codec_writereg(0x10, tmp & 0xff00);
#else
@@ -671,7 +671,7 @@ void mpeg_sound_set(int setting, int value)
break;
case SOUND_BALANCE:
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
tmp = ((value * 127 / 100) & 0xff) << 8;
mas_codec_writereg(0x11, tmp & 0xff00);
#else
@@ -680,7 +680,7 @@ void mpeg_sound_set(int setting, int value)
break;
case SOUND_BASS:
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
tmp = ((value * 8) & 0xff) << 8;
mas_codec_writereg(0x14, tmp & 0xff00);
#else
@@ -691,7 +691,7 @@ void mpeg_sound_set(int setting, int value)
break;
case SOUND_TREBLE:
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
tmp = ((value * 8) & 0xff) << 8;
mas_codec_writereg(0x15, tmp & 0xff00);
#else
@@ -701,7 +701,7 @@ void mpeg_sound_set(int setting, int value)
#endif
break;
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
case SOUND_LOUDNESS:
loudness_shadow = (loudness_shadow & 0x04) |
(MAX(MIN(value * 4, 0x44), 0) << 8);
@@ -771,7 +771,7 @@ void mpeg_sound_set(int setting, int value)
int mpeg_val2phys(int setting, int value)
{
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
int result = 0;
switch(setting)
@@ -858,7 +858,7 @@ void mpeg_sound_channel_config(int configuration)
break;
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
mas_writemem(MAS_BANK_D0, 0x7fc, &val_ll, 1); /* LL */
mas_writemem(MAS_BANK_D0, 0x7fd, &val_lr, 1); /* LR */
mas_writemem(MAS_BANK_D0, 0x7fe, &val_rl, 1); /* RL */
@@ -872,7 +872,7 @@ void mpeg_sound_channel_config(int configuration)
#endif
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
/* This function works by telling the decoder that we have another
crystal frequency than we actually have. It will adjust its internal
parameters and the result is that the audio is played at another pitch.
@@ -918,7 +918,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
(void)mdb_enable;
(void)superbass;
#else
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
unsigned long val;
(void)loudness;
(void)avc;
@@ -932,7 +932,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
setup_sci0();
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
or_b(0x08, &PAIORH); /* output for /PR */
init_playback();
@@ -946,7 +946,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
dac_init();
#endif
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
and_b(~0x20, &PBDRL);
sleep(HZ/5);
or_b(0x20, &PBDRL);
@@ -992,7 +992,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
#endif
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
mas_poll_start(1);
mas_writereg(MAS_REG_KPRESCALE, 0xe9400);
@@ -1001,7 +1001,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
mpeg_sound_channel_config(channel_config);
#endif
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
ICR &= ~0x0010; /* IRQ3 level sensitive */
PACR1 = (PACR1 & 0x3fff) | 0x4000; /* PA15 is IRQ3 */
#endif
@@ -1014,7 +1014,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
mpeg_sound_set(SOUND_BALANCE, balance);
mpeg_sound_set(SOUND_VOLUME, volume);
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
mpeg_sound_channel_config(channel_config);
mpeg_sound_set(SOUND_LOUDNESS, loudness);
mpeg_sound_set(SOUND_AVC, avc);
@@ -1034,12 +1034,12 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
void mp3_shutdown(void)
{
#ifndef SIMULATOR
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
unsigned long val = 1;
mas_writemem(MAS_BANK_D0, 0x7f9, &val, 1); /* Mute */
#endif
-#ifdef HAVE_MAS3507D
+#if CONFIG_HWCODEC == MAS3507D
dac_volume(0, 0, false);
#endif
@@ -1052,7 +1052,7 @@ void mp3_shutdown(void)
void mp3_play_init(void)
{
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
init_playback();
#endif
playing = false;
@@ -1081,7 +1081,7 @@ void mp3_play_data(const unsigned char* start, int size,
CHCR3 |= 0x0001; /* Enable DMA IRQ */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
demand_irq_enable(true);
#endif
}
@@ -1107,7 +1107,7 @@ void mp3_play_stop(void)
playing = false;
mp3_play_pause(false);
CHCR3 &= ~0x0001; /* Disable the DMA interrupt */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
demand_irq_enable(false);
#endif
}
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index e6d59176f7..df9e77a305 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -44,7 +44,7 @@
#include "bitswap.h"
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
static void init_recording(void);
static void start_prerecording(void);
static void start_recording(void);
@@ -52,7 +52,7 @@ static void stop_recording(void);
static int get_unsaved_space(void);
static void pause_recording(void);
static void resume_recording(void);
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
#ifndef SIMULATOR
static int get_unplayed_space(void);
@@ -79,13 +79,13 @@ static int get_unswapped_space(void);
#define MPEG_SAVE_DATA 102
#define MPEG_STOP_DONE 103
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
extern enum /* from mp3_playback.c */
{
MPEG_DECODER,
MPEG_ENCODER
} mpeg_mode;
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
extern char* playlist_peek(int steps);
extern bool playlist_check(int steps);
@@ -326,7 +326,7 @@ unsigned long mpeg_get_last_header(void)
/* Read the frame data from the MAS and reconstruct it with the
frame sync and all */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
mas_readmem(MAS_BANK_D0, 0xfd1, tmp, 2);
#else
mas_readmem(MAS_BANK_D0, 0x301, tmp, 2);
@@ -368,7 +368,7 @@ static int low_watermark; /* Dynamic low watermark level */
static int low_watermark_margin; /* Extra time in seconds for watermark */
static int lowest_watermark_level; /* Debug value to observe the buffer
usage */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
static bool is_recording; /* We are recording */
static bool stop_pending;
unsigned long record_start_time; /* Value of current_tick when recording
@@ -399,15 +399,15 @@ unsigned long shadow_7f1 = 0;
unsigned long shadow_7f6 = 0;
unsigned long shadow_7f9 = 0;
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
static int mpeg_file;
/* Synchronization variables */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
static bool init_recording_done;
static bool init_playback_done;
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
static bool mpeg_stop_done;
static void recalculate_watermark(int bitrate)
@@ -533,7 +533,7 @@ static int get_unswapped_space(void)
return space;
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
static int get_unsaved_space(void)
{
int space = mp3buf_write - mp3buf_read;
@@ -541,9 +541,9 @@ static int get_unsaved_space(void)
space += mp3buflen;
return space;
}
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
#ifdef DEBUG
static long timing_info_index = 0;
static long timing_info[1024];
@@ -584,12 +584,12 @@ static void drain_dma_buffer(void)
);
}
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
void rec_tick (void) __attribute__ ((section (".icode")));
void rec_tick(void)
{
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
int i;
int num_bytes;
if(is_recording && (PBDR & 0x4000))
@@ -694,7 +694,7 @@ void rec_tick(void)
}
}
}
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
}
void playback_tick(void)
@@ -927,10 +927,10 @@ static void track_change(void)
{
DEBUGF("Track change\n");
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
/* Reset the AVC */
mpeg_sound_set(SOUND_AVC, -1);
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
remove_current_tag();
update_playlist();
@@ -1049,7 +1049,7 @@ static void mpeg_thread(void)
int amount_to_read;
int t1, t2;
int start_offset;
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
int amount_to_save;
int writelen;
int framelen;
@@ -1058,7 +1058,7 @@ static void mpeg_thread(void)
int rc;
int offset;
int countdown;
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
is_playing = false;
play_pending = false;
@@ -1067,10 +1067,10 @@ static void mpeg_thread(void)
while(1)
{
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
if(mpeg_mode == MPEG_DECODER)
{
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
yield();
/* Swap if necessary, and don't block on the queue_wait() */
@@ -1092,11 +1092,11 @@ static void mpeg_thread(void)
case MPEG_PLAY:
DEBUGF("MPEG_PLAY\n");
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
/* Silence the A/D input, it may be on because the radio
may be playing */
mas_codec_writereg(6, 0x0000);
-#endif /* #ifdef HAVE_FMRADIO */
+#endif /* #ifdef CONFIG_TUNER */
/* Stop the current stream */
play_pending = false;
@@ -1589,14 +1589,14 @@ static void mpeg_thread(void)
break;
#endif /* #ifndef USB_NONE */
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
case MPEG_INIT_RECORDING:
init_recording();
init_recording_done = true;
break;
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
}
else
{
@@ -1996,7 +1996,7 @@ static void mpeg_thread(void)
break;
}
}
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
}
}
#endif /* SIMULATOR */
@@ -2044,7 +2044,7 @@ bool mpeg_has_changed_track(void)
return false;
}
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
void mpeg_init_playback(void)
{
init_playback_done = false;
@@ -2617,13 +2617,13 @@ int mpeg_status(void)
if(paused)
ret |= MPEG_STATUS_PAUSE;
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
if(is_recording && !is_prerecording)
ret |= MPEG_STATUS_RECORD;
if(is_prerecording)
ret |= MPEG_STATUS_PRERECORD;
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
if(mpeg_errno)
ret |= MPEG_STATUS_ERROR;
@@ -2677,12 +2677,12 @@ void mpeg_init(void)
memset(id3tags, sizeof(id3tags), 0);
memset(_id3tags, sizeof(id3tags), 0);
-#ifdef HAVE_MAS3587F
+#if CONFIG_HWCODEC == MAS3587F
if(read_hw_mask() & PR_ACTIVE_HIGH)
and_b(~0x08, &PADRH);
else
or_b(0x08, &PADRH);
-#endif /* #ifdef HAVE_MAS3587F */
+#endif /* #if CONFIG_HWCODEC == MAS3587F */
#ifdef DEBUG
dbg_timer_start();
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index 6a72a2c613..155d11e609 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -34,7 +34,7 @@
#include "usb.h"
#include "powermgmt.h"
#include "backlight.h"
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
#include "fmradio.h"
#endif
@@ -315,7 +315,7 @@ static void handle_auto_poweroff(void)
charger_was_inserted = charger_is_inserted;
if(timeout &&
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
!fmradio_get_status() &&
#endif
!usb_inserted() &&
diff --git a/uisimulator/battery.c b/uisimulator/battery.c
index 1af8e71787..d8580b42d1 100644
--- a/uisimulator/battery.c
+++ b/uisimulator/battery.c
@@ -22,7 +22,7 @@
#include "types.h"
#include "lcd.h"
#include "debug.h"
-#define HAVE_RECORDER_KEYPAD
+#define CONFIG_KEYPAD RECORDER_PAD
#include "button.h"
#ifdef SIMULATOR
diff --git a/uisimulator/common/fmradio.c b/uisimulator/common/fmradio.c
index 280a963f5a..a4cbd7977c 100644
--- a/uisimulator/common/fmradio.c
+++ b/uisimulator/common/fmradio.c
@@ -18,7 +18,7 @@
****************************************************************************/
#include "debug.h"
-#ifdef HAVE_FMRADIO
+#ifdef CONFIG_TUNER
static int fmstatus = 0;
diff --git a/uisimulator/win32/button.c b/uisimulator/win32/button.c
index 5d56456f6e..a304c366c4 100644
--- a/uisimulator/win32/button.c
+++ b/uisimulator/win32/button.c
@@ -124,9 +124,9 @@ void button_event(int key, bool pressed)
#endif
#ifdef BUTTON_MENU
-#ifdef HAVE_PLAYER_KEYPAD
+#if CONFIG_KEYPAD == PLAYER_PAD
case VK_RETURN:
-#elif defined HAVE_ONDIO_KEYPAD
+#elif CONFIG_KEYPAD == ONDIO_PAD
case VK_INSERT:
#endif
new_btn = BUTTON_MENU;
diff --git a/uisimulator/x11/button-x11.c b/uisimulator/x11/button-x11.c
index 534568b658..d6837f640a 100644
--- a/uisimulator/x11/button-x11.c
+++ b/uisimulator/x11/button-x11.c
@@ -145,10 +145,10 @@ static int get_raw_button (void)
#endif
#ifdef BUTTON_MENU
-#ifdef HAVE_PLAYER_KEYPAD
+#if CONFIG_KEYPAD == PLAYER_PAD
case XK_KP_Enter:
case XK_Return:
-#elif defined HAVE_ONDIO_KEYPAD
+#elif CONFIG_KEYPAD == ONDIO_PAD
case XK_KP_Insert:
case XK_Control_R:
#endif