summaryrefslogtreecommitdiff
path: root/firmware/target/arm/sandisk/audio-c200_e200.c
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2010-09-17 20:42:45 +0000
committerFrank Gevaerts <frank@gevaerts.be>2010-09-17 20:42:45 +0000
commitd343bbe84684598dcb574b56c679c9bbcc18a13b (patch)
tree6f05863c6bb08e13bbe424343ce9cc1b0efd4e6e /firmware/target/arm/sandisk/audio-c200_e200.c
parent95aae36c6cd72a3e9c8a4b9a1986d86c923ad234 (diff)
Allow e200 to compile without HAVE_RECORDING
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28104 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/sandisk/audio-c200_e200.c')
-rw-r--r--firmware/target/arm/sandisk/audio-c200_e200.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/firmware/target/arm/sandisk/audio-c200_e200.c b/firmware/target/arm/sandisk/audio-c200_e200.c
index 0037bac58b..2f6bde1b98 100644
--- a/firmware/target/arm/sandisk/audio-c200_e200.c
+++ b/firmware/target/arm/sandisk/audio-c200_e200.c
@@ -45,8 +45,12 @@ void audio_set_output_source(int source)
void audio_input_mux(int source, unsigned flags)
{
static int last_source = AUDIO_SRC_PLAYBACK;
+#ifdef HAVE_RECORDING
static bool last_recording = false;
bool recording = flags & SRCF_RECORDING;
+#else
+ (void) flags;
+#endif
switch (source)
{
@@ -56,11 +60,16 @@ void audio_input_mux(int source, unsigned flags)
audio_channels = 2;
if (source != last_source)
{
+#if defined(HAVE_RECORDING) || defined(HAVE_FMRADIO_IN)
audiohw_set_monitor(false);
+#endif
+#ifdef HAVE_RECORDING
audiohw_disable_recording();
+#endif
}
break;
+#if defined(HAVE_RECORDING) && (INPUT_SRC_CAPS & SRC_CAP_MIC)
case AUDIO_SRC_MIC: /* recording only */
audio_channels = 1;
if (source != last_source)
@@ -69,26 +78,39 @@ void audio_input_mux(int source, unsigned flags)
audiohw_enable_recording(true); /* source mic */
}
break;
+#endif
+#if (INPUT_SRC_CAPS & SRC_CAP_FMRADIO)
case AUDIO_SRC_FMRADIO: /* recording and playback */
audio_channels = 2;
- if (source == last_source && recording == last_recording)
+ if (source == last_source
+#ifdef HAVE_RECORDING
+ && recording == last_recording
+#endif
+ )
break;
+#ifdef HAVE_RECORDING
last_recording = recording;
-
if (recording)
{
audiohw_set_monitor(false);
audiohw_enable_recording(false);
}
+#endif
else
{
+#ifdef HAVE_RECORDING
audiohw_disable_recording();
+#endif
+#if defined(HAVE_RECORDING) || defined(HAVE_FMRADIO_IN)
audiohw_set_monitor(true); /* line 1 analog audio path */
+#endif
+
}
break;
+#endif /* (INPUT_SRC_CAPS & SRC_CAP_FMRADIO) */
} /* end switch */
last_source = source;
@@ -164,6 +186,7 @@ void audiohw_set_sampr_dividers(int fsel)
IISDIV = (IISDIV & ~0xc000003f) | regvals[fsel].iisdiv;
}
+#ifdef HAVE_RECORDING
unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate)
{
/* Check if the samplerate is in the list of recordable rates.
@@ -175,3 +198,4 @@ unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate)
return samplerate * 2; /* Recording rates are 1/2 the codec clock */
}
+#endif