summaryrefslogtreecommitdiffstats
path: root/firmware
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
parent95aae36c6cd72a3e9c8a4b9a1986d86c923ad234 (diff)
downloadrockbox-d343bbe84684598dcb574b56c679c9bbcc18a13b.tar.gz
rockbox-d343bbe84684598dcb574b56c679c9bbcc18a13b.tar.bz2
rockbox-d343bbe84684598dcb574b56c679c9bbcc18a13b.zip
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')
-rw-r--r--firmware/export/audiohw.h8
-rw-r--r--firmware/pcm.c2
-rw-r--r--firmware/target/arm/sandisk/audio-c200_e200.c28
3 files changed, 34 insertions, 4 deletions
diff --git a/firmware/export/audiohw.h b/firmware/export/audiohw.h
index f9d8caebf0..56f4d3dbea 100644
--- a/firmware/export/audiohw.h
+++ b/firmware/export/audiohw.h
@@ -529,13 +529,17 @@ void audiohw_disable_recording(void);
*/
void audiohw_set_recvol(int left, int right, int type);
+#endif /* HAVE_RECORDING */
+
+#if defined(HAVE_RECORDING) || defined(HAVE_FMRADIO_IN)
/**
* Enable or disable recording monitor.
- * @param enable ture or false.
+ * @param enable true or false.
*/
void audiohw_set_monitor(bool enable);
+#endif
+
-#endif /* HAVE_RECORDING */
#if CONFIG_CODEC != SWCODEC
diff --git a/firmware/pcm.c b/firmware/pcm.c
index 76a0ea2777..d15c129015 100644
--- a/firmware/pcm.c
+++ b/firmware/pcm.c
@@ -364,7 +364,9 @@ void pcm_set_frequency(unsigned int samplerate)
int index;
#ifdef CONFIG_SAMPR_TYPES
+#ifdef HAVE_RECORDING
unsigned int type = samplerate & SAMPR_TYPE_MASK;
+#endif
samplerate &= ~SAMPR_TYPE_MASK;
#ifdef HAVE_RECORDING
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