[Voice] Slider for the audio volume

[Sky9x] Defaut audio volume is 12 (max is 23)
Issue 166 continued
This commit is contained in:
bsongis
2013-01-22 11:21:14 +00:00
parent 12ca975280
commit a626ea2ceb
17 changed files with 243 additions and 128 deletions
+2 -2
View File
@@ -165,7 +165,7 @@ void audioEnd()
PMC->PMC_PCER0 &= ~0x40000000L ; // Disable peripheral clock to DAC
}
static const int8_t volumeScale[NUM_VOL_LEVELS] =
static const int8_t volumeScale[VOLUME_LEVEL_MAX+1] =
{
0, 2, 4, 6, 8, 10, 13, 17, 22, 27, 33, 40,
64, 82, 96, 105, 112, 117, 120, 122, 124, 125, 126, 127
@@ -173,7 +173,7 @@ static const int8_t volumeScale[NUM_VOL_LEVELS] =
void setVolume(uint8_t volume)
{
coprocVolumeRequired = volumeScale[min<uint8_t>(volume, NUM_VOL_LEVELS-1)];
coprocVolumeRequired = volumeScale[min<uint8_t>(volume, VOLUME_LEVEL_MAX)];
__disable_irq() ;
coprocCheck() ;
__enable_irq() ;
+2 -2
View File
@@ -35,8 +35,6 @@
#ifndef audio_driver_h
#define audio_driver_h
#define NUM_VOL_LEVELS 24
void audioInit( void ) ;
void audioEnd( void ) ;
@@ -57,6 +55,8 @@ inline void dacStop()
DACC->DACC_IDR = DACC_IDR_ENDTX ; // Disable interrupt
}
#define VOLUME_LEVEL_MAX 23
#define VOLUME_LEVEL_DEF 12
void setVolume(uint8_t volume);
inline void dacFill(uint16_t *data, uint16_t size)