Re #457: audio working in Companion, Simulator and simu using SDL library (use SIMU_AUDIO=YES to enable)

Re #457: case insensitive f_stat() and f_open() for SIMU
This commit is contained in:
Damjan Adamic
2015-02-22 15:49:15 +01:00
parent 434baf15c4
commit 41cd128ad5
14 changed files with 351 additions and 54 deletions
+9 -6
View File
@@ -36,6 +36,14 @@
#include "../../opentx.h"
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
} ;
#if !defined(SIMU)
void setSampleRate(uint32_t frequency)
{
register Tc *ptc ;
@@ -154,12 +162,6 @@ void audioEnd()
PMC->PMC_PCER0 &= ~0x40000000L ; // Disable peripheral clock to DAC
}
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
} ;
void setVolume(uint8_t volume)
{
volumeRequired = volumeScale[min<uint8_t>(volume, VOLUME_LEVEL_MAX)];
@@ -169,4 +171,5 @@ void setVolume(uint8_t volume)
}
#endif // #if !defined(SIMU)