summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2010-06-26 10:37:41 +0000
committerMichael Sevakis <jethead71@rockbox.org>2010-06-26 10:37:41 +0000
commite0bb92f00fdbcfd726407c688f5d82d3fa470a99 (patch)
treecefba4ff20c1d1bee274a6a4af4b16abc232679a /firmware
parentc3eca575b637201658dc7a1222c17b144d19686d (diff)
downloadrockbox-e0bb92f00fdbcfd726407c688f5d82d3fa470a99.tar.gz
rockbox-e0bb92f00fdbcfd726407c688f5d82d3fa470a99.tar.bz2
rockbox-e0bb92f00fdbcfd726407c688f5d82d3fa470a99.zip
Should clear up rest of red. Add a required #define in the config for c200. Fix up some preprocessing directives. Hope it's all taken care of now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27141 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/audio/sdl.c7
-rw-r--r--firmware/export/config/sansac200.h5
-rw-r--r--firmware/export/pcm_sampr.h2
-rw-r--r--firmware/pcm.c4
4 files changed, 14 insertions, 4 deletions
diff --git a/firmware/drivers/audio/sdl.c b/firmware/drivers/audio/sdl.c
index f4c622d7a6..7d6d7452df 100644
--- a/firmware/drivers/audio/sdl.c
+++ b/firmware/drivers/audio/sdl.c
@@ -22,6 +22,7 @@
#include <SDL_audio.h>
#include "config.h"
#include "audiohw.h"
+#include "pcm_sampr.h"
/**
* Audio Hardware api. Make them do nothing as we cannot properly simulate with
@@ -162,10 +163,12 @@ void audiohw_set_eq_band_width(unsigned int band, int value)
void audiohw_set_depth_3d(int value)
{ (void)value; }
#endif
-#if defined(HAVE_SAMPR_TYPE_REC)
-unsigned int pcm_sampr_type_rec_to_play(int samplerate)
+#ifdef HAVE_RECORDING
+#if SAMPR_TYPE_REC != 0
+unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate)
{ return samplerate; }
#endif
+#endif /* HAVE_RECORDING */
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
int mas_codec_readreg(int reg)
{
diff --git a/firmware/export/config/sansac200.h b/firmware/export/config/sansac200.h
index 6c05ba5a1c..3240af43f2 100644
--- a/firmware/export/config/sansac200.h
+++ b/firmware/export/config/sansac200.h
@@ -16,6 +16,11 @@
#define REC_FREQ_DEFAULT REC_FREQ_22 /* Default is not 44.1kHz */
#define REC_SAMPR_DEFAULT SAMPR_22
+/* because the samplerates don't match at each point, we must be able to
+ * tell PCM which set of rates to use. not needed if recording rates are
+ * a simple subset of playback rates and are equal values. */
+#define CONFIG_SAMPR_TYPES
+
/* Define bitmask of input sources - recordable bitmask can be defined
explicitly if different */
#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO)
diff --git a/firmware/export/pcm_sampr.h b/firmware/export/pcm_sampr.h
index c46e3ea9e2..62bfd0068b 100644
--- a/firmware/export/pcm_sampr.h
+++ b/firmware/export/pcm_sampr.h
@@ -324,7 +324,7 @@ extern const unsigned long rec_freq_sampr[REC_NUM_FREQ];
#define SAMPR_TYPE_REC (0x01 << 24)
#endif
-unsigned int sampr_type_rec_to_play(unsigned int samplerate);
+unsigned int pcm_sampr_type_rec_to_play(unsigned int samplerate);
#else /* ndef CONFIG_SAMPR_TYPES */
diff --git a/firmware/pcm.c b/firmware/pcm.c
index 72fe23cb16..76a0ea2777 100644
--- a/firmware/pcm.c
+++ b/firmware/pcm.c
@@ -367,7 +367,8 @@ void pcm_set_frequency(unsigned int samplerate)
unsigned int type = samplerate & SAMPR_TYPE_MASK;
samplerate &= ~SAMPR_TYPE_MASK;
-#ifdef SAMPR_TYPE_REC
+#ifdef HAVE_RECORDING
+#if SAMPR_TYPE_REC != 0
/* For now, supported targets have direct conversion when configured with
* CONFIG_SAMPR_TYPES.
* Some hypothetical target with independent rates would need slightly
@@ -375,6 +376,7 @@ void pcm_set_frequency(unsigned int samplerate)
if (type == SAMPR_TYPE_REC)
samplerate = pcm_sampr_type_rec_to_play(samplerate);
#endif
+#endif /* HAVE_RECORDING */
#endif /* CONFIG_SAMPR_TYPES */
index = round_value_to_list32(samplerate, hw_freq_sampr,