1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-24 16:55:20 +03:00

added const (Audio)

This commit is contained in:
Damjan Adamic 2014-09-02 10:12:40 +02:00
parent a3d9ec8a65
commit aa4ba74e1a
3 changed files with 5 additions and 7 deletions

View file

@ -147,7 +147,7 @@ const int16_t sineValues[] =
};
#if defined(SDCARD)
const char * audioFilenames[] = {
const char * const audioFilenames[] = {
"tada",
"thralert",
"swalert",
@ -278,7 +278,7 @@ void referenceSystemAudioFiles()
sdAvailableSystemAudioFiles = availableAudioFiles;
}
const char * suffixes[] = { "-off", "-on" };
const char * const suffixes[] = { "-off", "-on" };
char * getModelAudioPath(char * path)
{

View file

@ -36,7 +36,7 @@
#include "../../opentx.h"
int dacIdle = 1;
bool dacIdle = true;
void setSampleRate(uint32_t frequency)
{
@ -96,7 +96,7 @@ void dacInit()
bool dacQueue(AudioBuffer *buffer)
{
if (dacIdle) {
dacIdle = 0;
dacIdle = false;
DMA1_Stream5->CR &= ~DMA_SxCR_EN ; // Disable DMA channel
DMA1->HIFCR = DMA_HIFCR_CTCIF5 | DMA_HIFCR_CHTIF5 | DMA_HIFCR_CTEIF5 | DMA_HIFCR_CDMEIF5 | DMA_HIFCR_CFEIF5 ; // Write ones to clear bits
DMA1_Stream5->M0AR = CONVERT_PTR_UINT(buffer->data);
@ -163,7 +163,7 @@ extern "C" void DMA1_Stream5_IRQHandler()
DAC->SR = DAC_SR_DMAUDR1; // Write 1 to clear flag
}
else {
dacIdle = 1;
dacIdle = true;
}
}
#endif

View file

@ -44,8 +44,6 @@ void dacStop();
extern void setSampleRate(uint32_t frequency);
extern int dacIdle;
#define VOLUME_LEVEL_MAX 23
#define VOLUME_LEVEL_DEF 12
static const int8_t volumeScale[VOLUME_LEVEL_MAX+1] =