summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/SOURCES4
-rw-r--r--apps/codecs.c20
-rw-r--r--apps/codecs.h18
-rw-r--r--apps/codecs/lib/SOURCES2
-rw-r--r--apps/codecs/lib/xxx2wav.c4
-rw-r--r--apps/database.c2
-rw-r--r--apps/debug_menu.c4
-rw-r--r--apps/filetypes.c4
-rw-r--r--apps/main.c8
-rw-r--r--apps/playlist.c4
-rw-r--r--apps/plugin.c18
-rw-r--r--apps/plugin.h16
-rw-r--r--apps/plugins/SOURCES2
-rw-r--r--apps/plugins/oscillograph.c2
-rw-r--r--apps/plugins/oscilloscope.c2
-rw-r--r--apps/plugins/rockboy/rbsound.c2
-rw-r--r--apps/plugins/splitedit.c10
-rw-r--r--apps/plugins/vu_meter.c2
-rw-r--r--apps/recorder/peakmeter.c8
-rw-r--r--apps/recorder/radio.c18
-rw-r--r--apps/screens.c4
-rw-r--r--apps/settings.c26
-rw-r--r--apps/settings.h4
-rw-r--r--apps/settings_menu.c16
-rw-r--r--apps/sound_menu.c10
-rw-r--r--apps/status.c2
-rw-r--r--apps/talk.c24
-rw-r--r--apps/tree.c2
-rw-r--r--firmware/SOURCES8
-rw-r--r--firmware/drivers/mas.c10
-rw-r--r--firmware/export/config-fmrecorder.h2
-rw-r--r--firmware/export/config-gmini120.h2
-rw-r--r--firmware/export/config-gminisp.h2
-rw-r--r--firmware/export/config-h100.h2
-rw-r--r--firmware/export/config-h120.h2
-rw-r--r--firmware/export/config-h300.h2
-rw-r--r--firmware/export/config-iaudiox5.h2
-rw-r--r--firmware/export/config-ondiofm.h2
-rw-r--r--firmware/export/config-ondiosp.h2
-rw-r--r--firmware/export/config-player.h2
-rw-r--r--firmware/export/config-recorder.h2
-rw-r--r--firmware/export/config-recorderv2.h2
-rw-r--r--firmware/export/config.h4
-rw-r--r--firmware/export/id3.h6
-rw-r--r--firmware/export/mas.h12
-rw-r--r--firmware/export/mp3_playback.h2
-rw-r--r--firmware/export/mpeg.h2
-rw-r--r--firmware/export/sound.h2
-rw-r--r--firmware/id3.c12
-rw-r--r--firmware/mp3_playback.c58
-rw-r--r--firmware/mp3data.c2
-rw-r--r--firmware/mpeg.c58
-rw-r--r--firmware/sound.c50
-rw-r--r--firmware/tuner_samsung.c2
-rw-r--r--uisimulator/common/stubs.c4
-rw-r--r--uisimulator/x11/SOURCES2
56 files changed, 248 insertions, 248 deletions
diff --git a/apps/SOURCES b/apps/SOURCES
index 3c933d22b6..063abe34d7 100644
--- a/apps/SOURCES
+++ b/apps/SOURCES
@@ -23,7 +23,7 @@ settings_menu.c
23sleeptimer.c 23sleeptimer.c
24sound_menu.c 24sound_menu.c
25status.c 25status.c
26#if !defined(SIMULATOR) || CONFIG_HWCODEC == MASNONE 26#if !defined(SIMULATOR) || CONFIG_CODEC == SWCODEC
27talk.c 27talk.c
28#endif 28#endif
29tree.c 29tree.c
@@ -49,7 +49,7 @@ recorder/radio.c
49#ifdef HAVE_RECORDING 49#ifdef HAVE_RECORDING
50recorder/recording.c 50recorder/recording.c
51#endif 51#endif
52#if CONFIG_HWCODEC == MASNONE 52#if CONFIG_CODEC == SWCODEC
53pcmbuf.c 53pcmbuf.c
54playback.c 54playback.c
55metadata.c 55metadata.c
diff --git a/apps/codecs.c b/apps/codecs.c
index 0093da67c5..f7f271da96 100644
--- a/apps/codecs.c
+++ b/apps/codecs.c
@@ -48,12 +48,12 @@
48#include "system.h" 48#include "system.h"
49#include "sound.h" 49#include "sound.h"
50#include "database.h" 50#include "database.h"
51#if (CONFIG_HWCODEC == MASNONE) 51#if (CONFIG_CODEC == SWCODEC)
52#include "pcm_playback.h" 52#include "pcm_playback.h"
53#endif 53#endif
54 54
55#ifdef SIMULATOR 55#ifdef SIMULATOR
56#if CONFIG_HWCODEC == MASNONE 56#if CONFIG_CODEC == SWCODEC
57unsigned char codecbuf[CODEC_SIZE]; 57unsigned char codecbuf[CODEC_SIZE];
58#endif 58#endif
59void *sim_codec_load_ram(char* codecptr, int size, 59void *sim_codec_load_ram(char* codecptr, int size,
@@ -161,10 +161,10 @@ struct codec_api ci = {
161 mp3_play_pause, 161 mp3_play_pause,
162 mp3_play_stop, 162 mp3_play_stop,
163 mp3_is_playing, 163 mp3_is_playing,
164#if CONFIG_HWCODEC != MASNONE 164#if CONFIG_CODEC != SWCODEC
165 bitswap, 165 bitswap,
166#endif 166#endif
167#if CONFIG_HWCODEC == MASNONE 167#if CONFIG_CODEC == SWCODEC
168 pcm_play_data, 168 pcm_play_data,
169 pcm_play_stop, 169 pcm_play_stop,
170 pcm_set_frequency, 170 pcm_set_frequency,
@@ -188,24 +188,24 @@ struct codec_api ci = {
188 audio_current_track, 188 audio_current_track,
189 audio_flush_and_reload_tracks, 189 audio_flush_and_reload_tracks,
190 audio_get_file_pos, 190 audio_get_file_pos,
191#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) 191#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
192 mpeg_get_last_header, 192 mpeg_get_last_header,
193#endif 193#endif
194#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 194#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
195 sound_set_pitch, 195 sound_set_pitch,
196#endif 196#endif
197 197
198#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) 198#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
199 /* MAS communication */ 199 /* MAS communication */
200 mas_readmem, 200 mas_readmem,
201 mas_writemem, 201 mas_writemem,
202 mas_readreg, 202 mas_readreg,
203 mas_writereg, 203 mas_writereg,
204#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 204#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
205 mas_codec_writereg, 205 mas_codec_writereg,
206 mas_codec_readreg, 206 mas_codec_readreg,
207#endif 207#endif
208#endif /* !simulator and HWCODEC != MASNONE */ 208#endif /* !simulator and HWCODEC != SWCODEC */
209 209
210 /* tag database */ 210 /* tag database */
211 &tagdbheader, 211 &tagdbheader,
@@ -232,7 +232,7 @@ struct codec_api ci = {
232 find_next_frame, 232 find_next_frame,
233 battery_level, 233 battery_level,
234 battery_level_safe, 234 battery_level_safe,
235#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 235#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
236 peak_meter_scale_value, 236 peak_meter_scale_value,
237 peak_meter_set_use_dbfs, 237 peak_meter_set_use_dbfs,
238 peak_meter_get_use_dbfs, 238 peak_meter_get_use_dbfs,
diff --git a/apps/codecs.h b/apps/codecs.h
index 47cd5711ae..fe309554db 100644
--- a/apps/codecs.h
+++ b/apps/codecs.h
@@ -43,7 +43,7 @@
43#include "mpeg.h" 43#include "mpeg.h"
44#include "audio.h" 44#include "audio.h"
45#include "mp3_playback.h" 45#include "mp3_playback.h"
46#if (HWCODEC == MASNONE) 46#if (HWCODEC == SWCODEC)
47#include "pcm_playback.h" 47#include "pcm_playback.h"
48#endif 48#endif
49#include "settings.h" 49#include "settings.h"
@@ -234,10 +234,10 @@ struct codec_api {
234 void (*mp3_play_pause)(bool play); 234 void (*mp3_play_pause)(bool play);
235 void (*mp3_play_stop)(void); 235 void (*mp3_play_stop)(void);
236 bool (*mp3_is_playing)(void); 236 bool (*mp3_is_playing)(void);
237#if CONFIG_HWCODEC != MASNONE 237#if CONFIG_CODEC != SWCODEC
238 void (*bitswap)(unsigned char *data, int length); 238 void (*bitswap)(unsigned char *data, int length);
239#endif 239#endif
240#if CONFIG_HWCODEC == MASNONE 240#if CONFIG_CODEC == SWCODEC
241 void (*pcm_play_data)(void (*get_more)(unsigned char** start, long*size)); 241 void (*pcm_play_data)(void (*get_more)(unsigned char** start, long*size));
242 void (*pcm_play_stop)(void); 242 void (*pcm_play_stop)(void);
243 void (*pcm_set_frequency)(unsigned int frequency); 243 void (*pcm_set_frequency)(unsigned int frequency);
@@ -261,20 +261,20 @@ struct codec_api {
261 struct mp3entry* (*audio_current_track)(void); 261 struct mp3entry* (*audio_current_track)(void);
262 void (*audio_flush_and_reload_tracks)(void); 262 void (*audio_flush_and_reload_tracks)(void);
263 int (*audio_get_file_pos)(void); 263 int (*audio_get_file_pos)(void);
264#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) 264#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
265 unsigned long (*mpeg_get_last_header)(void); 265 unsigned long (*mpeg_get_last_header)(void);
266#endif 266#endif
267#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 267#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
268 void (*sound_set_pitch)(int pitch); 268 void (*sound_set_pitch)(int pitch);
269#endif 269#endif
270 270
271 /* MAS communication */ 271 /* MAS communication */
272#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) 272#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
273 int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len); 273 int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len);
274 int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len); 274 int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len);
275 int (*mas_readreg)(int reg); 275 int (*mas_readreg)(int reg);
276 int (*mas_writereg)(int reg, unsigned int val); 276 int (*mas_writereg)(int reg, unsigned int val);
277#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 277#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
278 int (*mas_codec_writereg)(int reg, unsigned int val); 278 int (*mas_codec_writereg)(int reg, unsigned int val);
279 int (*mas_codec_readreg)(int reg); 279 int (*mas_codec_readreg)(int reg);
280#endif 280#endif
@@ -311,7 +311,7 @@ struct codec_api {
311 long max_offset, unsigned long last_header); 311 long max_offset, unsigned long last_header);
312 int (*battery_level)(void); 312 int (*battery_level)(void);
313 bool (*battery_level_safe)(void); 313 bool (*battery_level_safe)(void);
314#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 314#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
315 unsigned short (*peak_meter_scale_value)(unsigned short val, 315 unsigned short (*peak_meter_scale_value)(unsigned short val,
316 int meterwidth); 316 int meterwidth);
317 void (*peak_meter_set_use_dbfs)(bool use); 317 void (*peak_meter_set_use_dbfs)(bool use);
@@ -332,7 +332,7 @@ struct codec_api {
332}; 332};
333 333
334/* defined by the codec loader (codec.c) */ 334/* defined by the codec loader (codec.c) */
335#if CONFIG_HWCODEC == MASNONE 335#if CONFIG_CODEC == SWCODEC
336int codec_load_ram(char* codecptr, int size, void* ptr2, int bufwrap, 336int codec_load_ram(char* codecptr, int size, void* ptr2, int bufwrap,
337 struct codec_api *api); 337 struct codec_api *api);
338int codec_load_file(const char* codec, struct codec_api *api); 338int codec_load_file(const char* codec, struct codec_api *api);
diff --git a/apps/codecs/lib/SOURCES b/apps/codecs/lib/SOURCES
index 352fedbff9..b0e50172a3 100644
--- a/apps/codecs/lib/SOURCES
+++ b/apps/codecs/lib/SOURCES
@@ -1,4 +1,4 @@
1#if CONFIG_HWCODEC == MASNONE /* software codec platforms */ 1#if CONFIG_CODEC == SWCODEC /* software codec platforms */
2codeclib.c 2codeclib.c
3xxx2wav.c 3xxx2wav.c
4#endif 4#endif
diff --git a/apps/codecs/lib/xxx2wav.c b/apps/codecs/lib/xxx2wav.c
index 66cc8b3bbb..cd09d32450 100644
--- a/apps/codecs/lib/xxx2wav.c
+++ b/apps/codecs/lib/xxx2wav.c
@@ -19,7 +19,7 @@
19 19
20/* Various "helper functions" common to all the xxx2wav decoder plugins */ 20/* Various "helper functions" common to all the xxx2wav decoder plugins */
21 21
22#if (CONFIG_HWCODEC == MASNONE) 22#if (CONFIG_CODEC == SWCODEC)
23/* software codec platforms, not for simulator */ 23/* software codec platforms, not for simulator */
24 24
25#include "codecs.h" 25#include "codecs.h"
@@ -138,4 +138,4 @@ void qsort(void *base, size_t nmemb, size_t size,
138 local_rb->qsort(base,nmemb,size,compar); 138 local_rb->qsort(base,nmemb,size,compar);
139} 139}
140 140
141#endif /* CONFIG_HWCODEC == MASNONE */ 141#endif /* CONFIG_CODEC == SWCODEC */
diff --git a/apps/database.c b/apps/database.c
index 90cdc37f2c..a84baa2a5c 100644
--- a/apps/database.c
+++ b/apps/database.c
@@ -44,7 +44,7 @@
44#include "database.h" 44#include "database.h"
45#include "autoconf.h" 45#include "autoconf.h"
46 46
47#if CONFIG_HWCODEC == MASNONE 47#if CONFIG_CODEC == SWCODEC
48#include "playback.h" 48#include "playback.h"
49#else 49#else
50#include "mpeg.h" 50#include "mpeg.h"
diff --git a/apps/debug_menu.c b/apps/debug_menu.c
index b4cd05699c..329ba7d7ab 100644
--- a/apps/debug_menu.c
+++ b/apps/debug_menu.c
@@ -61,7 +61,7 @@
61#if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR) 61#if defined(IRIVER_H100_SERIES) && !defined(SIMULATOR)
62extern bool pcm_rec_screen(void); 62extern bool pcm_rec_screen(void);
63#endif 63#endif
64#if CONFIG_HWCODEC == MASNONE 64#if CONFIG_CODEC == SWCODEC
65#include "pcmbuf.h" 65#include "pcmbuf.h"
66#include "pcm_playback.h" 66#include "pcm_playback.h"
67#endif 67#endif
@@ -154,7 +154,7 @@ bool dbg_os(void)
154#endif 154#endif
155 155
156#ifdef HAVE_LCD_BITMAP 156#ifdef HAVE_LCD_BITMAP
157#if CONFIG_HWCODEC != MASNONE 157#if CONFIG_CODEC != SWCODEC
158bool dbg_audio_thread(void) 158bool dbg_audio_thread(void)
159{ 159{
160 char buf[32]; 160 char buf[32];
diff --git a/apps/filetypes.c b/apps/filetypes.c
index 31852b1aba..ace89154fc 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -40,14 +40,14 @@
40#define MAX_PLUGIN_LENGTH 32 40#define MAX_PLUGIN_LENGTH 32
41 41
42/* max filetypes (plugins & icons stored here) */ 42/* max filetypes (plugins & icons stored here) */
43#if CONFIG_HWCODEC == MASNONE 43#if CONFIG_CODEC == SWCODEC
44#define MAX_FILETYPES 64 44#define MAX_FILETYPES 64
45#else 45#else
46#define MAX_FILETYPES 32 46#define MAX_FILETYPES 32
47#endif 47#endif
48 48
49/* max exttypes (extensions stored here) */ 49/* max exttypes (extensions stored here) */
50#if CONFIG_HWCODEC == MASNONE 50#if CONFIG_CODEC == SWCODEC
51/* Software codecs require more file extensions */ 51/* Software codecs require more file extensions */
52#define MAX_EXTTYPES 64 52#define MAX_EXTTYPES 64
53#else 53#else
diff --git a/apps/main.c b/apps/main.c
index 55897de5f5..6373920c74 100644
--- a/apps/main.c
+++ b/apps/main.c
@@ -61,7 +61,7 @@
61#include "misc.h" 61#include "misc.h"
62#include "database.h" 62#include "database.h"
63 63
64#if (CONFIG_HWCODEC == MASNONE) 64#if (CONFIG_CODEC == SWCODEC)
65#include "pcmbuf.h" 65#include "pcmbuf.h"
66#else 66#else
67#define pcmbuf_init() 67#define pcmbuf_init()
@@ -129,7 +129,7 @@ void init(void)
129 global_settings.mdb_enable, 129 global_settings.mdb_enable,
130 global_settings.superbass); 130 global_settings.superbass);
131 button_clear_queue(); /* Empty the keyboard buffer */ 131 button_clear_queue(); /* Empty the keyboard buffer */
132#if CONFIG_HWCODEC == MASNONE 132#if CONFIG_CODEC == SWCODEC
133 talk_init(); 133 talk_init();
134#endif 134#endif
135} 135}
@@ -264,7 +264,7 @@ void init(void)
264 264
265 /* On software codec platforms we have to init audio before 265 /* On software codec platforms we have to init audio before
266 calling audio_set_buffer_margin(). */ 266 calling audio_set_buffer_margin(). */
267#if (CONFIG_HWCODEC == MASNONE) 267#if (CONFIG_CODEC == SWCODEC)
268 audio_init(); 268 audio_init();
269#endif 269#endif
270 settings_calc_config_sector(); 270 settings_calc_config_sector();
@@ -291,7 +291,7 @@ void init(void)
291 global_settings.mdb_shape, 291 global_settings.mdb_shape,
292 global_settings.mdb_enable, 292 global_settings.mdb_enable,
293 global_settings.superbass); 293 global_settings.superbass);
294#if (CONFIG_HWCODEC == MASNONE) 294#if (CONFIG_CODEC == SWCODEC)
295 sound_settings_apply(); 295 sound_settings_apply();
296#else 296#else
297 audio_init(); 297 audio_init();
diff --git a/apps/playlist.c b/apps/playlist.c
index bc2bd05905..70df8113e0 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -1417,7 +1417,7 @@ int playlist_resume(void)
1417 }; 1417 };
1418 1418
1419 /* use mp3 buffer for maximum load speed */ 1419 /* use mp3 buffer for maximum load speed */
1420#if CONFIG_HWCODEC != MASNONE 1420#if CONFIG_CODEC != SWCODEC
1421 talk_buffer_steal(); /* we use the mp3 buffer, need to tell */ 1421 talk_buffer_steal(); /* we use the mp3 buffer, need to tell */
1422 buflen = (audiobufend - audiobuf); 1422 buflen = (audiobufend - audiobuf);
1423 buffer = audiobuf; 1423 buffer = audiobuf;
@@ -1836,7 +1836,7 @@ int playlist_start(int start_index, int offset)
1836 struct playlist_info* playlist = &current_playlist; 1836 struct playlist_info* playlist = &current_playlist;
1837 1837
1838 playlist->index = start_index; 1838 playlist->index = start_index;
1839#if CONFIG_HWCODEC != MASNONE 1839#if CONFIG_CODEC != SWCODEC
1840 talk_buffer_steal(); /* will use the mp3 buffer */ 1840 talk_buffer_steal(); /* will use the mp3 buffer */
1841#endif 1841#endif
1842 audio_play(offset); 1842 audio_play(offset);
diff --git a/apps/plugin.c b/apps/plugin.c
index 6c018067ea..c02a8e2936 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -48,7 +48,7 @@
48#include "timer.h" 48#include "timer.h"
49#include "sound.h" 49#include "sound.h"
50#include "database.h" 50#include "database.h"
51#if (CONFIG_HWCODEC == MASNONE) 51#if (CONFIG_CODEC == SWCODEC)
52#include "pcm_playback.h" 52#include "pcm_playback.h"
53#endif 53#endif
54 54
@@ -249,10 +249,10 @@ static const struct plugin_api rockbox_api = {
249 mp3_play_pause, 249 mp3_play_pause,
250 mp3_play_stop, 250 mp3_play_stop,
251 mp3_is_playing, 251 mp3_is_playing,
252#if CONFIG_HWCODEC != MASNONE 252#if CONFIG_CODEC != SWCODEC
253 bitswap, 253 bitswap,
254#endif 254#endif
255#if CONFIG_HWCODEC == MASNONE 255#if CONFIG_CODEC == SWCODEC
256 pcm_play_data, 256 pcm_play_data,
257 pcm_play_stop, 257 pcm_play_stop,
258 pcm_set_frequency, 258 pcm_set_frequency,
@@ -276,24 +276,24 @@ static const struct plugin_api rockbox_api = {
276 audio_current_track, 276 audio_current_track,
277 audio_flush_and_reload_tracks, 277 audio_flush_and_reload_tracks,
278 audio_get_file_pos, 278 audio_get_file_pos,
279#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) 279#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
280 mpeg_get_last_header, 280 mpeg_get_last_header,
281#endif 281#endif
282#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 282#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
283 sound_set_pitch, 283 sound_set_pitch,
284#endif 284#endif
285 285
286#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) 286#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
287 /* MAS communication */ 287 /* MAS communication */
288 mas_readmem, 288 mas_readmem,
289 mas_writemem, 289 mas_writemem,
290 mas_readreg, 290 mas_readreg,
291 mas_writereg, 291 mas_writereg,
292#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 292#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
293 mas_codec_writereg, 293 mas_codec_writereg,
294 mas_codec_readreg, 294 mas_codec_readreg,
295#endif 295#endif
296#endif /* !simulator and HWCODEC != MASNONE */ 296#endif /* !SIMULATOR && CONFIG_CODEC != SWCODEC */
297 297
298 /* tag database */ 298 /* tag database */
299 &tagdbheader, 299 &tagdbheader,
@@ -328,7 +328,7 @@ static const struct plugin_api rockbox_api = {
328 find_next_frame, 328 find_next_frame,
329 battery_level, 329 battery_level,
330 battery_level_safe, 330 battery_level_safe,
331#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 331#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
332 peak_meter_scale_value, 332 peak_meter_scale_value,
333 peak_meter_set_use_dbfs, 333 peak_meter_set_use_dbfs,
334 peak_meter_get_use_dbfs, 334 peak_meter_get_use_dbfs,
diff --git a/apps/plugin.h b/apps/plugin.h
index 8760162405..839e87af64 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -44,7 +44,7 @@
44#include "mpeg.h" 44#include "mpeg.h"
45#include "audio.h" 45#include "audio.h"
46#include "mp3_playback.h" 46#include "mp3_playback.h"
47#if (HWCODEC == MASNONE) 47#if (HWCODEC == SWCODEC)
48#include "pcm_playback.h" 48#include "pcm_playback.h"
49#endif 49#endif
50#include "settings.h" 50#include "settings.h"
@@ -325,10 +325,10 @@ struct plugin_api {
325 void (*mp3_play_pause)(bool play); 325 void (*mp3_play_pause)(bool play);
326 void (*mp3_play_stop)(void); 326 void (*mp3_play_stop)(void);
327 bool (*mp3_is_playing)(void); 327 bool (*mp3_is_playing)(void);
328#if CONFIG_HWCODEC != MASNONE 328#if CONFIG_CODEC != SWCODEC
329 void (*bitswap)(unsigned char *data, int length); 329 void (*bitswap)(unsigned char *data, int length);
330#endif 330#endif
331#if CONFIG_HWCODEC == MASNONE 331#if CONFIG_CODEC == SWCODEC
332 void (*pcm_play_data)(void (*get_more)(unsigned char** start, long*size)); 332 void (*pcm_play_data)(void (*get_more)(unsigned char** start, long*size));
333 void (*pcm_play_stop)(void); 333 void (*pcm_play_stop)(void);
334 void (*pcm_set_frequency)(unsigned int frequency); 334 void (*pcm_set_frequency)(unsigned int frequency);
@@ -352,20 +352,20 @@ struct plugin_api {
352 struct mp3entry* (*audio_current_track)(void); 352 struct mp3entry* (*audio_current_track)(void);
353 void (*audio_flush_and_reload_tracks)(void); 353 void (*audio_flush_and_reload_tracks)(void);
354 int (*audio_get_file_pos)(void); 354 int (*audio_get_file_pos)(void);
355#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) 355#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
356 unsigned long (*mpeg_get_last_header)(void); 356 unsigned long (*mpeg_get_last_header)(void);
357#endif 357#endif
358#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 358#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
359 void (*sound_set_pitch)(int pitch); 359 void (*sound_set_pitch)(int pitch);
360#endif 360#endif
361 361
362 /* MAS communication */ 362 /* MAS communication */
363#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) 363#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
364 int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len); 364 int (*mas_readmem)(int bank, int addr, unsigned long* dest, int len);
365 int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len); 365 int (*mas_writemem)(int bank, int addr, const unsigned long* src, int len);
366 int (*mas_readreg)(int reg); 366 int (*mas_readreg)(int reg);
367 int (*mas_writereg)(int reg, unsigned int val); 367 int (*mas_writereg)(int reg, unsigned int val);
368#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 368#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
369 int (*mas_codec_writereg)(int reg, unsigned int val); 369 int (*mas_codec_writereg)(int reg, unsigned int val);
370 int (*mas_codec_readreg)(int reg); 370 int (*mas_codec_readreg)(int reg);
371#endif 371#endif
@@ -410,7 +410,7 @@ struct plugin_api {
410 long max_offset, unsigned long last_header); 410 long max_offset, unsigned long last_header);
411 int (*battery_level)(void); 411 int (*battery_level)(void);
412 bool (*battery_level_safe)(void); 412 bool (*battery_level_safe)(void);
413#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 413#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
414 unsigned short (*peak_meter_scale_value)(unsigned short val, 414 unsigned short (*peak_meter_scale_value)(unsigned short val,
415 int meterwidth); 415 int meterwidth);
416 void (*peak_meter_set_use_dbfs)(bool use); 416 void (*peak_meter_set_use_dbfs)(bool use);
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 1b98967ac1..cf62ee7203 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -66,7 +66,7 @@ nim.c
66alpine_cdc.c 66alpine_cdc.c
67#endif 67#endif
68 68
69#if CONFIG_HWCODEC == MASNONE /* software codec platforms */ 69#if CONFIG_CODEC == SWCODEC /* software codec platforms */
70iriverify.c 70iriverify.c
71wav2wv.c 71wav2wv.c
72midi2wav.c 72midi2wav.c
diff --git a/apps/plugins/oscillograph.c b/apps/plugins/oscillograph.c
index 1512e11389..069ef44247 100644
--- a/apps/plugins/oscillograph.c
+++ b/apps/plugins/oscillograph.c
@@ -20,7 +20,7 @@
20 20
21#ifdef HAVE_LCD_BITMAP 21#ifdef HAVE_LCD_BITMAP
22#ifndef SIMULATOR /* don't want this code in the simulator */ 22#ifndef SIMULATOR /* don't want this code in the simulator */
23#if CONFIG_HWCODEC != MASNONE /* only for MAS-targets */ 23#if CONFIG_CODEC != SWCODEC /* only for MAS-targets */
24 24
25/* The different drawing modes */ 25/* The different drawing modes */
26#define DRAW_MODE_FILLED 0 26#define DRAW_MODE_FILLED 0
diff --git a/apps/plugins/oscilloscope.c b/apps/plugins/oscilloscope.c
index f5e5189e2e..b3b081d861 100644
--- a/apps/plugins/oscilloscope.c
+++ b/apps/plugins/oscilloscope.c
@@ -23,7 +23,7 @@
23#include "plugin.h" 23#include "plugin.h"
24 24
25#ifdef HAVE_LCD_BITMAP /* and also not for the Player */ 25#ifdef HAVE_LCD_BITMAP /* and also not for the Player */
26#if CONFIG_HWCODEC != MASNONE /* only for MAS-targets */ 26#if CONFIG_CODEC != SWCODEC /* only for MAS-targets */
27 27
28/* The different drawing modes */ 28/* The different drawing modes */
29#define DRAW_MODE_FILLED 0 29#define DRAW_MODE_FILLED 0
diff --git a/apps/plugins/rockboy/rbsound.c b/apps/plugins/rockboy/rbsound.c
index 529cf6e733..139c33d037 100644
--- a/apps/plugins/rockboy/rbsound.c
+++ b/apps/plugins/rockboy/rbsound.c
@@ -15,7 +15,7 @@ rcvar_t pcm_exports[] =
15 RCV_END 15 RCV_END
16}; 16};
17 17
18/*#if CONFIG_HWCODEC == MASNONE && !defined(SIMULATOR) 18/*#if CONFIG_CODEC == SWCODEC && !defined(SIMULATOR)
19 * disabled cause it crashes with current audio implementation.. no sound. 19 * disabled cause it crashes with current audio implementation.. no sound.
20 */ 20 */
21#if 0 21#if 0
diff --git a/apps/plugins/splitedit.c b/apps/plugins/splitedit.c
index 9317419c23..35562f99fc 100644
--- a/apps/plugins/splitedit.c
+++ b/apps/plugins/splitedit.c
@@ -269,7 +269,7 @@ static void update_icons(void)
269 LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT, 269 LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
270 BMPWIDTH, BMPHEIGHT); 270 BMPWIDTH, BMPHEIGHT);
271 271
272#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 272#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
273 /* The scale icon */ 273 /* The scale icon */
274 rb->lcd_mono_bitmap(SCALE_BMP[rb->peak_meter_get_use_dbfs() ? 1 : 0], 274 rb->lcd_mono_bitmap(SCALE_BMP[rb->peak_meter_get_use_dbfs() ? 1 : 0],
275 2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT, 275 2 *LCD_WIDTH/3 + LCD_WIDTH/3 / 2 - BMPWIDTH/2, LCD_HEIGHT - BMPHEIGHT,
@@ -909,7 +909,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
909 { 909 {
910 /* read volume info */ 910 /* read volume info */
911 unsigned short volume; 911 unsigned short volume;
912#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 912#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
913 volume = rb->mas_codec_readreg(0x0c); 913 volume = rb->mas_codec_readreg(0x0c);
914 volume += rb->mas_codec_readreg(0x0d); 914 volume += rb->mas_codec_readreg(0x0d);
915 volume = volume / 2; 915 volume = volume / 2;
@@ -1074,7 +1074,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
1074 lastx = time_to_xpos(mp3->elapsed); 1074 lastx = time_to_xpos(mp3->elapsed);
1075 break; 1075 break;
1076 1076
1077#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 1077#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1078#ifdef SPLITEDIT_SPEED100 1078#ifdef SPLITEDIT_SPEED100
1079 case SPLITEDIT_SPEED150: 1079 case SPLITEDIT_SPEED150:
1080 rb->sound_set_pitch(1500); 1080 rb->sound_set_pitch(1500);
@@ -1133,7 +1133,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
1133 break; 1133 break;
1134 1134
1135 case SPLITEDIT_SCALE: 1135 case SPLITEDIT_SCALE:
1136#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 1136#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1137 rb->peak_meter_set_use_dbfs(!rb->peak_meter_get_use_dbfs()); 1137 rb->peak_meter_set_use_dbfs(!rb->peak_meter_get_use_dbfs());
1138#endif 1138#endif
1139 splitedit_invalidate_osci(); 1139 splitedit_invalidate_osci();
@@ -1202,7 +1202,7 @@ unsigned long splitedit_editor(struct mp3entry * mp3_to_split,
1202 } 1202 }
1203 } 1203 }
1204 } 1204 }
1205#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 1205#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1206#ifdef SPLITEDIT_SPEED100 1206#ifdef SPLITEDIT_SPEED100
1207 rb->sound_set_pitch(1000); /* make sure to reset pitch */ 1207 rb->sound_set_pitch(1000); /* make sure to reset pitch */
1208#endif 1208#endif
diff --git a/apps/plugins/vu_meter.c b/apps/plugins/vu_meter.c
index c2db45ed88..80621d2fd3 100644
--- a/apps/plugins/vu_meter.c
+++ b/apps/plugins/vu_meter.c
@@ -17,7 +17,7 @@
17 **************************************************************************/ 17 **************************************************************************/
18#include "plugin.h" 18#include "plugin.h"
19 19
20#if defined(HAVE_LCD_BITMAP) && (CONFIG_HWCODEC != MASNONE) 20#if defined(HAVE_LCD_BITMAP) && (CONFIG_CODEC != SWCODEC)
21 21
22/* variable button definitions */ 22/* variable button definitions */
23#if CONFIG_KEYPAD == RECORDER_PAD 23#if CONFIG_KEYPAD == RECORDER_PAD
diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c
index 088cf8e099..2e4cea0704 100644
--- a/apps/recorder/peakmeter.c
+++ b/apps/recorder/peakmeter.c
@@ -33,11 +33,11 @@
33#include "lang.h" 33#include "lang.h"
34#include "peakmeter.h" 34#include "peakmeter.h"
35 35
36#if CONFIG_HWCODEC == MASNONE 36#if CONFIG_CODEC == SWCODEC
37#include "pcm_playback.h" 37#include "pcm_playback.h"
38#endif 38#endif
39 39
40#if !defined(SIMULATOR) && CONFIG_HWCODEC != MASNONE 40#if !defined(SIMULATOR) && CONFIG_CODEC != SWCODEC
41/* Data source */ 41/* Data source */
42static int pm_src_left = MAS_REG_DQPEAK_L; 42static int pm_src_left = MAS_REG_DQPEAK_L;
43static int pm_src_right = MAS_REG_DQPEAK_R; 43static int pm_src_right = MAS_REG_DQPEAK_R;
@@ -490,7 +490,7 @@ void peak_meter_playback(bool playback)
490{ 490{
491#ifdef SIMULATOR 491#ifdef SIMULATOR
492 (void)playback; 492 (void)playback;
493#elif CONFIG_HWCODEC == MASNONE 493#elif CONFIG_CODEC == SWCODEC
494/* FIX: not for the sw-based ones yes */ 494/* FIX: not for the sw-based ones yes */
495 (void)playback; 495 (void)playback;
496#else 496#else
@@ -530,7 +530,7 @@ void peak_meter_peek(void)
530#ifdef SIMULATOR 530#ifdef SIMULATOR
531 pm_cur_left = left = 8000; 531 pm_cur_left = left = 8000;
532 pm_cur_right = right = 9000; 532 pm_cur_right = right = 9000;
533#elif CONFIG_HWCODEC == MASNONE 533#elif CONFIG_CODEC == SWCODEC
534 pcm_calculate_peaks(&pm_cur_left, &pm_cur_right); 534 pcm_calculate_peaks(&pm_cur_left, &pm_cur_right);
535 left = pm_cur_left; 535 left = pm_cur_left;
536 right = pm_cur_right; 536 right = pm_cur_right;
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index a0280ecf1f..68d36dddd3 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -55,7 +55,7 @@
55 55
56#ifdef CONFIG_TUNER 56#ifdef CONFIG_TUNER
57 57
58#if CONFIG_HWCODEC == MASNONE 58#if CONFIG_CODEC == SWCODEC
59#include "uda1380.h" 59#include "uda1380.h"
60#include "pcm_record.h" 60#include "pcm_record.h"
61#endif 61#endif
@@ -213,14 +213,14 @@ bool radio_screen(void)
213 radio_load_presets(); 213 radio_load_presets();
214 214
215#ifndef SIMULATOR 215#ifndef SIMULATOR
216#if CONFIG_HWCODEC != MASNONE 216#if CONFIG_CODEC != SWCODEC
217 if(rec_create_directory() > 0) 217 if(rec_create_directory() > 0)
218 have_recorded = true; 218 have_recorded = true;
219#endif 219#endif
220 220
221 audio_stop(); 221 audio_stop();
222 222
223#if CONFIG_HWCODEC != MASNONE 223#if CONFIG_CODEC != SWCODEC
224 mpeg_init_recording(); 224 mpeg_init_recording();
225 225
226 sound_settings_apply(); 226 sound_settings_apply();
@@ -497,7 +497,7 @@ bool radio_screen(void)
497 } 497 }
498 498
499#ifndef SIMULATOR 499#ifndef SIMULATOR
500#if CONFIG_HWCODEC != MASNONE 500#if CONFIG_CODEC != SWCODEC
501 seconds = mpeg_recorded_time() / HZ; 501 seconds = mpeg_recorded_time() / HZ;
502#endif 502#endif
503#endif 503#endif
@@ -580,7 +580,7 @@ bool radio_screen(void)
580 } 580 }
581 } 581 }
582 582
583#if CONFIG_HWCODEC != MASNONE 583#if CONFIG_CODEC != SWCODEC
584 audio_init_playback(); 584 audio_init_playback();
585#endif 585#endif
586 586
@@ -588,7 +588,7 @@ bool radio_screen(void)
588 588
589 if(keep_playing) 589 if(keep_playing)
590 { 590 {
591#if CONFIG_HWCODEC != MASNONE 591#if CONFIG_CODEC != SWCODEC
592 /* Enable the Left and right A/D Converter */ 592 /* Enable the Left and right A/D Converter */
593 mpeg_set_recording_gain(sound_default(SOUND_LEFT_GAIN), 593 mpeg_set_recording_gain(sound_default(SOUND_LEFT_GAIN),
594 sound_default(SOUND_RIGHT_GAIN), false); 594 sound_default(SOUND_RIGHT_GAIN), false);
@@ -599,7 +599,7 @@ bool radio_screen(void)
599 else 599 else
600 { 600 {
601 radio_stop(); 601 radio_stop();
602#if CONFIG_HWCODEC == MASNONE 602#if CONFIG_CODEC == SWCODEC
603 pcmrec_set_mux(0); /* Line In */ 603 pcmrec_set_mux(0); /* Line In */
604#endif 604#endif
605 } 605 }
@@ -880,7 +880,7 @@ bool handle_radio_presets(void)
880} 880}
881 881
882#ifndef SIMULATOR 882#ifndef SIMULATOR
883#if CONFIG_HWCODEC != MASNONE 883#if CONFIG_CODEC != SWCODEC
884static bool fm_recording_settings(void) 884static bool fm_recording_settings(void)
885{ 885{
886 bool ret; 886 bool ret;
@@ -959,7 +959,7 @@ bool radio_menu(void)
959#endif 959#endif
960 { monomode_menu_string , toggle_mono_mode }, 960 { monomode_menu_string , toggle_mono_mode },
961 { ID2P(LANG_SOUND_SETTINGS) , sound_menu }, 961 { ID2P(LANG_SOUND_SETTINGS) , sound_menu },
962#if !defined(SIMULATOR) && (CONFIG_HWCODEC != MASNONE) 962#if !defined(SIMULATOR) && (CONFIG_CODEC != SWCODEC)
963 { ID2P(LANG_RECORDING_SETTINGS) , fm_recording_settings}, 963 { ID2P(LANG_RECORDING_SETTINGS) , fm_recording_settings},
964#endif 964#endif
965 }; 965 };
diff --git a/apps/screens.c b/apps/screens.c
index 5f949efda8..10e1cdd188 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -1307,7 +1307,7 @@ int draw_id3_item(int line, int top, int header, const char* body)
1307 return line + 2; 1307 return line + 2;
1308} 1308}
1309 1309
1310#if CONFIG_HWCODEC == MASNONE 1310#if CONFIG_CODEC == SWCODEC
1311#define ID3_ITEMS 13 1311#define ID3_ITEMS 13
1312#else 1312#else
1313#define ID3_ITEMS 11 1313#define ID3_ITEMS 11
@@ -1401,7 +1401,7 @@ bool browse_id3(void)
1401 snprintf(buf, sizeof(buf), "%d Hz", id3->frequency); 1401 snprintf(buf, sizeof(buf), "%d Hz", id3->frequency);
1402 line = draw_id3_item(line, top, LANG_ID3_FRECUENCY, buf); 1402 line = draw_id3_item(line, top, LANG_ID3_FRECUENCY, buf);
1403 1403
1404#if CONFIG_HWCODEC == MASNONE 1404#if CONFIG_CODEC == SWCODEC
1405 line = draw_id3_item(line, top, LANG_ID3_TRACK_GAIN, 1405 line = draw_id3_item(line, top, LANG_ID3_TRACK_GAIN,
1406 id3->track_gain_string); 1406 id3->track_gain_string);
1407 1407
diff --git a/apps/settings.c b/apps/settings.c
index 6fd2ec64bf..6649ce3f89 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -66,14 +66,14 @@
66#include "version.h" 66#include "version.h"
67#include "rtc.h" 67#include "rtc.h"
68#include "sound.h" 68#include "sound.h"
69#if CONFIG_HWCODEC == MAS3507D 69#if CONFIG_CODEC == MAS3507D
70void dac_line_in(bool enable); 70void dac_line_in(bool enable);
71#endif 71#endif
72struct user_settings global_settings; 72struct user_settings global_settings;
73#ifdef HAVE_RECORDING 73#ifdef HAVE_RECORDING
74const char rec_base_directory[] = REC_BASE_DIR; 74const char rec_base_directory[] = REC_BASE_DIR;
75#endif 75#endif
76#if CONFIG_HWCODEC == MASNONE 76#if CONFIG_CODEC == SWCODEC
77#include "pcmbuf.h" 77#include "pcmbuf.h"
78#include "pcm_playback.h" 78#include "pcm_playback.h"
79#endif 79#endif
@@ -183,14 +183,14 @@ static const struct bit_entry rtc_bits[] =
183 /* sound */ 183 /* sound */
184 {7, S_O(volume), 70, "volume", NULL }, /* 0...100 */ 184 {7, S_O(volume), 70, "volume", NULL }, /* 0...100 */
185 {8 | SIGNED, S_O(balance), 0, "balance", NULL }, /* -100...100 */ 185 {8 | SIGNED, S_O(balance), 0, "balance", NULL }, /* -100...100 */
186#if CONFIG_HWCODEC != MASNONE /* any MAS */ 186#if CONFIG_CODEC != SWCODEC /* any MAS */
187 {5 | SIGNED, S_O(bass), 0, "bass", NULL }, /* -15..+15 / -12..+12 */ 187 {5 | SIGNED, S_O(bass), 0, "bass", NULL }, /* -15..+15 / -12..+12 */
188 {5 | SIGNED, S_O(treble), 0, "treble", NULL }, /* -15..+15 / -12..+12 */ 188 {5 | SIGNED, S_O(treble), 0, "treble", NULL }, /* -15..+15 / -12..+12 */
189#elif defined HAVE_UDA1380 189#elif defined HAVE_UDA1380
190 {5, S_O(bass), 0, "bass", NULL }, /* 0..+24 */ 190 {5, S_O(bass), 0, "bass", NULL }, /* 0..+24 */
191 {3, S_O(treble), 0, "treble", NULL }, /* 0..+6 */ 191 {3, S_O(treble), 0, "treble", NULL }, /* 0..+6 */
192#endif 192#endif
193#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 193#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
194 {5, S_O(loudness), 0, "loudness", NULL }, /* 0...17 */ 194 {5, S_O(loudness), 0, "loudness", NULL }, /* 0...17 */
195 {3, S_O(avc), 0, "auto volume", "off,20ms,2,4,8" }, 195 {3, S_O(avc), 0, "auto volume", "off,20ms,2,4,8" },
196 {1, S_O(superbass), false, "superbass", off_on }, 196 {1, S_O(superbass), false, "superbass", off_on },
@@ -312,7 +312,7 @@ static const struct bit_entry hd_bits[] =
312 {4, S_O(ff_rewind_min_step), FF_REWIND_1000, 312 {4, S_O(ff_rewind_min_step), FF_REWIND_1000,
313 "scan min step", "1,2,3,4,5,6,8,10,15,20,25,30,45,60" }, 313 "scan min step", "1,2,3,4,5,6,8,10,15,20,25,30,45,60" },
314 {4, S_O(ff_rewind_accel), 3, "scan accel", NULL }, 314 {4, S_O(ff_rewind_accel), 3, "scan accel", NULL },
315#if CONFIG_HWCODEC == MASNONE 315#if CONFIG_CODEC == SWCODEC
316 {3, S_O(buffer_margin), 0, "antiskip", 316 {3, S_O(buffer_margin), 0, "antiskip",
317 "5s,15s,30s,1min,2min,3min,5min,10min" }, 317 "5s,15s,30s,1min,2min,3min,5min,10min" },
318#else 318#else
@@ -356,7 +356,7 @@ static const struct bit_entry hd_bits[] =
356 {7, S_O(peak_meter_min), 60, "peak meter min", NULL }, /* 0...100 */ 356 {7, S_O(peak_meter_min), 60, "peak meter min", NULL }, /* 0...100 */
357 {7, S_O(peak_meter_max), 0, "peak meter max", NULL }, /* 0...100 */ 357 {7, S_O(peak_meter_max), 0, "peak meter max", NULL }, /* 0...100 */
358#endif 358#endif
359#if CONFIG_HWCODEC == MAS3587F 359#if CONFIG_CODEC == MAS3587F
360 /* recording */ 360 /* recording */
361 {1, S_O(rec_editable), false, "editable recordings", off_on }, 361 {1, S_O(rec_editable), false, "editable recordings", off_on },
362 {4, S_O(rec_timesplit), 0, "rec timesplit", /* 0...15 */ 362 {4, S_O(rec_timesplit), 0, "rec timesplit", /* 0...15 */
@@ -376,14 +376,14 @@ static const struct bit_entry hd_bits[] =
376 {1, S_O(rec_directory), 0, /* rec_base_directory */ 376 {1, S_O(rec_directory), 0, /* rec_base_directory */
377 "rec directory", REC_BASE_DIR ",current" }, 377 "rec directory", REC_BASE_DIR ",current" },
378#endif 378#endif
379#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 379#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
380 {7, S_O(mdb_strength), 0, "mdb strength", NULL}, 380 {7, S_O(mdb_strength), 0, "mdb strength", NULL},
381 {7, S_O(mdb_harmonics), 0, "mdb harmonics", NULL}, 381 {7, S_O(mdb_harmonics), 0, "mdb harmonics", NULL},
382 {9, S_O(mdb_center), 0, "mdb center", NULL}, 382 {9, S_O(mdb_center), 0, "mdb center", NULL},
383 {9, S_O(mdb_shape), 0, "mdb shape", NULL}, 383 {9, S_O(mdb_shape), 0, "mdb shape", NULL},
384 {1, S_O(mdb_enable), 0, "mdb enable", off_on}, 384 {1, S_O(mdb_enable), 0, "mdb enable", off_on},
385#endif 385#endif
386#if CONFIG_HWCODEC == MAS3507D 386#if CONFIG_CODEC == MAS3507D
387 {1, S_O(line_in), false, "line in", off_on }, 387 {1, S_O(line_in), false, "line in", off_on },
388#endif 388#endif
389 /* voice */ 389 /* voice */
@@ -407,7 +407,7 @@ static const struct bit_entry hd_bits[] =
407 {4, S_O(rec_trigger_mode ), 1, "trigger mode", "off,no rearm,rearm"}, 407 {4, S_O(rec_trigger_mode ), 1, "trigger mode", "off,no rearm,rearm"},
408#endif 408#endif
409 409
410#if CONFIG_HWCODEC == MASNONE 410#if CONFIG_CODEC == SWCODEC
411 {3, S_O(crossfade_duration), 0, "crossfade duration", "1s,2s,4s,6s,8s,10s,12s,14s"}, 411 {3, S_O(crossfade_duration), 0, "crossfade duration", "1s,2s,4s,6s,8s,10s,12s,14s"},
412#endif 412#endif
413 413
@@ -425,7 +425,7 @@ static const struct bit_entry hd_bits[] =
425 {1, S_O(next_folder), false, "move to next folder", off_on }, 425 {1, S_O(next_folder), false, "move to next folder", off_on },
426 {1, S_O(runtimedb), false, "gather runtime data", off_on }, 426 {1, S_O(runtimedb), false, "gather runtime data", off_on },
427 427
428#if CONFIG_HWCODEC == MASNONE 428#if CONFIG_CODEC == SWCODEC
429 {2, S_O(crossfade), 0, "crossfade type", "off,crossfade,mix"}, 429 {2, S_O(crossfade), 0, "crossfade type", "off,crossfade,mix"},
430 {1, S_O(replaygain), false, "replaygain", off_on }, 430 {1, S_O(replaygain), false, "replaygain", off_on },
431 {1, S_O(replaygain_track), false, "replaygain type", "track,album" }, 431 {1, S_O(replaygain_track), false, "replaygain type", "track,album" },
@@ -776,7 +776,7 @@ void sound_settings_apply(void)
776 sound_set(SOUND_VOLUME, global_settings.volume); 776 sound_set(SOUND_VOLUME, global_settings.volume);
777 sound_set(SOUND_CHANNELS, global_settings.channel_config); 777 sound_set(SOUND_CHANNELS, global_settings.channel_config);
778 sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width); 778 sound_set(SOUND_STEREO_WIDTH, global_settings.stereo_width);
779#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 779#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
780 sound_set(SOUND_LOUDNESS, global_settings.loudness); 780 sound_set(SOUND_LOUDNESS, global_settings.loudness);
781 sound_set(SOUND_AVC, global_settings.avc); 781 sound_set(SOUND_AVC, global_settings.avc);
782 sound_set(SOUND_MDB_STRENGTH, global_settings.mdb_strength); 782 sound_set(SOUND_MDB_STRENGTH, global_settings.mdb_strength);
@@ -811,7 +811,7 @@ void settings_apply(void)
811 backlight_set_fade_out(global_settings.backlight_fade_out); 811 backlight_set_fade_out(global_settings.backlight_fade_out);
812#endif 812#endif
813 ata_spindown(global_settings.disk_spindown); 813 ata_spindown(global_settings.disk_spindown);
814#if CONFIG_HWCODEC == MAS3507D 814#if CONFIG_CODEC == MAS3507D
815 dac_line_in(global_settings.line_in); 815 dac_line_in(global_settings.line_in);
816#endif 816#endif
817#ifdef HAVE_ATA_POWER_OFF 817#ifdef HAVE_ATA_POWER_OFF
@@ -872,7 +872,7 @@ void settings_apply(void)
872 talk_init(); /* use voice of same language */ 872 talk_init(); /* use voice of same language */
873 } 873 }
874 874
875#if CONFIG_HWCODEC == MASNONE 875#if CONFIG_CODEC == SWCODEC
876 audio_set_crossfade(global_settings.crossfade); 876 audio_set_crossfade(global_settings.crossfade);
877#endif 877#endif
878 878
diff --git a/apps/settings.h b/apps/settings.h
index c59fe47532..8387fe02a8 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -154,7 +154,7 @@ struct user_settings
154 bool mdb_enable; /* true/false */ 154 bool mdb_enable; /* true/false */
155 bool superbass; /* true/false */ 155 bool superbass; /* true/false */
156 156
157#if CONFIG_HWCODEC == MASNONE 157#if CONFIG_CODEC == SWCODEC
158 int crossfade; 158 int crossfade;
159 int crossfade_duration; 159 int crossfade_duration;
160#endif 160#endif
@@ -330,7 +330,7 @@ struct user_settings
330 bool next_folder; /* move to next folder */ 330 bool next_folder; /* move to next folder */
331 bool runtimedb; /* runtime database active? */ 331 bool runtimedb; /* runtime database active? */
332 332
333#if CONFIG_HWCODEC == MASNONE 333#if CONFIG_CODEC == SWCODEC
334 bool replaygain; /* enable replaygain */ 334 bool replaygain; /* enable replaygain */
335 bool replaygain_track; /* true for track gain, false for album gain */ 335 bool replaygain_track; /* true for track gain, false for album gain */
336 bool replaygain_noclip; /* scale to prevent clips */ 336 bool replaygain_noclip; /* scale to prevent clips */
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index bbbeca3683..a614723ca5 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -54,7 +54,7 @@
54#include "peakmeter.h" 54#include "peakmeter.h"
55#endif 55#endif
56#include "lang.h" 56#include "lang.h"
57#if CONFIG_HWCODEC == MAS3507D 57#if CONFIG_CODEC == MAS3507D
58void dac_line_in(bool enable); 58void dac_line_in(bool enable);
59#endif 59#endif
60#ifdef HAVE_ALARM_MOD 60#ifdef HAVE_ALARM_MOD
@@ -65,7 +65,7 @@ void dac_line_in(bool enable);
65#include "lcd-remote.h" 65#include "lcd-remote.h"
66#endif 66#endif
67 67
68#if CONFIG_HWCODEC == MASNONE 68#if CONFIG_CODEC == SWCODEC
69#include "pcmbuf.h" 69#include "pcmbuf.h"
70#include "pcm_playback.h" 70#include "pcm_playback.h"
71#include "dsp.h" 71#include "dsp.h"
@@ -879,7 +879,7 @@ static bool poweroff(void)
879#endif /* HAVE_ATA_POWEROFF */ 879#endif /* HAVE_ATA_POWEROFF */
880#endif /* !HAVE_MMC */ 880#endif /* !HAVE_MMC */
881 881
882#if CONFIG_HWCODEC == MAS3507D 882#if CONFIG_CODEC == MAS3507D
883static bool line_in(void) 883static bool line_in(void)
884{ 884{
885 bool rc = set_bool(str(LANG_LINE_IN), &global_settings.line_in); 885 bool rc = set_bool(str(LANG_LINE_IN), &global_settings.line_in);
@@ -902,7 +902,7 @@ static bool max_files_in_playlist(void)
902 NULL, 1000, 1000, 20000, NULL ); 902 NULL, 1000, 1000, 20000, NULL );
903} 903}
904 904
905#if CONFIG_HWCODEC == MASNONE 905#if CONFIG_CODEC == SWCODEC
906static bool buffer_margin(void) 906static bool buffer_margin(void)
907{ 907{
908 int ret; 908 int ret;
@@ -1111,7 +1111,7 @@ static bool id3_order(void)
1111 mpeg_id3_options); 1111 mpeg_id3_options);
1112} 1112}
1113 1113
1114#if CONFIG_HWCODEC == MASNONE 1114#if CONFIG_CODEC == SWCODEC
1115static bool crossfade(void) 1115static bool crossfade(void)
1116{ 1116{
1117 static const struct opt_items names[] = { 1117 static const struct opt_items names[] = {
@@ -1172,7 +1172,7 @@ static bool runtimedb(void)
1172 return rc; 1172 return rc;
1173} 1173}
1174 1174
1175#if CONFIG_HWCODEC == MASNONE 1175#if CONFIG_CODEC == SWCODEC
1176static bool replaygain(void) 1176static bool replaygain(void)
1177{ 1177{
1178 bool result = set_bool(str(LANG_REPLAYGAIN_ENABLE), 1178 bool result = set_bool(str(LANG_REPLAYGAIN_ENABLE),
@@ -1270,7 +1270,7 @@ static bool playback_settings_menu(void)
1270 { ID2P(LANG_WIND_MENU), ff_rewind_settings_menu }, 1270 { ID2P(LANG_WIND_MENU), ff_rewind_settings_menu },
1271 { ID2P(LANG_MP3BUFFER_MARGIN), buffer_margin }, 1271 { ID2P(LANG_MP3BUFFER_MARGIN), buffer_margin },
1272 { ID2P(LANG_FADE_ON_STOP), set_fade_on_stop }, 1272 { ID2P(LANG_FADE_ON_STOP), set_fade_on_stop },
1273#if CONFIG_HWCODEC == MASNONE 1273#if CONFIG_CODEC == SWCODEC
1274 { ID2P(LANG_CROSSFADE), crossfade }, 1274 { ID2P(LANG_CROSSFADE), crossfade },
1275 { ID2P(LANG_CROSSFADE_DURATION), crossfade_duration }, 1275 { ID2P(LANG_CROSSFADE_DURATION), crossfade_duration },
1276 { ID2P(LANG_REPLAYGAIN), replaygain_settings_menu }, 1276 { ID2P(LANG_REPLAYGAIN), replaygain_settings_menu },
@@ -1654,7 +1654,7 @@ static bool system_settings_menu(void)
1654 { ID2P(LANG_ALARM_MOD_ALARM_MENU), alarm_screen }, 1654 { ID2P(LANG_ALARM_MOD_ALARM_MENU), alarm_screen },
1655#endif 1655#endif
1656 { ID2P(LANG_LIMITS_MENU), limits_settings_menu }, 1656 { ID2P(LANG_LIMITS_MENU), limits_settings_menu },
1657#if CONFIG_HWCODEC == MAS3507D 1657#if CONFIG_CODEC == MAS3507D
1658 { ID2P(LANG_LINE_IN), line_in }, 1658 { ID2P(LANG_LINE_IN), line_in },
1659#endif 1659#endif
1660#ifdef HAVE_CHARGING 1660#ifdef HAVE_CHARGING
diff --git a/apps/sound_menu.c b/apps/sound_menu.c
index 0c298b091f..0fcf79492c 100644
--- a/apps/sound_menu.c
+++ b/apps/sound_menu.c
@@ -38,7 +38,7 @@
38#include "talk.h" 38#include "talk.h"
39#include "misc.h" 39#include "misc.h"
40#include "sound.h" 40#include "sound.h"
41#if CONFIG_HWCODEC == MAS3587F 41#if CONFIG_CODEC == MAS3587F
42#include "peakmeter.h" 42#include "peakmeter.h"
43#include "mas.h" 43#include "mas.h"
44#endif 44#endif
@@ -171,7 +171,7 @@ static bool treble(void)
171 return set_sound(str(LANG_TREBLE), &global_settings.treble, SOUND_TREBLE); 171 return set_sound(str(LANG_TREBLE), &global_settings.treble, SOUND_TREBLE);
172} 172}
173 173
174#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 174#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
175static bool loudness(void) 175static bool loudness(void)
176{ 176{
177 return set_sound(str(LANG_LOUDNESS), &global_settings.loudness, 177 return set_sound(str(LANG_LOUDNESS), &global_settings.loudness,
@@ -421,7 +421,7 @@ bool sound_menu(void)
421 { ID2P(LANG_BALANCE), balance }, 421 { ID2P(LANG_BALANCE), balance },
422 { ID2P(LANG_CHANNEL_MENU), chanconf }, 422 { ID2P(LANG_CHANNEL_MENU), chanconf },
423 { ID2P(LANG_STEREO_WIDTH), stereo_width }, 423 { ID2P(LANG_STEREO_WIDTH), stereo_width },
424#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 424#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
425 { ID2P(LANG_LOUDNESS), loudness }, 425 { ID2P(LANG_LOUDNESS), loudness },
426 { ID2P(LANG_AUTOVOL), avc }, 426 { ID2P(LANG_AUTOVOL), avc },
427 { ID2P(LANG_SUPERBASS), superbass }, 427 { ID2P(LANG_SUPERBASS), superbass },
@@ -454,7 +454,7 @@ enum trigger_menu_option
454 TRIG_OPTION_COUNT, 454 TRIG_OPTION_COUNT,
455}; 455};
456 456
457#if !defined(SIMULATOR) && CONFIG_HWCODEC == MAS3587F 457#if !defined(SIMULATOR) && CONFIG_CODEC == MAS3587F
458static char* create_thres_str(int threshold) 458static char* create_thres_str(int threshold)
459{ 459{
460 static char retval[6]; 460 static char retval[6];
@@ -846,7 +846,7 @@ bool recording_menu(bool no_source)
846 items[i++].function = recdirectory; 846 items[i++].function = recdirectory;
847 items[i].desc = ID2P(LANG_RECORD_STARTUP); 847 items[i].desc = ID2P(LANG_RECORD_STARTUP);
848 items[i++].function = reconstartup; 848 items[i++].function = reconstartup;
849#if !defined(SIMULATOR) && CONFIG_HWCODEC == MAS3587F 849#if !defined(SIMULATOR) && CONFIG_CODEC == MAS3587F
850 items[i].desc = str(LANG_RECORD_TRIGGER); 850 items[i].desc = str(LANG_RECORD_TRIGGER);
851 items[i++].function = rectrigger; 851 items[i++].function = rectrigger;
852#endif 852#endif
diff --git a/apps/status.c b/apps/status.c
index b980c4d3eb..ca4b21833e 100644
--- a/apps/status.c
+++ b/apps/status.c
@@ -106,7 +106,7 @@ int current_playmode(void)
106 else 106 else
107 return STATUS_PLAY; 107 return STATUS_PLAY;
108 } 108 }
109#if CONFIG_HWCODEC == MAS3587F 109#if CONFIG_CODEC == MAS3587F
110 else 110 else
111 { 111 {
112 if(audio_stat & AUDIO_STATUS_RECORD) 112 if(audio_stat & AUDIO_STATUS_RECORD)
diff --git a/apps/talk.c b/apps/talk.c
index 3e6bdb934a..0904ecd2c3 100644
--- a/apps/talk.c
+++ b/apps/talk.c
@@ -34,7 +34,7 @@
34#include "id3.h" 34#include "id3.h"
35#include "logf.h" 35#include "logf.h"
36#include "bitswap.h" 36#include "bitswap.h"
37#if CONFIG_HWCODEC == MASNONE 37#if CONFIG_CODEC == SWCODEC
38#include "playback.h" 38#include "playback.h"
39#endif 39#endif
40 40
@@ -148,7 +148,7 @@ static void load_voicefile(void)
148 int load_size; 148 int load_size;
149 int got_size; 149 int got_size;
150 int file_size; 150 int file_size;
151#if CONFIG_HWCODEC == MASNONE 151#if CONFIG_CODEC == SWCODEC
152 int length, i; 152 int length, i;
153 unsigned char *buf, temp; 153 unsigned char *buf, temp;
154#endif 154#endif
@@ -205,7 +205,7 @@ static void load_voicefile(void)
205#endif 205#endif
206 206
207 /* Do a bitswap as necessary. */ 207 /* Do a bitswap as necessary. */
208#if CONFIG_HWCODEC == MASNONE 208#if CONFIG_CODEC == SWCODEC
209 logf("Bitswapping voice file."); 209 logf("Bitswapping voice file.");
210 cpu_boost(true); 210 cpu_boost(true);
211 buf = (unsigned char *)(&p_voicefile->index) + 211 buf = (unsigned char *)(&p_voicefile->index) +
@@ -261,7 +261,7 @@ static void mp3_callback(unsigned char** start, int* size)
261 261
262 if (queue[queue_read].len > 0) /* current clip not finished? */ 262 if (queue[queue_read].len > 0) /* current clip not finished? */
263 { /* feed the next 64K-1 chunk */ 263 { /* feed the next 64K-1 chunk */
264#if CONFIG_HWCODEC != MASNONE 264#if CONFIG_CODEC != SWCODEC
265 sent = MIN(queue[queue_read].len, 0xFFFF); 265 sent = MIN(queue[queue_read].len, 0xFFFF);
266#else 266#else
267 sent = queue[queue_read].len; 267 sent = queue[queue_read].len;
@@ -279,7 +279,7 @@ re_check:
279 279
280 if (QUEUE_LEVEL) /* queue is not empty? */ 280 if (QUEUE_LEVEL) /* queue is not empty? */
281 { /* start next clip */ 281 { /* start next clip */
282#if CONFIG_HWCODEC != MASNONE 282#if CONFIG_CODEC != SWCODEC
283 sent = MIN(queue[queue_read].len, 0xFFFF); 283 sent = MIN(queue[queue_read].len, 0xFFFF);
284#else 284#else
285 sent = queue[queue_read].len; 285 sent = queue[queue_read].len;
@@ -393,7 +393,7 @@ static int queue_clip(unsigned char* buf, long size, bool enqueue)
393 if (queue_level == 0) 393 if (queue_level == 0)
394 { /* queue was empty, we have to do the initial start */ 394 { /* queue was empty, we have to do the initial start */
395 p_lastclip = buf; 395 p_lastclip = buf;
396#if CONFIG_HWCODEC != MASNONE 396#if CONFIG_CODEC != SWCODEC
397 sent = MIN(size, 0xFFFF); /* DMA can do no more */ 397 sent = MIN(size, 0xFFFF); /* DMA can do no more */
398#else 398#else
399 sent = size; 399 sent = size;
@@ -485,7 +485,7 @@ void talk_init(void)
485 if (has_voicefile) 485 if (has_voicefile)
486 { 486 {
487 voicefile_size = filesize(filehandle); 487 voicefile_size = filesize(filehandle);
488#if CONFIG_HWCODEC == MASNONE 488#if CONFIG_CODEC == SWCODEC
489 voice_init(); 489 voice_init();
490#endif 490#endif
491 close(filehandle); /* close again, this was just to detect presence */ 491 close(filehandle); /* close again, this was just to detect presence */
@@ -519,7 +519,7 @@ int talk_id(long id, bool enqueue)
519 unsigned char* clipbuf; 519 unsigned char* clipbuf;
520 int unit; 520 int unit;
521 521
522#if CONFIG_HWCODEC != MASNONE 522#if CONFIG_CODEC != SWCODEC
523 if (audio_status()) /* busy, buffer in use */ 523 if (audio_status()) /* busy, buffer in use */
524 return -1; 524 return -1;
525#endif 525#endif
@@ -586,7 +586,7 @@ int talk_file(const char* filename, bool enqueue)
586 586
587 if (size) 587 if (size)
588 { 588 {
589#if CONFIG_HWCODEC != MASNONE 589#if CONFIG_CODEC != SWCODEC
590 bitswap(p_thumbnail, size); 590 bitswap(p_thumbnail, size);
591#endif 591#endif
592 queue_clip(p_thumbnail, size, enqueue); 592 queue_clip(p_thumbnail, size, enqueue);
@@ -603,7 +603,7 @@ int talk_number(long n, bool enqueue)
603 int level = 0; /* mille count */ 603 int level = 0; /* mille count */
604 long mil = 1000000000; /* highest possible "-illion" */ 604 long mil = 1000000000; /* highest possible "-illion" */
605 605
606#if CONFIG_HWCODEC != MASNONE 606#if CONFIG_CODEC != SWCODEC
607 if (audio_status()) /* busy, buffer in use */ 607 if (audio_status()) /* busy, buffer in use */
608 return -1; 608 return -1;
609#endif 609#endif
@@ -684,7 +684,7 @@ int talk_value(long n, int unit, bool enqueue)
684 VOICE_HERTZ, 684 VOICE_HERTZ,
685 }; 685 };
686 686
687#if CONFIG_HWCODEC != MASNONE 687#if CONFIG_CODEC != SWCODEC
688 if (audio_status()) /* busy, buffer in use */ 688 if (audio_status()) /* busy, buffer in use */
689 return -1; 689 return -1;
690#endif 690#endif
@@ -718,7 +718,7 @@ int talk_spell(const char* spell, bool enqueue)
718{ 718{
719 char c; /* currently processed char */ 719 char c; /* currently processed char */
720 720
721#if CONFIG_HWCODEC != MASNONE 721#if CONFIG_CODEC != SWCODEC
722 if (audio_status()) /* busy, buffer in use */ 722 if (audio_status()) /* busy, buffer in use */
723 return -1; 723 return -1;
724#endif 724#endif
diff --git a/apps/tree.c b/apps/tree.c
index 5e0d63435b..8746145154 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -71,7 +71,7 @@ const struct filetype filetypes[] = {
71 { ".mp3", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA }, 71 { ".mp3", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },
72 { ".mp2", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA }, 72 { ".mp2", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },
73 { ".mpa", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA }, 73 { ".mpa", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },
74#if CONFIG_HWCODEC == MASNONE 74#if CONFIG_CODEC == SWCODEC
75 /* Temporary hack to allow playlist creation */ 75 /* Temporary hack to allow playlist creation */
76 { ".mp1", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA }, 76 { ".mp1", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },
77 { ".ogg", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA }, 77 { ".ogg", TREE_ATTR_MPA, Icon_Audio, VOICE_EXT_MPA },
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 84f54e56a3..a1afa4daea 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -85,7 +85,7 @@ drivers/i2c-coldfire.c
85#else 85#else
86drivers/i2c.c 86drivers/i2c.c
87#endif 87#endif
88#if CONFIG_HWCODEC != MASNONE 88#if CONFIG_CODEC != SWCODEC
89drivers/mas.c 89drivers/mas.c
90#endif 90#endif
91#ifdef HAVE_RTC 91#ifdef HAVE_RTC
@@ -107,7 +107,7 @@ crt0.S
107#endif 107#endif
108mp3_playback.c 108mp3_playback.c
109mp3data.c 109mp3data.c
110#if CONFIG_HWCODEC != MASNONE 110#if CONFIG_CODEC != SWCODEC
111mpeg.c 111mpeg.c
112#endif 112#endif
113#ifndef WIN32 /* the win32 sim has its own versin of these: */ 113#ifndef WIN32 /* the win32 sim has its own versin of these: */
@@ -130,10 +130,10 @@ drivers/uda1380.c
130#elif defined(HAVE_TLV320) && !defined(SIMULATOR) 130#elif defined(HAVE_TLV320) && !defined(SIMULATOR)
131drivers/tlv320.c 131drivers/tlv320.c
132#endif 132#endif
133#if (CONFIG_HWCODEC == MASNONE) && !defined(SIMULATOR) 133#if (CONFIG_CODEC == SWCODEC) && !defined(SIMULATOR)
134pcm_playback.c 134pcm_playback.c
135#endif 135#endif
136#if CONFIG_HWCODEC == MASNONE 136#if CONFIG_CODEC == SWCODEC
137replaygain.c 137replaygain.c
138#endif 138#endif
139#if defined(CPU_COLDFIRE) && !defined(SIMULATOR) 139#if defined(CPU_COLDFIRE) && !defined(SIMULATOR)
diff --git a/firmware/drivers/mas.c b/firmware/drivers/mas.c
index 7c8b55c422..66ba6b6aff 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)
132 132
133 j = 0; 133 j = 0;
134 while(len--) { 134 while(len--) {
135#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 135#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
136 buf[i++] = 0; 136 buf[i++] = 0;
137 buf[i++] = ptr[j+1]; 137 buf[i++] = ptr[j+1];
138 buf[i++] = ptr[j+2]; 138 buf[i++] = ptr[j+2];
@@ -232,7 +232,7 @@ static int mas_devread(unsigned long *dest, int len)
232 if (i2c_getack()) { 232 if (i2c_getack()) {
233 for (i=0;len;i++) { 233 for (i=0;len;i++) {
234 len--; 234 len--;
235#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 235#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
236 i2c_inb(0); /* Dummy read */ 236 i2c_inb(0); /* Dummy read */
237 ptr[i*4+0] = 0; 237 ptr[i*4+0] = 0;
238 ptr[i*4+1] = i2c_inb(0) & 0x0f; 238 ptr[i*4+1] = i2c_inb(0) & 0x0f;
@@ -270,7 +270,7 @@ void mas_reset(void)
270{ 270{
271 or_b(0x01, &PAIORH); 271 or_b(0x01, &PAIORH);
272 272
273#if CONFIG_HWCODEC == MAS3507D 273#if CONFIG_CODEC == MAS3507D
274 /* PB5 is "MAS enable". make it GPIO output and high */ 274 /* PB5 is "MAS enable". make it GPIO output and high */
275 PBCR2 &= ~0x0c00; 275 PBCR2 &= ~0x0c00;
276 or_b(0x20, &PBIORL); 276 or_b(0x20, &PBIORL);
@@ -280,7 +280,7 @@ void mas_reset(void)
280 sleep(HZ/100); 280 sleep(HZ/100);
281 or_b(0x01, &PADRH); 281 or_b(0x01, &PADRH);
282 sleep(HZ/5); 282 sleep(HZ/5);
283#elif (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 283#elif (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
284 if(old_recorder) 284 if(old_recorder)
285 { 285 {
286 /* Older recorder models don't invert the POR signal */ 286 /* Older recorder models don't invert the POR signal */
@@ -299,7 +299,7 @@ void mas_reset(void)
299#endif 299#endif
300} 300}
301 301
302#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 302#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
303int mas_direct_config_read(unsigned char reg) 303int mas_direct_config_read(unsigned char reg)
304{ 304{
305 int ret = 0; 305 int ret = 0;
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h
index c53388984f..cf2e65addf 100644
--- a/firmware/export/config-fmrecorder.h
+++ b/firmware/export/config-fmrecorder.h
@@ -29,7 +29,7 @@
29#ifndef SIMULATOR 29#ifndef SIMULATOR
30 30
31/* Define this if you have a MAS3587F */ 31/* Define this if you have a MAS3587F */
32#define CONFIG_HWCODEC MAS3587F 32#define CONFIG_CODEC MAS3587F
33 33
34/* Define this if you have a SH7034 */ 34/* Define this if you have a SH7034 */
35#define CONFIG_CPU SH7034 35#define CONFIG_CPU SH7034
diff --git a/firmware/export/config-gmini120.h b/firmware/export/config-gmini120.h
index 18019464e3..c833435dea 100644
--- a/firmware/export/config-gmini120.h
+++ b/firmware/export/config-gmini120.h
@@ -38,7 +38,7 @@
38#define CONFIG_I2C I2C_GMINI 38#define CONFIG_I2C I2C_GMINI
39 39
40/* Define this if you do software codec */ 40/* Define this if you do software codec */
41#define CONFIG_HWCODEC MASNONE 41#define CONFIG_CODEC SWCODEC
42 42
43/* Type of mobile power, FIXME: probably different, make new type */ 43/* Type of mobile power, FIXME: probably different, make new type */
44#define CONFIG_BATTERY BATT_LIION2200 44#define CONFIG_BATTERY BATT_LIION2200
diff --git a/firmware/export/config-gminisp.h b/firmware/export/config-gminisp.h
index 2881471bc1..982e8f3725 100644
--- a/firmware/export/config-gminisp.h
+++ b/firmware/export/config-gminisp.h
@@ -32,7 +32,7 @@
32#define CONFIG_I2C I2C_GMINI 32#define CONFIG_I2C I2C_GMINI
33 33
34/* Define this if you do software codec */ 34/* Define this if you do software codec */
35#define CONFIG_HWCODEC MASNONE 35#define CONFIG_CODEC SWCODEC
36 36
37/* Type of mobile power, FIXME: probably different, make new type */ 37/* Type of mobile power, FIXME: probably different, make new type */
38#define CONFIG_BATTERY BATT_LIION2200 38#define CONFIG_BATTERY BATT_LIION2200
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index 1fd73c25d3..bdb1b1a163 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -31,7 +31,7 @@
31#define CONFIG_REMOTE_KEYPAD H100_REMOTE 31#define CONFIG_REMOTE_KEYPAD H100_REMOTE
32 32
33/* Define this if you do software codec */ 33/* Define this if you do software codec */
34#define CONFIG_HWCODEC MASNONE 34#define CONFIG_CODEC SWCODEC
35 35
36/* Define this if you have an remote lcd */ 36/* Define this if you have an remote lcd */
37#define HAVE_REMOTE_LCD 37#define HAVE_REMOTE_LCD
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h
index a1828efad2..2691a8a693 100644
--- a/firmware/export/config-h120.h
+++ b/firmware/export/config-h120.h
@@ -27,7 +27,7 @@
27#define CONFIG_REMOTE_KEYPAD H100_REMOTE 27#define CONFIG_REMOTE_KEYPAD H100_REMOTE
28 28
29/* Define this if you do software codec */ 29/* Define this if you do software codec */
30#define CONFIG_HWCODEC MASNONE 30#define CONFIG_CODEC SWCODEC
31 31
32/* Define this if you have an remote lcd */ 32/* Define this if you have an remote lcd */
33#define HAVE_REMOTE_LCD 33#define HAVE_REMOTE_LCD
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h
index 251b6912b3..df97fd245d 100644
--- a/firmware/export/config-h300.h
+++ b/firmware/export/config-h300.h
@@ -25,7 +25,7 @@
25#define CONFIG_REMOTE_KEYPAD H300_REMOTE 25#define CONFIG_REMOTE_KEYPAD H300_REMOTE
26 26
27/* Define this if you do software codec */ 27/* Define this if you do software codec */
28#define CONFIG_HWCODEC MASNONE 28#define CONFIG_CODEC SWCODEC
29 29
30/* Define this if you have an remote lcd */ 30/* Define this if you have an remote lcd */
31#define HAVE_REMOTE_LCD 31#define HAVE_REMOTE_LCD
diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h
index e2a170af66..f7d18c829e 100644
--- a/firmware/export/config-iaudiox5.h
+++ b/firmware/export/config-iaudiox5.h
@@ -24,7 +24,7 @@
24#define CONFIG_KEYPAD IAUDIO_X5_PAD 24#define CONFIG_KEYPAD IAUDIO_X5_PAD
25 25
26/* Define this if you do software codec */ 26/* Define this if you do software codec */
27#define CONFIG_HWCODEC MASNONE 27#define CONFIG_CODEC SWCODEC
28 28
29/* Define this if you have an remote lcd */ 29/* Define this if you have an remote lcd */
30#define HAVE_REMOTE_LCD 30#define HAVE_REMOTE_LCD
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h
index 1b2857668a..a384bae5b6 100644
--- a/firmware/export/config-ondiofm.h
+++ b/firmware/export/config-ondiofm.h
@@ -28,7 +28,7 @@
28#define CONFIG_CPU SH7034 28#define CONFIG_CPU SH7034
29 29
30/* Define this if you have a MAS3587F */ 30/* Define this if you have a MAS3587F */
31#define CONFIG_HWCODEC MAS3587F 31#define CONFIG_CODEC MAS3587F
32 32
33/* Define this to the CPU frequency */ 33/* Define this to the CPU frequency */
34#define CPU_FREQ 12000000 34#define CPU_FREQ 12000000
diff --git a/firmware/export/config-ondiosp.h b/firmware/export/config-ondiosp.h
index 7ccda3257b..f3ba51209b 100644
--- a/firmware/export/config-ondiosp.h
+++ b/firmware/export/config-ondiosp.h
@@ -21,7 +21,7 @@
21#define CONFIG_CPU SH7034 21#define CONFIG_CPU SH7034
22 22
23/* Define this if you have a MAS3539F */ 23/* Define this if you have a MAS3539F */
24#define CONFIG_HWCODEC MAS3539F 24#define CONFIG_CODEC MAS3539F
25 25
26/* Define this to the CPU frequency */ 26/* Define this to the CPU frequency */
27#define CPU_FREQ 12000000 27#define CPU_FREQ 12000000
diff --git a/firmware/export/config-player.h b/firmware/export/config-player.h
index 70858a1636..c2dd7572b7 100644
--- a/firmware/export/config-player.h
+++ b/firmware/export/config-player.h
@@ -20,7 +20,7 @@
20#define CONFIG_CPU SH7034 20#define CONFIG_CPU SH7034
21 21
22/* Define this if you have a MAS3507D */ 22/* Define this if you have a MAS3507D */
23#define CONFIG_HWCODEC MAS3507D 23#define CONFIG_CODEC MAS3507D
24 24
25/* Define this if you have a DAC3550A */ 25/* Define this if you have a DAC3550A */
26#define HAVE_DAC3550A 26#define HAVE_DAC3550A
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h
index 51cdb79321..4df6fbfc6d 100644
--- a/firmware/export/config-recorder.h
+++ b/firmware/export/config-recorder.h
@@ -23,7 +23,7 @@
23#ifndef SIMULATOR 23#ifndef SIMULATOR
24 24
25/* Define this if you have a MAS3587F */ 25/* Define this if you have a MAS3587F */
26#define CONFIG_HWCODEC MAS3587F 26#define CONFIG_CODEC MAS3587F
27 27
28/* Define this if you have a SH7034 */ 28/* Define this if you have a SH7034 */
29#define CONFIG_CPU SH7034 29#define CONFIG_CPU SH7034
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h
index b2d6d01669..da0bb41f80 100644
--- a/firmware/export/config-recorderv2.h
+++ b/firmware/export/config-recorderv2.h
@@ -29,7 +29,7 @@
29#define CONFIG_CPU SH7034 29#define CONFIG_CPU SH7034
30 30
31/* Define this if you have a MAS3587F */ 31/* Define this if you have a MAS3587F */
32#define CONFIG_HWCODEC MAS3587F 32#define CONFIG_CODEC MAS3587F
33 33
34/* Define this if you have a FM Recorder key system */ 34/* Define this if you have a FM Recorder key system */
35#define HAVE_FMADC 1 35#define HAVE_FMADC 1
diff --git a/firmware/export/config.h b/firmware/export/config.h
index 1463656d03..bd817dcb2f 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -28,11 +28,11 @@
28#define S1A0903X01 0x01 /* Samsung */ 28#define S1A0903X01 0x01 /* Samsung */
29#define TEA5767 0x02 /* Philips */ 29#define TEA5767 0x02 /* Philips */
30 30
31/* CONFIG_HWCODEC */ 31/* CONFIG_CODEC */
32#define MAS3587F 3587 32#define MAS3587F 3587
33#define MAS3507D 3507 33#define MAS3507D 3507
34#define MAS3539F 3539 34#define MAS3539F 3539
35#define MASNONE 1 /* if codec is done by SW */ 35#define SWCODEC 1 /* if codec is done by SW */
36 36
37/* CONFIG_CPU */ 37/* CONFIG_CPU */
38#define SH7034 7034 38#define SH7034 7034
diff --git a/firmware/export/id3.h b/firmware/export/id3.h
index abb354b233..5deebd41de 100644
--- a/firmware/export/id3.h
+++ b/firmware/export/id3.h
@@ -28,14 +28,14 @@
28enum { 28enum {
29 AFMT_UNKNOWN = 1, /* Unknown file format */ 29 AFMT_UNKNOWN = 1, /* Unknown file format */
30 30
31#if CONFIG_HWCODEC==MASNONE 31#if CONFIG_CODEC==SWCODEC
32 AFMT_MPA_L1, /* MPEG Audio layer 1 */ 32 AFMT_MPA_L1, /* MPEG Audio layer 1 */
33#endif 33#endif
34 34
35 AFMT_MPA_L2, /* MPEG Audio layer 2 */ 35 AFMT_MPA_L2, /* MPEG Audio layer 2 */
36 AFMT_MPA_L3, /* MPEG Audio layer 3 */ 36 AFMT_MPA_L3, /* MPEG Audio layer 3 */
37 37
38#if CONFIG_HWCODEC==MASNONE 38#if CONFIG_CODEC==SWCODEC
39 AFMT_PCM_WAV, /* Uncompressed PCM in a WAV file */ 39 AFMT_PCM_WAV, /* Uncompressed PCM in a WAV file */
40 AFMT_OGG_VORBIS, /* Ogg Vorbis */ 40 AFMT_OGG_VORBIS, /* Ogg Vorbis */
41 AFMT_FLAC, /* FLAC */ 41 AFMT_FLAC, /* FLAC */
@@ -118,7 +118,7 @@ struct mp3entry {
118 118
119 /* replaygain support */ 119 /* replaygain support */
120 120
121#if CONFIG_HWCODEC == MASNONE 121#if CONFIG_CODEC == SWCODEC
122 char* track_gain_string; 122 char* track_gain_string;
123 char* album_gain_string; 123 char* album_gain_string;
124 long track_gain; /* 7.24 signed fixed point. 0 for no gain. */ 124 long track_gain; /* 7.24 signed fixed point. 0 for no gain. */
diff --git a/firmware/export/mas.h b/firmware/export/mas.h
index f682fc676e..d25a1538ca 100644
--- a/firmware/export/mas.h
+++ b/firmware/export/mas.h
@@ -27,7 +27,7 @@
27/* 27/*
28 MAS I2C defs 28 MAS I2C defs
29*/ 29*/
30#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 30#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
31#define MAS_ADR 0x3c 31#define MAS_ADR 0x3c
32#define MAS_DEV_WRITE (MAS_ADR | 0x00) 32#define MAS_DEV_WRITE (MAS_ADR | 0x00)
33#define MAS_DEV_READ (MAS_ADR | 0x01) 33#define MAS_DEV_READ (MAS_ADR | 0x01)
@@ -38,7 +38,7 @@
38#endif 38#endif
39 39
40/* registers..*/ 40/* registers..*/
41#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 41#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
42#define MAS_DATA_WRITE 0x68 42#define MAS_DATA_WRITE 0x68
43#define MAS_DATA_READ 0x69 43#define MAS_DATA_READ 0x69
44#define MAS_CODEC_WRITE 0x6c 44#define MAS_CODEC_WRITE 0x6c
@@ -62,7 +62,7 @@
62#define MAS_REG_KPRESCALE 0xe7 62#define MAS_REG_KPRESCALE 0xe7
63#define MAS_REG_KBASS 0x6b 63#define MAS_REG_KBASS 0x6b
64#define MAS_REG_KTREBLE 0x6f 64#define MAS_REG_KTREBLE 0x6f
65#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 65#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
66#define MAS_REG_KMDB_SWITCH 0x21 66#define MAS_REG_KMDB_SWITCH 0x21
67#define MAS_REG_KMDB_STR 0x22 67#define MAS_REG_KMDB_STR 0x22
68#define MAS_REG_KMDB_HAR 0x23 68#define MAS_REG_KMDB_HAR 0x23
@@ -78,7 +78,7 @@
78/* 78/*
79 * MAS commands 79 * MAS commands
80 */ 80 */
81#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 81#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
82#define MAS_CMD_READ_ANCILLARY 0x50 82#define MAS_CMD_READ_ANCILLARY 0x50
83#define MAS_CMD_FAST_PRG_DL 0x60 83#define MAS_CMD_FAST_PRG_DL 0x60
84#define MAS_CMD_READ_IC_VER 0x70 84#define MAS_CMD_READ_IC_VER 0x70
@@ -101,7 +101,7 @@
101/* 101/*
102 * MAS D0 memory cells (MAS3587F / MAS3539F) 102 * MAS D0 memory cells (MAS3587F / MAS3539F)
103 */ 103 */
104#if CONFIG_HWCODEC == MAS3587F 104#if CONFIG_CODEC == MAS3587F
105#define MAS_D0_APP_SELECT 0x7f6 105#define MAS_D0_APP_SELECT 0x7f6
106#define MAS_D0_APP_RUNNING 0x7f7 106#define MAS_D0_APP_RUNNING 0x7f7
107#define MAS_D0_ENCODER_CONTROL 0x7f0 107#define MAS_D0_ENCODER_CONTROL 0x7f0
@@ -120,7 +120,7 @@
120#define MAS_D0_MPEG_STATUS_2 0xfd2 120#define MAS_D0_MPEG_STATUS_2 0xfd2
121#define MAS_D0_CRC_ERROR_COUNT 0xfd3 121#define MAS_D0_CRC_ERROR_COUNT 0xfd3
122 122
123#elif CONFIG_HWCODEC == MAS3539F 123#elif CONFIG_CODEC == MAS3539F
124#define MAS_D0_APP_SELECT 0x34b 124#define MAS_D0_APP_SELECT 0x34b
125#define MAS_D0_APP_RUNNING 0x34c 125#define MAS_D0_APP_RUNNING 0x34c
126/* no encoder :( */ 126/* no encoder :( */
diff --git a/firmware/export/mp3_playback.h b/firmware/export/mp3_playback.h
index 3611c1c9c1..772eafe971 100644
--- a/firmware/export/mp3_playback.h
+++ b/firmware/export/mp3_playback.h
@@ -32,7 +32,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
32 bool superbass); 32 bool superbass);
33 33
34/* exported just for mpeg.c, to keep the recording there */ 34/* exported just for mpeg.c, to keep the recording there */
35#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 35#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
36void demand_irq_enable(bool on); 36void demand_irq_enable(bool on);
37#endif 37#endif
38 38
diff --git a/firmware/export/mpeg.h b/firmware/export/mpeg.h
index d8dea3d143..6ce3b47275 100644
--- a/firmware/export/mpeg.h
+++ b/firmware/export/mpeg.h
@@ -43,7 +43,7 @@
43/* For ID3 info and VBR header */ 43/* For ID3 info and VBR header */
44#define MPEG_RESERVED_HEADER_SPACE (4096 + 1500) 44#define MPEG_RESERVED_HEADER_SPACE (4096 + 1500)
45 45
46#if (CONFIG_HWCODEC == MAS3587F) || defined(SIMULATOR) 46#if (CONFIG_CODEC == MAS3587F) || defined(SIMULATOR)
47void mpeg_init_recording(void); 47void mpeg_init_recording(void);
48void mpeg_record(const char *filename); 48void mpeg_record(const char *filename);
49void mpeg_new_file(const char *filename); 49void mpeg_new_file(const char *filename);
diff --git a/firmware/export/sound.h b/firmware/export/sound.h
index 9f4cd60ae8..772e2d6655 100644
--- a/firmware/export/sound.h
+++ b/firmware/export/sound.h
@@ -54,7 +54,7 @@ int sound_val2phys(int setting, int value);
54const char *sound_unit(int setting); 54const char *sound_unit(int setting);
55int sound_numdecimals(int setting); 55int sound_numdecimals(int setting);
56int sound_steps(int setting); 56int sound_steps(int setting);
57#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) || defined(SIMULATOR) 57#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) || defined(SIMULATOR)
58void sound_set_pitch(int permille); 58void sound_set_pitch(int permille);
59int sound_get_pitch(void); 59int sound_get_pitch(void);
60#endif 60#endif
diff --git a/firmware/id3.c b/firmware/id3.c
index 90500663c1..8685d86790 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -83,14 +83,14 @@ static const char* const codec_labels[] = {
83 "ERR", /* Invalid codec type */ 83 "ERR", /* Invalid codec type */
84 "???", /* Unknown file format */ 84 "???", /* Unknown file format */
85 85
86#if CONFIG_HWCODEC==MASNONE 86#if CONFIG_CODEC==SWCODEC
87 "MP1", /* MPEG Audio layer 1 */ 87 "MP1", /* MPEG Audio layer 1 */
88#endif 88#endif
89 89
90 "MP2", /* MPEG Audio layer 2 */ 90 "MP2", /* MPEG Audio layer 2 */
91 "MP3", /* MPEG Audio layer 3 */ 91 "MP3", /* MPEG Audio layer 3 */
92 92
93#if CONFIG_HWCODEC==MASNONE 93#if CONFIG_CODEC==SWCODEC
94 "WAV", /* Uncompressed PCM in a WAV file */ 94 "WAV", /* Uncompressed PCM in a WAV file */
95 "OGG", /* Ogg Vorbis */ 95 "OGG", /* Ogg Vorbis */
96 "FLAC", /* FLAC */ 96 "FLAC", /* FLAC */
@@ -310,7 +310,7 @@ static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos )
310 } 310 }
311} 311}
312 312
313#if CONFIG_HWCODEC == MASNONE 313#if CONFIG_CODEC == SWCODEC
314/* parse user defined text, looking for replaygain information. */ 314/* parse user defined text, looking for replaygain information. */
315static int parseuser( struct mp3entry* entry, char* tag, int bufferpos ) 315static int parseuser( struct mp3entry* entry, char* tag, int bufferpos )
316{ 316{
@@ -352,7 +352,7 @@ static const struct tag_resolver taglist[] = {
352 { "TCOM", 4, offsetof(struct mp3entry, composer), NULL }, 352 { "TCOM", 4, offsetof(struct mp3entry, composer), NULL },
353 { "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre }, 353 { "TCON", 4, offsetof(struct mp3entry, genre_string), &parsegenre },
354 { "TCO", 3, offsetof(struct mp3entry, genre_string), &parsegenre }, 354 { "TCO", 3, offsetof(struct mp3entry, genre_string), &parsegenre },
355#if CONFIG_HWCODEC == MASNONE 355#if CONFIG_CODEC == SWCODEC
356 { "TXXX", 4, 0, &parseuser }, 356 { "TXXX", 4, 0, &parseuser },
357#endif 357#endif
358}; 358};
@@ -885,7 +885,7 @@ static int getsonglength(int fd, struct mp3entry *entry)
885 entry->version = info.version; 885 entry->version = info.version;
886 entry->layer = info.layer; 886 entry->layer = info.layer;
887 switch(entry->layer) { 887 switch(entry->layer) {
888#if CONFIG_HWCODEC==MASNONE 888#if CONFIG_CODEC==SWCODEC
889 case 0: 889 case 0:
890 entry->codectype=AFMT_MPA_L1; 890 entry->codectype=AFMT_MPA_L1;
891 break; 891 break;
@@ -947,7 +947,7 @@ bool mp3info(struct mp3entry *entry, const char *filename, bool v1first)
947 if(-1 == fd) 947 if(-1 == fd)
948 return true; 948 return true;
949 949
950#if CONFIG_HWCODEC != MASNONE 950#if CONFIG_CODEC != SWCODEC
951 memset(entry, 0, sizeof(struct mp3entry)); 951 memset(entry, 0, sizeof(struct mp3entry));
952#endif 952#endif
953 953
diff --git a/firmware/mp3_playback.c b/firmware/mp3_playback.c
index 3a2fdb4f1a..b7114007b9 100644
--- a/firmware/mp3_playback.c
+++ b/firmware/mp3_playback.c
@@ -36,7 +36,7 @@
36#endif 36#endif
37 37
38/* hacking into mpeg.c, recording is still there */ 38/* hacking into mpeg.c, recording is still there */
39#if CONFIG_HWCODEC == MAS3587F 39#if CONFIG_CODEC == MAS3587F
40enum 40enum
41{ 41{
42 MPEG_DECODER, 42 MPEG_DECODER,
@@ -44,7 +44,7 @@ enum
44} mpeg_mode; 44} mpeg_mode;
45#endif /* #ifdef MAS3587F */ 45#endif /* #ifdef MAS3587F */
46 46
47#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 47#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
48extern unsigned long shadow_io_control_main; 48extern unsigned long shadow_io_control_main;
49extern unsigned shadow_codec_reg0; 49extern unsigned shadow_codec_reg0;
50#endif 50#endif
@@ -72,14 +72,14 @@ static void (*callback_for_more)(unsigned char**, int*);
72bool audio_is_initialized = false; 72bool audio_is_initialized = false;
73#endif 73#endif
74 74
75#if CONFIG_HWCODEC != MASNONE 75#if CONFIG_CODEC != SWCODEC
76/* FIX: this code pretty much assumes a MAS */ 76/* FIX: this code pretty much assumes a MAS */
77 77
78#ifndef SIMULATOR 78#ifndef SIMULATOR
79 79
80unsigned long mas_version_code; 80unsigned long mas_version_code;
81 81
82#if CONFIG_HWCODEC == MAS3507D 82#if CONFIG_CODEC == MAS3507D
83static void mas_poll_start(void) 83static void mas_poll_start(void)
84{ 84{
85 unsigned int count; 85 unsigned int count;
@@ -104,7 +104,7 @@ static void mas_poll_start(void)
104 104
105 TSTR |= 0x02; /* Start timer 1 */ 105 TSTR |= 0x02; /* Start timer 1 */
106} 106}
107#elif CONFIG_HWCODEC != MASNONE 107#elif CONFIG_CODEC != SWCODEC
108static void postpone_dma_tick(void) 108static void postpone_dma_tick(void)
109{ 109{
110 unsigned int count; 110 unsigned int count;
@@ -132,7 +132,7 @@ static void postpone_dma_tick(void)
132#endif 132#endif
133 133
134 134
135#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 135#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
136void demand_irq_enable(bool on) 136void demand_irq_enable(bool on)
137{ 137{
138 int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL); 138 int oldlevel = set_irq_level(HIGHEST_IRQ_LEVEL);
@@ -147,7 +147,7 @@ void demand_irq_enable(bool on)
147 147
148 set_irq_level(oldlevel); 148 set_irq_level(oldlevel);
149} 149}
150#endif /* #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ 150#endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
151 151
152 152
153void play_tick(void) 153void play_tick(void)
@@ -194,7 +194,7 @@ void IMIA1(void) /* Timer 1 interrupt */
194 if(playing) 194 if(playing)
195 play_tick(); 195 play_tick();
196 TSR1 &= ~0x01; 196 TSR1 &= ~0x01;
197#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 197#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
198 /* Disable interrupt */ 198 /* Disable interrupt */
199 IPRC &= ~0x000f; 199 IPRC &= ~0x000f;
200#endif 200#endif
@@ -206,21 +206,21 @@ void IRQ6(void) /* PB14: MAS stop demand IRQ */
206 SCR0 &= ~0x80; 206 SCR0 &= ~0x80;
207} 207}
208 208
209#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 209#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
210#pragma interrupt 210#pragma interrupt
211void IRQ3(void) /* PA15: MAS demand IRQ */ 211void IRQ3(void) /* PA15: MAS demand IRQ */
212{ 212{
213 /* Begin with setting the IRQ to edge sensitive */ 213 /* Begin with setting the IRQ to edge sensitive */
214 ICR |= 0x0010; 214 ICR |= 0x0010;
215 215
216#if CONFIG_HWCODEC == MAS3587F 216#if CONFIG_CODEC == MAS3587F
217 if(mpeg_mode == MPEG_ENCODER) 217 if(mpeg_mode == MPEG_ENCODER)
218 rec_tick(); 218 rec_tick();
219 else 219 else
220#endif 220#endif
221 postpone_dma_tick(); 221 postpone_dma_tick();
222} 222}
223#endif /* #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ 223#endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
224 224
225static void setup_sci0(void) 225static void setup_sci0(void)
226{ 226{
@@ -260,7 +260,7 @@ static void setup_sci0(void)
260} 260}
261#endif /* SIMULATOR */ 261#endif /* SIMULATOR */
262 262
263#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 263#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
264static void init_playback(void) 264static void init_playback(void)
265{ 265{
266 unsigned long val; 266 unsigned long val;
@@ -310,7 +310,7 @@ static void init_playback(void)
310 mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1); 310 mas_readmem(MAS_BANK_D0, MAS_D0_APP_RUNNING, &val, 1);
311 } while((val & 0x0c) != 0x0c); 311 } while((val & 0x0c) != 0x0c);
312 312
313#if CONFIG_HWCODEC == MAS3587F 313#if CONFIG_CODEC == MAS3587F
314 mpeg_mode = MPEG_DECODER; 314 mpeg_mode = MPEG_DECODER;
315#endif 315#endif
316 316
@@ -322,7 +322,7 @@ static void init_playback(void)
322 322
323 DEBUGF("MAS Decoding application started\n"); 323 DEBUGF("MAS Decoding application started\n");
324} 324}
325#endif /* #if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ 325#endif /* #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
326 326
327void mp3_init(int volume, int bass, int treble, int balance, int loudness, 327void mp3_init(int volume, int bass, int treble, int balance, int loudness,
328 int avc, int channel_config, int stereo_width, 328 int avc, int channel_config, int stereo_width,
@@ -346,7 +346,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
346 (void)mdb_enable; 346 (void)mdb_enable;
347 (void)superbass; 347 (void)superbass;
348#else 348#else
349#if CONFIG_HWCODEC == MAS3507D 349#if CONFIG_CODEC == MAS3507D
350 unsigned long val; 350 unsigned long val;
351 (void)loudness; 351 (void)loudness;
352 (void)avc; 352 (void)avc;
@@ -365,9 +365,9 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
365 or_b(0x01, &PBIORH); /* output for PB8 */ 365 or_b(0x01, &PBIORH); /* output for PB8 */
366#endif 366#endif
367 367
368#if CONFIG_HWCODEC == MAS3507D 368#if CONFIG_CODEC == MAS3507D
369 mas_reset(); 369 mas_reset();
370#elif CONFIG_HWCODEC == MAS3587F 370#elif CONFIG_CODEC == MAS3587F
371 or_b(0x08, &PAIORH); /* output for /PR */ 371 or_b(0x08, &PAIORH); /* output for /PR */
372 init_playback(); 372 init_playback();
373 373
@@ -375,7 +375,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
375 DEBUGF("MAS3587 derivate %d, version %c%d\n", 375 DEBUGF("MAS3587 derivate %d, version %c%d\n",
376 (mas_version_code & 0xf000) >> 12, 376 (mas_version_code & 0xf000) >> 12,
377 'A' + ((mas_version_code & 0x0f00) >> 8), mas_version_code & 0xff); 377 'A' + ((mas_version_code & 0x0f00) >> 8), mas_version_code & 0xff);
378#elif CONFIG_HWCODEC == MAS3539F 378#elif CONFIG_CODEC == MAS3539F
379 or_b(0x08, &PAIORH); /* output for /PR */ 379 or_b(0x08, &PAIORH); /* output for /PR */
380 init_playback(); 380 init_playback();
381 381
@@ -389,7 +389,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
389 dac_init(); 389 dac_init();
390#endif 390#endif
391 391
392#if CONFIG_HWCODEC == MAS3507D 392#if CONFIG_CODEC == MAS3507D
393 /* set IRQ6 to edge detect */ 393 /* set IRQ6 to edge detect */
394 ICR |= 0x02; 394 ICR |= 0x02;
395 395
@@ -430,14 +430,14 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
430 430
431#endif 431#endif
432 432
433#if CONFIG_HWCODEC == MAS3507D 433#if CONFIG_CODEC == MAS3507D
434 mas_poll_start(); 434 mas_poll_start();
435 435
436 mas_writereg(MAS_REG_KPRESCALE, 0xe9400); 436 mas_writereg(MAS_REG_KPRESCALE, 0xe9400);
437 dac_enable(true); 437 dac_enable(true);
438#endif 438#endif
439 439
440#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 440#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
441 ICR &= ~0x0010; /* IRQ3 level sensitive */ 441 ICR &= ~0x0010; /* IRQ3 level sensitive */
442 PACR1 = (PACR1 & 0x3fff) | 0x4000; /* PA15 is IRQ3 */ 442 PACR1 = (PACR1 & 0x3fff) | 0x4000; /* PA15 is IRQ3 */
443#endif 443#endif
@@ -452,7 +452,7 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
452 sound_set(SOUND_CHANNELS, channel_config); 452 sound_set(SOUND_CHANNELS, channel_config);
453 sound_set(SOUND_STEREO_WIDTH, stereo_width); 453 sound_set(SOUND_STEREO_WIDTH, stereo_width);
454 454
455#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 455#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
456 sound_set(SOUND_LOUDNESS, loudness); 456 sound_set(SOUND_LOUDNESS, loudness);
457 sound_set(SOUND_AVC, avc); 457 sound_set(SOUND_AVC, avc);
458 sound_set(SOUND_MDB_STRENGTH, mdb_strength); 458 sound_set(SOUND_MDB_STRENGTH, mdb_strength);
@@ -471,12 +471,12 @@ void mp3_init(int volume, int bass, int treble, int balance, int loudness,
471void mp3_shutdown(void) 471void mp3_shutdown(void)
472{ 472{
473#ifndef SIMULATOR 473#ifndef SIMULATOR
474#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 474#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
475 unsigned long val = 1; 475 unsigned long val = 1;
476 mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &val, 1); /* Mute */ 476 mas_writemem(MAS_BANK_D0, MAS_D0_SOFT_MUTE, &val, 1); /* Mute */
477#endif 477#endif
478 478
479#if CONFIG_HWCODEC == MAS3507D 479#if CONFIG_CODEC == MAS3507D
480 dac_volume(0, 0, false); 480 dac_volume(0, 0, false);
481#endif 481#endif
482 482
@@ -489,7 +489,7 @@ void mp3_shutdown(void)
489 489
490void mp3_play_init(void) 490void mp3_play_init(void)
491{ 491{
492#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 492#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
493 init_playback(); 493 init_playback();
494#endif 494#endif
495 playing = false; 495 playing = false;
@@ -518,7 +518,7 @@ void mp3_play_data(const unsigned char* start, int size,
518 518
519 CHCR3 |= 0x0001; /* Enable DMA IRQ */ 519 CHCR3 |= 0x0001; /* Enable DMA IRQ */
520 520
521#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 521#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
522 demand_irq_enable(true); 522 demand_irq_enable(true);
523#endif 523#endif
524} 524}
@@ -557,7 +557,7 @@ void mp3_play_stop(void)
557 playing = false; 557 playing = false;
558 mp3_play_pause(false); 558 mp3_play_pause(false);
559 CHCR3 &= ~0x0001; /* Disable the DMA interrupt */ 559 CHCR3 &= ~0x0001; /* Disable the DMA interrupt */
560#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 560#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
561 demand_irq_enable(false); 561 demand_irq_enable(false);
562#endif 562#endif
563} 563}
@@ -591,7 +591,7 @@ unsigned char* mp3_get_pos(void)
591 591
592#endif /* #ifndef SIMULATOR */ 592#endif /* #ifndef SIMULATOR */
593 593
594#else /* CONFIG_HWCODEC != MASNONE */ 594#else /* CONFIG_CODEC != SWCODEC */
595void mp3_init(int volume, int bass, int treble, int balance, int loudness, 595void mp3_init(int volume, int bass, int treble, int balance, int loudness,
596 int avc, int channel_config, int stereo_width, 596 int avc, int channel_config, int stereo_width,
597 int mdb_strength, int mdb_harmonics, 597 int mdb_strength, int mdb_harmonics,
@@ -651,4 +651,4 @@ bool mp3_is_playing(void)
651 return playing; 651 return playing;
652} 652}
653 653
654#endif /* CONFIG_HWCODEC == MASNONE */ 654#endif /* CONFIG_CODEC == SWCODEC */
diff --git a/firmware/mp3data.c b/firmware/mp3data.c
index bca8560188..44c298a463 100644
--- a/firmware/mp3data.c
+++ b/firmware/mp3data.c
@@ -100,7 +100,7 @@ static bool is_mp3frameheader(unsigned long head)
100 return false; 100 return false;
101 if (!(head & LAYER_MASK)) /* no layer? */ 101 if (!(head & LAYER_MASK)) /* no layer? */
102 return false; 102 return false;
103#if CONFIG_HWCODEC != MASNONE 103#if CONFIG_CODEC != SWCODEC
104 /* The MAS can't decode layer 1, so treat layer 1 data as invalid */ 104 /* The MAS can't decode layer 1, so treat layer 1 data as invalid */
105 if ((head & LAYER_MASK) == LAYER_MASK) 105 if ((head & LAYER_MASK) == LAYER_MASK)
106 return false; 106 return false;
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 721a4acbcc..394d6983b6 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -20,7 +20,7 @@
20#include <stdlib.h> 20#include <stdlib.h>
21#include "config.h" 21#include "config.h"
22 22
23#if CONFIG_HWCODEC != MASNONE 23#if CONFIG_CODEC != SWCODEC
24 24
25#include "debug.h" 25#include "debug.h"
26#include "panic.h" 26#include "panic.h"
@@ -51,13 +51,13 @@
51extern unsigned long mas_version_code; 51extern unsigned long mas_version_code;
52#endif 52#endif
53 53
54#if CONFIG_HWCODEC == MAS3587F 54#if CONFIG_CODEC == MAS3587F
55extern enum /* from mp3_playback.c */ 55extern enum /* from mp3_playback.c */
56{ 56{
57 MPEG_DECODER, 57 MPEG_DECODER,
58 MPEG_ENCODER 58 MPEG_ENCODER
59} mpeg_mode; 59} mpeg_mode;
60#endif /* CONFIG_HWCODEC == MAS3587F */ 60#endif /* CONFIG_CODEC == MAS3587F */
61 61
62extern char* playlist_peek(int steps); 62extern char* playlist_peek(int steps);
63extern bool playlist_check(int steps); 63extern bool playlist_check(int steps);
@@ -151,7 +151,7 @@ static long low_watermark; /* Dynamic low watermark level */
151static long low_watermark_margin; /* Extra time in seconds for watermark */ 151static long low_watermark_margin; /* Extra time in seconds for watermark */
152static long lowest_watermark_level; /* Debug value to observe the buffer 152static long lowest_watermark_level; /* Debug value to observe the buffer
153 usage */ 153 usage */
154#if CONFIG_HWCODEC == MAS3587F 154#if CONFIG_CODEC == MAS3587F
155static char recording_filename[MAX_PATH]; /* argument to thread */ 155static char recording_filename[MAX_PATH]; /* argument to thread */
156static char delayed_filename[MAX_PATH]; /* internal copy of above */ 156static char delayed_filename[MAX_PATH]; /* internal copy of above */
157 157
@@ -189,13 +189,13 @@ static unsigned long num_recorded_frames;
189 189
190/* Shadow MAS registers */ 190/* Shadow MAS registers */
191unsigned long shadow_encoder_control = 0; 191unsigned long shadow_encoder_control = 0;
192#endif /* CONFIG_HWCODEC == MAS3587F */ 192#endif /* CONFIG_CODEC == MAS3587F */
193 193
194#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 194#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
195unsigned long shadow_io_control_main = 0; 195unsigned long shadow_io_control_main = 0;
196unsigned long shadow_soft_mute = 0; 196unsigned long shadow_soft_mute = 0;
197unsigned shadow_codec_reg0; 197unsigned shadow_codec_reg0;
198#endif /* (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ 198#endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
199 199
200#ifdef HAVE_RECORDING 200#ifdef HAVE_RECORDING
201const unsigned char empty_id3_header[] = 201const unsigned char empty_id3_header[] =
@@ -211,7 +211,7 @@ static int get_playable_space(void);
211static int get_unswapped_space(void); 211static int get_unswapped_space(void);
212#endif /* !SIMULATOR */ 212#endif /* !SIMULATOR */
213 213
214#if CONFIG_HWCODEC == MAS3587F 214#if CONFIG_CODEC == MAS3587F
215static void init_recording(void); 215static void init_recording(void);
216static void start_prerecording(void); 216static void start_prerecording(void);
217static void start_recording(void); 217static void start_recording(void);
@@ -219,7 +219,7 @@ static void stop_recording(void);
219static int get_unsaved_space(void); 219static int get_unsaved_space(void);
220static void pause_recording(void); 220static void pause_recording(void);
221static void resume_recording(void); 221static void resume_recording(void);
222#endif /* CONFIG_HWCODEC == MAS3587F */ 222#endif /* CONFIG_CODEC == MAS3587F */
223 223
224 224
225#ifndef SIMULATOR 225#ifndef SIMULATOR
@@ -661,7 +661,7 @@ static int get_unswapped_space(void)
661 return space; 661 return space;
662} 662}
663 663
664#if CONFIG_HWCODEC == MAS3587F 664#if CONFIG_CODEC == MAS3587F
665static int get_unsaved_space(void) 665static int get_unsaved_space(void)
666{ 666{
667 int space = audiobuf_write - audiobuf_read; 667 int space = audiobuf_write - audiobuf_read;
@@ -772,7 +772,7 @@ void rec_tick(void)
772 } 772 }
773 } 773 }
774} 774}
775#endif /* CONFIG_HWCODEC == MAS3587F */ 775#endif /* CONFIG_CODEC == MAS3587F */
776 776
777void playback_tick(void) 777void playback_tick(void)
778{ 778{
@@ -1029,10 +1029,10 @@ static void track_change(void)
1029{ 1029{
1030 DEBUGF("Track change\n"); 1030 DEBUGF("Track change\n");
1031 1031
1032#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 1032#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
1033 /* Reset the AVC */ 1033 /* Reset the AVC */
1034 sound_set(SOUND_AVC, -1); 1034 sound_set(SOUND_AVC, -1);
1035#endif /* (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) */ 1035#endif /* (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) */
1036 1036
1037 if (num_tracks_in_memory() > 0) 1037 if (num_tracks_in_memory() > 0)
1038 { 1038 {
@@ -1157,14 +1157,14 @@ static void mpeg_thread(void)
1157 int amount_to_read; 1157 int amount_to_read;
1158 int t1, t2; 1158 int t1, t2;
1159 int start_offset; 1159 int start_offset;
1160#if CONFIG_HWCODEC == MAS3587F 1160#if CONFIG_CODEC == MAS3587F
1161 int amount_to_save; 1161 int amount_to_save;
1162 int framelen; 1162 int framelen;
1163 unsigned long saved_header = 0; 1163 unsigned long saved_header = 0;
1164 int save_endpos = 0; 1164 int save_endpos = 0;
1165 int rc; 1165 int rc;
1166 long offset; 1166 long offset;
1167#endif /* CONFIG_HWCODEC == MAS3587F */ 1167#endif /* CONFIG_CODEC == MAS3587F */
1168 1168
1169 is_playing = false; 1169 is_playing = false;
1170 play_pending = false; 1170 play_pending = false;
@@ -1173,10 +1173,10 @@ static void mpeg_thread(void)
1173 1173
1174 while(1) 1174 while(1)
1175 { 1175 {
1176#if CONFIG_HWCODEC == MAS3587F 1176#if CONFIG_CODEC == MAS3587F
1177 if(mpeg_mode == MPEG_DECODER) 1177 if(mpeg_mode == MPEG_DECODER)
1178 { 1178 {
1179#endif /* CONFIG_HWCODEC == MAS3587F */ 1179#endif /* CONFIG_CODEC == MAS3587F */
1180 yield(); 1180 yield();
1181 1181
1182 /* Swap if necessary, and don't block on the queue_wait() */ 1182 /* Swap if necessary, and don't block on the queue_wait() */
@@ -1724,19 +1724,19 @@ static void mpeg_thread(void)
1724 break; 1724 break;
1725#endif /* !USB_NONE */ 1725#endif /* !USB_NONE */
1726 1726
1727#if CONFIG_HWCODEC == MAS3587F 1727#if CONFIG_CODEC == MAS3587F
1728 case MPEG_INIT_RECORDING: 1728 case MPEG_INIT_RECORDING:
1729 init_recording(); 1729 init_recording();
1730 init_recording_done = true; 1730 init_recording_done = true;
1731 break; 1731 break;
1732#endif /* CONFIG_HWCODEC == MAS3587F */ 1732#endif /* CONFIG_CODEC == MAS3587F */
1733 1733
1734 case SYS_TIMEOUT: 1734 case SYS_TIMEOUT:
1735 if (playing) 1735 if (playing)
1736 playlist_update_resume_info(audio_current_track()); 1736 playlist_update_resume_info(audio_current_track());
1737 break; 1737 break;
1738 } 1738 }
1739#if CONFIG_HWCODEC == MAS3587F 1739#if CONFIG_CODEC == MAS3587F
1740 } 1740 }
1741 else 1741 else
1742 { 1742 {
@@ -2069,7 +2069,7 @@ static void mpeg_thread(void)
2069 break; 2069 break;
2070 } 2070 }
2071 } 2071 }
2072#endif /* CONFIG_HWCODEC == MAS3587F */ 2072#endif /* CONFIG_CODEC == MAS3587F */
2073 } 2073 }
2074} 2074}
2075#endif /* !SIMULATOR */ 2075#endif /* !SIMULATOR */
@@ -2113,7 +2113,7 @@ bool audio_has_changed_track(void)
2113 return false; 2113 return false;
2114} 2114}
2115 2115
2116#if CONFIG_HWCODEC == MAS3587F 2116#if CONFIG_CODEC == MAS3587F
2117void audio_init_playback(void) 2117void audio_init_playback(void)
2118{ 2118{
2119 init_playback_done = false; 2119 init_playback_done = false;
@@ -2216,7 +2216,7 @@ static void init_recording(void)
2216 buffer, because the silly MAS will not negate EOD until at least one 2216 buffer, because the silly MAS will not negate EOD until at least one
2217 DMA transfer has taken place. 2217 DMA transfer has taken place.
2218 Now let's wait for some data to be encoded. */ 2218 Now let's wait for some data to be encoded. */
2219 sleep(20); 2219 sleep(HZ/5);
2220 2220
2221 /* Now set it to Monitoring mode as default, saves power */ 2221 /* Now set it to Monitoring mode as default, saves power */
2222 shadow_io_control_main = 0x525; 2222 shadow_io_control_main = 0x525;
@@ -2630,7 +2630,7 @@ void mpeg_set_recording_options(int frequency, int quality,
2630 (void)editable; 2630 (void)editable;
2631 (void)prerecord_time; 2631 (void)prerecord_time;
2632} 2632}
2633#endif /* CONFIG_HWCODEC == MAS3587F; SIMULATOR */ 2633#endif /* CONFIG_CODEC == MAS3587F; SIMULATOR */
2634 2634
2635void audio_play(int offset) 2635void audio_play(int offset)
2636{ 2636{
@@ -2786,13 +2786,13 @@ int audio_status(void)
2786 if(paused) 2786 if(paused)
2787 ret |= AUDIO_STATUS_PAUSE; 2787 ret |= AUDIO_STATUS_PAUSE;
2788 2788
2789#if CONFIG_HWCODEC == MAS3587F 2789#if CONFIG_CODEC == MAS3587F
2790 if(is_recording && !is_prerecording) 2790 if(is_recording && !is_prerecording)
2791 ret |= AUDIO_STATUS_RECORD; 2791 ret |= AUDIO_STATUS_RECORD;
2792 2792
2793 if(is_prerecording) 2793 if(is_prerecording)
2794 ret |= AUDIO_STATUS_PRERECORD; 2794 ret |= AUDIO_STATUS_PRERECORD;
2795#endif /* CONFIG_HWCODEC == MAS3587F */ 2795#endif /* CONFIG_CODEC == MAS3587F */
2796 2796
2797 if(mpeg_errno) 2797 if(mpeg_errno)
2798 ret |= AUDIO_STATUS_ERROR; 2798 ret |= AUDIO_STATUS_ERROR;
@@ -2846,12 +2846,12 @@ void audio_init(void)
2846 2846
2847 memset(trackdata, sizeof(trackdata), 0); 2847 memset(trackdata, sizeof(trackdata), 0);
2848 2848
2849#if CONFIG_HWCODEC == MAS3587F 2849#if CONFIG_CODEC == MAS3587F
2850 if(read_hw_mask() & PR_ACTIVE_HIGH) 2850 if(read_hw_mask() & PR_ACTIVE_HIGH)
2851 and_b(~0x08, &PADRH); 2851 and_b(~0x08, &PADRH);
2852 else 2852 else
2853 or_b(0x08, &PADRH); 2853 or_b(0x08, &PADRH);
2854#endif /* CONFIG_HWCODEC == MAS3587F */ 2854#endif /* CONFIG_CODEC == MAS3587F */
2855 2855
2856#ifdef DEBUG 2856#ifdef DEBUG
2857 dbg_timer_start(); 2857 dbg_timer_start();
@@ -2859,4 +2859,4 @@ void audio_init(void)
2859#endif /* DEBUG */ 2859#endif /* DEBUG */
2860} 2860}
2861 2861
2862#endif /* CONFIG_HWCODEC != MASNONE */ 2862#endif /* CONFIG_CODEC != SWCODEC */
diff --git a/firmware/sound.c b/firmware/sound.c
index cd772f5e9f..a36c244d1b 100644
--- a/firmware/sound.c
+++ b/firmware/sound.c
@@ -31,7 +31,7 @@
31#include "dac.h" 31#include "dac.h"
32#include "system.h" 32#include "system.h"
33#include "hwcompat.h" 33#include "hwcompat.h"
34#if CONFIG_HWCODEC == MASNONE 34#if CONFIG_CODEC == SWCODEC
35#include "pcm_playback.h" 35#include "pcm_playback.h"
36#endif 36#endif
37#endif 37#endif
@@ -40,7 +40,7 @@
40extern bool audio_is_initialized; 40extern bool audio_is_initialized;
41#endif 41#endif
42 42
43#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 43#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
44extern unsigned long shadow_io_control_main; 44extern unsigned long shadow_io_control_main;
45extern unsigned shadow_codec_reg0; 45extern unsigned shadow_codec_reg0;
46#endif 46#endif
@@ -116,7 +116,7 @@ static const int steps[] =
116static const int minval[] = 116static const int minval[] =
117{ 117{
118 0, /* Volume */ 118 0, /* Volume */
119#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 119#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
120 -12, /* Bass */ 120 -12, /* Bass */
121 -12, /* Treble */ 121 -12, /* Treble */
122#elif defined(HAVE_UDA1380) 122#elif defined(HAVE_UDA1380)
@@ -145,7 +145,7 @@ static const int minval[] =
145static const int maxval[] = 145static const int maxval[] =
146{ 146{
147 100, /* Volume */ 147 100, /* Volume */
148#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 148#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
149 12, /* Bass */ 149 12, /* Bass */
150 12, /* Treble */ 150 12, /* Treble */
151#elif defined(HAVE_UDA1380) 151#elif defined(HAVE_UDA1380)
@@ -174,7 +174,7 @@ static const int maxval[] =
174static const int defaultval[] = 174static const int defaultval[] =
175{ 175{
176 70, /* Volume */ 176 70, /* Volume */
177#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 177#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
178 6, /* Bass */ 178 6, /* Bass */
179 6, /* Treble */ 179 6, /* Treble */
180#elif defined(HAVE_UDA1380) 180#elif defined(HAVE_UDA1380)
@@ -231,7 +231,7 @@ int sound_default(int setting)
231} 231}
232 232
233#ifndef SIMULATOR 233#ifndef SIMULATOR
234#if CONFIG_HWCODEC == MAS3507D /* volume/balance/treble/bass interdependency */ 234#if CONFIG_CODEC == MAS3507D /* volume/balance/treble/bass interdependency */
235#define VOLUME_MIN -780 235#define VOLUME_MIN -780
236#define VOLUME_MAX 180 236#define VOLUME_MAX 180
237 237
@@ -351,7 +351,7 @@ static int tenthdb2master(int db) {
351} 351}
352#endif 352#endif
353 353
354#if (CONFIG_HWCODEC == MAS3507D) || defined HAVE_UDA1380 354#if (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380
355 /* volume/balance/treble/bass interdependency main part */ 355 /* volume/balance/treble/bass interdependency main part */
356#define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN) 356#define VOLUME_RANGE (VOLUME_MAX - VOLUME_MIN)
357 357
@@ -371,7 +371,7 @@ static void set_prescaled_volume(void)
371 prescale = 0; /* no need to prescale if we don't boost 371 prescale = 0; /* no need to prescale if we don't boost
372 bass or treble */ 372 bass or treble */
373 373
374#if CONFIG_HWCODEC == MAS3507D 374#if CONFIG_CODEC == MAS3507D
375 mas_writereg(MAS_REG_KPRESCALE, prescale_table[prescale/10]); 375 mas_writereg(MAS_REG_KPRESCALE, prescale_table[prescale/10]);
376#else /* UDA1380 */ 376#else /* UDA1380 */
377 uda1380_set_mixer_vol(prescale*2/5, prescale*2/5); 377 uda1380_set_mixer_vol(prescale*2/5, prescale*2/5);
@@ -397,13 +397,13 @@ static void set_prescaled_volume(void)
397 r = VOLUME_MIN; 397 r = VOLUME_MIN;
398 } 398 }
399 399
400#if CONFIG_HWCODEC == MAS3507D 400#if CONFIG_CODEC == MAS3507D
401 dac_volume(tenthdb2reg(l), tenthdb2reg(r), false); 401 dac_volume(tenthdb2reg(l), tenthdb2reg(r), false);
402#else /* UDA1380 */ 402#else /* UDA1380 */
403 uda1380_set_master_vol(tenthdb2master(l), tenthdb2master(r)); 403 uda1380_set_master_vol(tenthdb2master(l), tenthdb2master(r));
404#endif 404#endif
405} 405}
406#endif /* (CONFIG_HWCODEC == MAS3507D) || defined HAVE_UDA1380 */ 406#endif /* (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380 */
407#endif /* !SIMULATOR */ 407#endif /* !SIMULATOR */
408 408
409int channel_configuration = SOUND_CHAN_STEREO; 409int channel_configuration = SOUND_CHAN_STEREO;
@@ -475,12 +475,12 @@ static void set_channel_config(void)
475 break; 475 break;
476 } 476 }
477 477
478#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 478#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
479 mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LL, &val_ll, 1); /* LL */ 479 mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LL, &val_ll, 1); /* LL */
480 mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LR, &val_lr, 1); /* LR */ 480 mas_writemem(MAS_BANK_D0, MAS_D0_OUT_LR, &val_lr, 1); /* LR */
481 mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RL, &val_rl, 1); /* RL */ 481 mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RL, &val_rl, 1); /* RL */
482 mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RR, &val_rr, 1); /* RR */ 482 mas_writemem(MAS_BANK_D0, MAS_D0_OUT_RR, &val_rr, 1); /* RR */
483#elif CONFIG_HWCODEC == MAS3507D 483#elif CONFIG_CODEC == MAS3507D
484 mas_writemem(MAS_BANK_D1, 0x7f8, &val_ll, 1); /* LL */ 484 mas_writemem(MAS_BANK_D1, 0x7f8, &val_ll, 1); /* LL */
485 mas_writemem(MAS_BANK_D1, 0x7f9, &val_lr, 1); /* LR */ 485 mas_writemem(MAS_BANK_D1, 0x7f9, &val_lr, 1); /* LR */
486 mas_writemem(MAS_BANK_D1, 0x7fa, &val_rl, 1); /* RL */ 486 mas_writemem(MAS_BANK_D1, 0x7fa, &val_rl, 1); /* RL */
@@ -489,7 +489,7 @@ static void set_channel_config(void)
489} 489}
490#endif /* !SIMULATOR */ 490#endif /* !SIMULATOR */
491 491
492#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 492#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
493unsigned long mdb_shape_shadow = 0; 493unsigned long mdb_shape_shadow = 0;
494unsigned long loudness_shadow = 0; 494unsigned long loudness_shadow = 0;
495#endif 495#endif
@@ -499,7 +499,7 @@ void sound_set(int setting, int value)
499#ifdef SIMULATOR 499#ifdef SIMULATOR
500 setting = value; 500 setting = value;
501#else 501#else
502#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 502#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
503 int tmp; 503 int tmp;
504#endif 504#endif
505 505
@@ -509,30 +509,30 @@ void sound_set(int setting, int value)
509 switch(setting) 509 switch(setting)
510 { 510 {
511 case SOUND_VOLUME: 511 case SOUND_VOLUME:
512#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 512#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
513 tmp = 0x7f00 * value / 100; 513 tmp = 0x7f00 * value / 100;
514 mas_codec_writereg(0x10, tmp & 0xff00); 514 mas_codec_writereg(0x10, tmp & 0xff00);
515#elif (CONFIG_HWCODEC == MAS3507D) || defined HAVE_UDA1380 515#elif (CONFIG_CODEC == MAS3507D) || defined HAVE_UDA1380
516 current_volume = VOLUME_MIN + (value * VOLUME_RANGE / 100); 516 current_volume = VOLUME_MIN + (value * VOLUME_RANGE / 100);
517 set_prescaled_volume(); /* tenth of dB */ 517 set_prescaled_volume(); /* tenth of dB */
518#endif 518#endif
519 break; 519 break;
520 520
521 case SOUND_BALANCE: 521 case SOUND_BALANCE:
522#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 522#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
523 tmp = ((value * 127 / 100) & 0xff) << 8; 523 tmp = ((value * 127 / 100) & 0xff) << 8;
524 mas_codec_writereg(0x11, tmp & 0xff00); 524 mas_codec_writereg(0x11, tmp & 0xff00);
525#elif CONFIG_HWCODEC == MAS3507D || defined HAVE_UDA1380 525#elif CONFIG_CODEC == MAS3507D || defined HAVE_UDA1380
526 current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */ 526 current_balance = value * VOLUME_RANGE / 100; /* tenth of dB */
527 set_prescaled_volume(); 527 set_prescaled_volume();
528#endif 528#endif
529 break; 529 break;
530 530
531 case SOUND_BASS: 531 case SOUND_BASS:
532#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 532#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
533 tmp = ((value * 8) & 0xff) << 8; 533 tmp = ((value * 8) & 0xff) << 8;
534 mas_codec_writereg(0x14, tmp & 0xff00); 534 mas_codec_writereg(0x14, tmp & 0xff00);
535#elif CONFIG_HWCODEC == MAS3507D 535#elif CONFIG_CODEC == MAS3507D
536 mas_writereg(MAS_REG_KBASS, bass_table[value+15]); 536 mas_writereg(MAS_REG_KBASS, bass_table[value+15]);
537 current_bass = value * 10; 537 current_bass = value * 10;
538 set_prescaled_volume(); 538 set_prescaled_volume();
@@ -544,10 +544,10 @@ void sound_set(int setting, int value)
544 break; 544 break;
545 545
546 case SOUND_TREBLE: 546 case SOUND_TREBLE:
547#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 547#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
548 tmp = ((value * 8) & 0xff) << 8; 548 tmp = ((value * 8) & 0xff) << 8;
549 mas_codec_writereg(0x15, tmp & 0xff00); 549 mas_codec_writereg(0x15, tmp & 0xff00);
550#elif CONFIG_HWCODEC == MAS3507D 550#elif CONFIG_CODEC == MAS3507D
551 mas_writereg(MAS_REG_KTREBLE, treble_table[value+15]); 551 mas_writereg(MAS_REG_KTREBLE, treble_table[value+15]);
552 current_treble = value * 10; 552 current_treble = value * 10;
553 set_prescaled_volume(); 553 set_prescaled_volume();
@@ -558,7 +558,7 @@ void sound_set(int setting, int value)
558#endif 558#endif
559 break; 559 break;
560 560
561#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 561#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
562 case SOUND_LOUDNESS: 562 case SOUND_LOUDNESS:
563 loudness_shadow = (loudness_shadow & 0x04) | 563 loudness_shadow = (loudness_shadow & 0x04) |
564 (MAX(MIN(value * 4, 0x44), 0) << 8); 564 (MAX(MIN(value * 4, 0x44), 0) << 8);
@@ -635,7 +635,7 @@ void sound_set(int setting, int value)
635 635
636int sound_val2phys(int setting, int value) 636int sound_val2phys(int setting, int value)
637{ 637{
638#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 638#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
639 int result = 0; 639 int result = 0;
640 640
641 switch(setting) 641 switch(setting)
@@ -660,7 +660,7 @@ int sound_val2phys(int setting, int value)
660#endif 660#endif
661} 661}
662 662
663#if (CONFIG_HWCODEC == MAS3587F) || (CONFIG_HWCODEC == MAS3539F) 663#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
664/* This function works by telling the decoder that we have another 664/* This function works by telling the decoder that we have another
665 crystal frequency than we actually have. It will adjust its internal 665 crystal frequency than we actually have. It will adjust its internal
666 parameters and the result is that the audio is played at another pitch. 666 parameters and the result is that the audio is played at another pitch.
diff --git a/firmware/tuner_samsung.c b/firmware/tuner_samsung.c
index c024fceb9d..b0887d0d7a 100644
--- a/firmware/tuner_samsung.c
+++ b/firmware/tuner_samsung.c
@@ -52,7 +52,7 @@ void samsung_set(int setting, int value)
52 case RADIO_FREQUENCY: 52 case RADIO_FREQUENCY:
53 { 53 {
54 int pll_cnt; 54 int pll_cnt;
55#if CONFIG_HWCODEC == MAS3587F 55#if CONFIG_CODEC == MAS3587F
56 /* Shift the MAS internal clock away for certain frequencies to 56 /* Shift the MAS internal clock away for certain frequencies to
57 * avoid interference. */ 57 * avoid interference. */
58 int pitch = 1000; 58 int pitch = 1000;
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c
index 2357f9baea..0bbecdae41 100644
--- a/uisimulator/common/stubs.c
+++ b/uisimulator/common/stubs.c
@@ -71,7 +71,7 @@ long pcm_get_bytes_waiting(void)
71 return 0; 71 return 0;
72} 72}
73 73
74#if CONFIG_HWCODEC != MASNONE 74#if CONFIG_CODEC != SWCODEC
75void audio_set_buffer_margin(int seconds) 75void audio_set_buffer_margin(int seconds)
76{ 76{
77 (void)seconds; 77 (void)seconds;
@@ -273,7 +273,7 @@ void button_set_flip(bool yesno)
273 (void)yesno; 273 (void)yesno;
274} 274}
275 275
276#if CONFIG_HWCODEC != MASNONE 276#if CONFIG_CODEC != SWCODEC
277void talk_init(void) 277void talk_init(void)
278{ 278{
279} 279}
diff --git a/uisimulator/x11/SOURCES b/uisimulator/x11/SOURCES
index edff103196..0aabfb2c03 100644
--- a/uisimulator/x11/SOURCES
+++ b/uisimulator/x11/SOURCES
@@ -9,6 +9,6 @@ screenhack.c
9thread.c 9thread.c
10uibasic.c 10uibasic.c
11visual.c 11visual.c
12#if CONFIG_HWCODEC == MASNONE 12#if CONFIG_CODEC == SWCODEC
13sound.c 13sound.c
14#endif 14#endif