summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-05-20 20:26:36 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-05-20 20:26:36 +0000
commit8f659ae8d3845b40ff93ebfa3692f7b2302e6c7e (patch)
treea54381487762ec69bdec99f69dd24b148d3400b9 /firmware
parent731d7a16c3f606d586237fc8b4086ee54a0d0704 (diff)
downloadrockbox-8f659ae8d3845b40ff93ebfa3692f7b2302e6c7e.tar.gz
rockbox-8f659ae8d3845b40ff93ebfa3692f7b2302e6c7e.zip
Use bitmasks to define which inputs are available. Makes it easier to remove old assumptions of which are available. Inspired by e200 being unique in having FM Radio and Mic but no Line. Doesn't remove the assumption that Mic is available or that one of Mic and/or Line is available just to avoid excessive #ifdef'ing until needed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13448 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/audio.h47
-rw-r--r--firmware/export/config-e200.h3
-rw-r--r--firmware/export/config-fmrecorder.h7
-rw-r--r--firmware/export/config-h10.h3
-rw-r--r--firmware/export/config-h100.h6
-rw-r--r--firmware/export/config-h10_5gb.h3
-rw-r--r--firmware/export/config-h120.h11
-rw-r--r--firmware/export/config-h300.h4
-rw-r--r--firmware/export/config-iaudiom5.h4
-rw-r--r--firmware/export/config-iaudiox5.h4
-rw-r--r--firmware/export/config-ipod4g.h4
-rw-r--r--firmware/export/config-ipodcolor.h4
-rw-r--r--firmware/export/config-ipodnano.h4
-rw-r--r--firmware/export/config-ipodvideo.h4
-rw-r--r--firmware/export/config-ondiofm.h4
-rw-r--r--firmware/export/config-recorder.h7
-rw-r--r--firmware/export/config-recorderv2.h7
-rw-r--r--firmware/export/config.h3
-rw-r--r--firmware/export/config_caps.h107
-rw-r--r--firmware/export/pcm_record.h2
-rw-r--r--firmware/target/arm/audio-pp.c7
-rw-r--r--firmware/target/arm/system-pp502x.c10
-rw-r--r--firmware/target/coldfire/pcm-coldfire.c8
23 files changed, 217 insertions, 46 deletions
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index ebcb316cd9..a0da846215 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -127,32 +127,37 @@ enum rec_channel_modes
#define CHN_CAP_ALL (CHN_CAP_STEREO | CHN_CAP_MONO)
#endif /* CONFIG_CODEC == SWCODEC */
-/* audio sources */
enum audio_sources
{
- AUDIO_SRC_PLAYBACK = -1, /* for audio playback (default) */
- AUDIO_SRC_MIC, /* monitor mic */
- AUDIO_SRC_LINEIN, /* monitor line in */
-#ifdef HAVE_SPDIF_IN
- AUDIO_SRC_SPDIF, /* monitor spdif */
-#endif
-#if defined(HAVE_FMRADIO_IN) || CONFIG_TUNER
- AUDIO_SRC_FMRADIO, /* monitor fm radio */
-#endif
- /* define new audio sources above this line */
- AUDIO_SOURCE_LIST_END,
- /* AUDIO_SRC_FMRADIO must be declared #if CONFIG_TUNER but is not in
- the list of recordable sources. HAVE_FMRADIO_IN implies CONFIG_TUNER. */
-#if defined(HAVE_FMRADIO_IN) || (CONFIG_TUNER == 0)
- AUDIO_NUM_SOURCES = AUDIO_SOURCE_LIST_END,
-#else
- AUDIO_NUM_SOURCES = AUDIO_SOURCE_LIST_END-1,
-#endif
- AUDIO_SRC_MAX = AUDIO_NUM_SOURCES-1
+ AUDIO_SRC_PLAYBACK = -1, /* Virtual source */
+ HAVE_MIC_IN_(AUDIO_SRC_MIC,)
+ HAVE_LINE_IN_(AUDIO_SRC_LINEIN,)
+ HAVE_SPDIF_IN_(AUDIO_SRC_SPDIF,)
+ HAVE_FMRADIO_IN_(AUDIO_SRC_FMRADIO,)
+ AUDIO_NUM_SOURCES,
+ AUDIO_SRC_MAX = AUDIO_NUM_SOURCES-1,
+ AUDIO_SRC_DEFAULT = AUDIO_SRC_PLAYBACK
};
+#ifdef HAVE_RECORDING
+/* Recordable source implies it has the input as well */
+
+/* For now there's no restrictions on any targets with which inputs
+ are recordable so define them as equivalent - if they do differ,
+ special handling is needed right now. */
+enum rec_sources
+{
+ __REC_SRC_FIRST = -1,
+ HAVE_MIC_REC_(REC_SRC_MIC,)
+ HAVE_LINE_REC_(REC_SRC_LINEIN,)
+ HAVE_SPDIF_REC_(REC_SRC_SPDIF,)
+ HAVE_FMRADIO_REC_(REC_SRC_FMRADIO,)
+ REC_NUM_SOURCES
+};
+#endif /* HAVE_RECORDING */
+
#if CONFIG_CODEC == SWCODEC
-/* selects an audio source for recording or playback */
+/* selects a source to monitor for recording or playback */
#define SRCF_PLAYBACK 0x0000 /* default */
#define SRCF_RECORDING 0x1000
#if CONFIG_TUNER
diff --git a/firmware/export/config-e200.h b/firmware/export/config-e200.h
index d477289f01..edb73e80eb 100644
--- a/firmware/export/config-e200.h
+++ b/firmware/export/config-e200.h
@@ -9,6 +9,9 @@
/* define this if you have recording possibility */
/*#define HAVE_RECORDING*/ /* TODO: add support for this */
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+/* #define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) */
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-fmrecorder.h b/firmware/export/config-fmrecorder.h
index 211dccb183..479815ee2c 100644
--- a/firmware/export/config-fmrecorder.h
+++ b/firmware/export/config-fmrecorder.h
@@ -1,6 +1,10 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_SPDIF)
+
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
@@ -48,9 +52,6 @@
/* Define this if you have a MAS3587F */
#define CONFIG_CODEC MAS3587F
-/* Define this for S/PDIF input available */
-#define HAVE_SPDIF_IN
-
/* Define this for LCD backlight available */
#define HAVE_BACKLIGHT
diff --git a/firmware/export/config-h10.h b/firmware/export/config-h10.h
index 4d372143f8..a5d32ebeaa 100644
--- a/firmware/export/config-h10.h
+++ b/firmware/export/config-h10.h
@@ -10,6 +10,9 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN)
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_44)
diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h
index cc2bfd7178..af51e81f70 100644
--- a/firmware/export/config-h100.h
+++ b/firmware/export/config-h100.h
@@ -156,8 +156,10 @@
#endif /* !SIMULATOR */
-/* Define this for S/PDIF input available */
-#define HAVE_SPDIF_IN
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | \
+ SRC_CAP_FMRADIO | SRC_CAP_SPDIF)
/* Define this for S/PDIF output available */
#define HAVE_SPDIF_OUT
diff --git a/firmware/export/config-h10_5gb.h b/firmware/export/config-h10_5gb.h
index 3b3cebb8fb..48d73173ce 100644
--- a/firmware/export/config-h10_5gb.h
+++ b/firmware/export/config-h10_5gb.h
@@ -10,6 +10,9 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN)
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_44)
diff --git a/firmware/export/config-h120.h b/firmware/export/config-h120.h
index a0ad638fa2..7e5a66a3dd 100644
--- a/firmware/export/config-h120.h
+++ b/firmware/export/config-h120.h
@@ -75,6 +75,11 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | \
+ SRC_CAP_FMRADIO | SRC_CAP_SPDIF)
+
/* define hardware samples rate caps mask */
#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11)
@@ -150,18 +155,12 @@
#endif /* !SIMULATOR */
-/* Define this for S/PDIF input available */
-#define HAVE_SPDIF_IN
-
/* Define this for S/PDIF output available */
#define HAVE_SPDIF_OUT
/* Define this if you can control the S/PDIF power */
#define HAVE_SPDIF_POWER
-/* Define this for FM radio input available */
-#define HAVE_FMRADIO_IN
-
/* Define this if you have a serial port */
/*#define HAVE_SERIAL*/
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h
index 0b2406bee7..43239e4419 100644
--- a/firmware/export/config-h300.h
+++ b/firmware/export/config-h300.h
@@ -72,6 +72,10 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
+
/* define hardware samples rate caps mask */
#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11)
diff --git a/firmware/export/config-iaudiom5.h b/firmware/export/config-iaudiom5.h
index bcc843f125..d4e09dd0ad 100644
--- a/firmware/export/config-iaudiom5.h
+++ b/firmware/export/config-iaudiom5.h
@@ -9,6 +9,10 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN)
+
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11)
diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h
index 43c02a0ee5..fbcb69aa61 100644
--- a/firmware/export/config-iaudiox5.h
+++ b/firmware/export/config-iaudiox5.h
@@ -9,6 +9,10 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_FMRADIO)
+
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_88 | SAMPR_CAP_44 | SAMPR_CAP_22 | SAMPR_CAP_11)
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h
index 4a8d4f1bf2..14a4e8266d 100644
--- a/firmware/export/config-ipod4g.h
+++ b/firmware/export/config-ipod4g.h
@@ -11,6 +11,10 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN)
+
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_44)
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h
index 41277041f1..5e4e3b33ab 100644
--- a/firmware/export/config-ipodcolor.h
+++ b/firmware/export/config-ipodcolor.h
@@ -11,6 +11,10 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN)
+
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_44)
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h
index 74bfe34d0f..1d024d8565 100644
--- a/firmware/export/config-ipodnano.h
+++ b/firmware/export/config-ipodnano.h
@@ -11,6 +11,10 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN)
+
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_44)
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h
index b5318d755c..b2b4ae9856 100644
--- a/firmware/export/config-ipodvideo.h
+++ b/firmware/export/config-ipodvideo.h
@@ -11,6 +11,10 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN)
+
/* define the bitmask of hardware sample rates */
#define HW_SAMPR_CAPS (SAMPR_CAP_44)
diff --git a/firmware/export/config-ondiofm.h b/firmware/export/config-ondiofm.h
index c168ecf588..ea806a4973 100644
--- a/firmware/export/config-ondiofm.h
+++ b/firmware/export/config-ondiofm.h
@@ -1,6 +1,10 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN)
+
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
diff --git a/firmware/export/config-recorder.h b/firmware/export/config-recorder.h
index 3fe7365d3c..29f187fdd2 100644
--- a/firmware/export/config-recorder.h
+++ b/firmware/export/config-recorder.h
@@ -1,6 +1,10 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_SPDIF)
+
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
@@ -42,9 +46,6 @@
/* Define this if you have a MAS3587F */
#define CONFIG_CODEC MAS3587F
-/* Define this for S/PDIF input available */
-#define HAVE_SPDIF_IN
-
/* Define this for LCD backlight available */
#define HAVE_BACKLIGHT
diff --git a/firmware/export/config-recorderv2.h b/firmware/export/config-recorderv2.h
index 8211994275..b534be568f 100644
--- a/firmware/export/config-recorderv2.h
+++ b/firmware/export/config-recorderv2.h
@@ -1,6 +1,10 @@
/* define this if you have recording possibility */
#define HAVE_RECORDING
+/* Define bitmask of input sources - recordable bitmask can be defined
+ explicitly if different */
+#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_LINEIN | SRC_CAP_SPDIF)
+
/* define this if you have a bitmap LCD display */
#define HAVE_LCD_BITMAP
@@ -45,9 +49,6 @@
/* Define this if you have a MAS3587F */
#define CONFIG_CODEC MAS3587F
-/* Define this for S/PDIF input available */
-#define HAVE_SPDIF_IN
-
/* Define this for LCD backlight available */
#define HAVE_BACKLIGHT
diff --git a/firmware/export/config.h b/firmware/export/config.h
index ceb63cd098..0ad4fabbe1 100644
--- a/firmware/export/config.h
+++ b/firmware/export/config.h
@@ -204,6 +204,9 @@
/* no known platform */
#endif
+/* setup basic macros from capability masks */
+#include "config_caps.h"
+
/* now set any CONFIG_ defines correctly if they are not used,
No need to do this on CONFIG_'s which are compulsary (e.g CONFIG_CODEC ) */
#ifndef CONFIG_TUNER
diff --git a/firmware/export/config_caps.h b/firmware/export/config_caps.h
new file mode 100644
index 0000000000..8e3832d3a7
--- /dev/null
+++ b/firmware/export/config_caps.h
@@ -0,0 +1,107 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2007 by Michael Sevakis
+ *
+ * Convert caps masks into HAVE_* defines
+ *
+ * All files in this archive are subject to the GNU General Public License.
+ * See the file COPYING in the source tree root for full license agreement.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+/** INPUTS **/
+
+/* NOTE: Playback is implied in all this. Make sense? :) */
+#define SRC_MIC 0
+#define SRC_LINEIN 1
+#define SRC_SPDIF 2
+#define SRC_FMRADIO 3
+
+#define SRC_CAP_MIC (1 << SRC_MIC)
+#define SRC_CAP_LINEIN (1 << SRC_LINEIN)
+#define SRC_CAP_SPDIF (1 << SRC_SPDIF)
+#define SRC_CAP_FMRADIO (1 << SRC_FMRADIO)
+
+/* audio monitor mux sources */
+#ifndef INPUT_SRC_CAPS
+#define INPUT_SRC_CAPS 0 /* Nothing but playback */
+#endif
+
+/* Microphone */
+#if (INPUT_SRC_CAPS & SRC_CAP_MIC)
+ #define HAVE_MIC_IN
+ #define HAVE_MIC_IN_(...) __VA_ARGS__
+#else
+ #define HAVE_MIC_IN_(...)
+#endif
+/* Line In */
+#if (INPUT_SRC_CAPS & SRC_CAP_LINEIN)
+ #define HAVE_LINE_IN
+ #define HAVE_LINE_IN_(...) __VA_ARGS__
+#else
+ #define HAVE_LINE_IN_(...)
+#endif
+/* S/PDIF */
+#if (INPUT_SRC_CAPS & SRC_CAP_SPDIF)
+ #define HAVE_SPDIF_IN
+ #define HAVE_SPDIF_IN_(...) __VA_ARGS__
+#else
+ #define HAVE_SPDIF_IN_(...)
+#endif
+/* FM Radio */
+#if (INPUT_SRC_CAPS & SRC_CAP_FMRADIO)
+ #define HAVE_FMRADIO_IN
+ #define HAVE_FMRADIO_IN_(...) __VA_ARGS__
+#else
+ #define HAVE_FMRADIO_IN_(...)
+#endif
+
+#ifdef HAVE_RECORDING
+/* Recordable source implies it has the input as well */
+
+/* For now there's no restrictions on any targets with which inputs
+ are recordable so define them as equivalent - if they do differ,
+ special handling is needed right now. */
+#ifndef REC_SRC_CAPS
+#define REC_SRC_CAPS INPUT_SRC_CAPS
+#endif
+
+/* Microphone */
+#if (REC_SRC_CAPS & SRC_CAP_MIC)
+ #define HAVE_MIC_REC
+ #define HAVE_MIC_REC_(...) __VA_ARGS__
+#else
+ #define HAVE_MIC_REC_(...)
+#endif
+/* Line In */
+#if (REC_SRC_CAPS & SRC_CAP_LINEIN)
+ #define HAVE_LINE_REC
+ #define HAVE_LINE_REC_(...) __VA_ARGS__
+#else
+ #define HAVE_LINE_REC_(...)
+#endif
+/* S/PDIF */
+#if (REC_SRC_CAPS & SRC_CAP_SPDIF)
+ #define HAVE_SPDIF_REC
+ #define HAVE_SPDIF_REC_(...) __VA_ARGS__
+#else
+ #define HAVE_SPDIF_REC_(...)
+#endif
+/* FM Radio */
+#if (REC_SRC_CAPS & SRC_CAP_FMRADIO)
+ #define HAVE_FMRADIO_REC
+ #define HAVE_FMRADIO_REC_(...) __VA_ARGS__
+#else
+ #define HAVE_FMRADIO_REC_(...)
+#endif
+#endif /* HAVE_RECORDING */
diff --git a/firmware/export/pcm_record.h b/firmware/export/pcm_record.h
index 8075b00ffc..dcc473c3f3 100644
--- a/firmware/export/pcm_record.h
+++ b/firmware/export/pcm_record.h
@@ -21,7 +21,7 @@
#define PCM_RECORD_H
#define DMA_REC_ERROR_DMA (-1)
-#ifdef HAVE_SPDIF_IN
+#ifdef HAVE_SPDIF_REC
#define DMA_REC_ERROR_SPDIF (-2)
#endif
diff --git a/firmware/target/arm/audio-pp.c b/firmware/target/arm/audio-pp.c
index 603bbad5fe..82c5545a3f 100644
--- a/firmware/target/arm/audio-pp.c
+++ b/firmware/target/arm/audio-pp.c
@@ -40,7 +40,6 @@ void audio_set_source(int source, unsigned flags)
{
default: /* playback - no recording */
source = AUDIO_SRC_PLAYBACK;
-#ifdef HAVE_RECORDING
case AUDIO_SRC_PLAYBACK:
if (source != last_source)
{
@@ -48,6 +47,7 @@ void audio_set_source(int source, unsigned flags)
audiohw_set_monitor(false);
}
break;
+#ifdef HAVE_MIC_REC
case AUDIO_SRC_MIC: /* recording only */
if (source != last_source)
{
@@ -55,7 +55,8 @@ void audio_set_source(int source, unsigned flags)
audiohw_set_monitor(false);
}
break;
-
+#endif
+#ifdef HAVE_LINEIN_REC
case AUDIO_SRC_LINEIN: /* recording only */
if (source != last_source)
{
@@ -64,7 +65,7 @@ void audio_set_source(int source, unsigned flags)
}
break;
#endif
-#if CONFIG_TUNER
+#ifdef HAVE_FMRADIO_REC
case AUDIO_SRC_FMRADIO: /* recording and playback */
if (!recording)
audiohw_set_recvol(0, 0, AUDIO_GAIN_LINEIN);
diff --git a/firmware/target/arm/system-pp502x.c b/firmware/target/arm/system-pp502x.c
index 1f2d27a7b7..0148f3d9de 100644
--- a/firmware/target/arm/system-pp502x.c
+++ b/firmware/target/arm/system-pp502x.c
@@ -62,6 +62,11 @@ extern void clickwheel_int(void);
void irq(void)
{
if(CURRENT_CORE == CPU) {
+ if (CPU_HI_INT_STAT)
+ {
+ gui_syncsplash(0, "%08X %08X", inl(0x6000414c), CPU_HI_INT_STAT);
+ }
+
if (CPU_INT_STAT & TIMER1_MASK) {
#ifdef SANSA_E200
if (GPIOF_INT_STAT & 0xff)
@@ -239,6 +244,11 @@ void system_init(void)
CPU_INT_CLR = -1;
INT_FORCED_CLR = -1;
+ outl(0, 0x6000414c);
+ outl(0, 0x60004144);
+
+// outl(0x80000, 0x6000414c);
+
GPIOA_INT_EN = 0;
GPIOB_INT_EN = 0;
GPIOC_INT_EN = 0;
diff --git a/firmware/target/coldfire/pcm-coldfire.c b/firmware/target/coldfire/pcm-coldfire.c
index b52e5e09b5..dc40dacf0e 100644
--- a/firmware/target/coldfire/pcm-coldfire.c
+++ b/firmware/target/coldfire/pcm-coldfire.c
@@ -22,7 +22,7 @@
#include "logf.h"
#include "audio.h"
#include "sound.h"
-#if defined(HAVE_SPDIF_IN) || defined(HAVE_SPDIF_OUT)
+#if defined(HAVE_SPDIF_REC) || defined(HAVE_SPDIF_OUT)
#include "spdif.h"
#endif
@@ -276,7 +276,7 @@ void pcm_init(void)
audiohw_set_frequency(freq_ent[FPARM_FSEL]);
coldfire_set_pllcr_audio_bits(PLLCR_SET_AUDIO_BITS_DEFPARM);
-#if defined(HAVE_SPDIF_IN) || defined(HAVE_SPDIF_OUT)
+#if defined(HAVE_SPDIF_REC) || defined(HAVE_SPDIF_OUT)
spdif_init();
#endif
/* Enable interrupt at level 6, priority 0 */
@@ -365,7 +365,7 @@ void pcm_rec_dma_start(void *addr, size_t size)
_pcm_apply_settings(!is_playback_monitoring());
/* Start the DMA transfer.. */
-#ifdef HAVE_SPDIF_IN
+#ifdef HAVE_SPDIF_REC
/* clear: ebu1cnew, valnogood, symbolerr, parityerr */
INTERRUPTCLEAR = (1 << 25) | (1 << 24) | (1 << 23) | (1 << 22);
#endif
@@ -462,7 +462,7 @@ void DMA1(void)
logf(" DCR1: %08x", DCR1);
#endif
}
-#ifdef HAVE_SPDIF_IN
+#ifdef HAVE_SPDIF_REC
else if (DATAINCONTROL == 0xc038 &&
(INTERRUPTSTAT & ((1 << 24) | (1 << 23) | (1 << 22))))
{