mirror of
https://github.com/opentx/opentx.git
synced 2025-07-25 17:25:13 +03:00
added const (Audio)
This commit is contained in:
parent
a3d9ec8a65
commit
aa4ba74e1a
3 changed files with 5 additions and 7 deletions
|
@ -147,7 +147,7 @@ const int16_t sineValues[] =
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(SDCARD)
|
#if defined(SDCARD)
|
||||||
const char * audioFilenames[] = {
|
const char * const audioFilenames[] = {
|
||||||
"tada",
|
"tada",
|
||||||
"thralert",
|
"thralert",
|
||||||
"swalert",
|
"swalert",
|
||||||
|
@ -278,7 +278,7 @@ void referenceSystemAudioFiles()
|
||||||
sdAvailableSystemAudioFiles = availableAudioFiles;
|
sdAvailableSystemAudioFiles = availableAudioFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * suffixes[] = { "-off", "-on" };
|
const char * const suffixes[] = { "-off", "-on" };
|
||||||
|
|
||||||
char * getModelAudioPath(char * path)
|
char * getModelAudioPath(char * path)
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
|
|
||||||
#include "../../opentx.h"
|
#include "../../opentx.h"
|
||||||
|
|
||||||
int dacIdle = 1;
|
bool dacIdle = true;
|
||||||
|
|
||||||
void setSampleRate(uint32_t frequency)
|
void setSampleRate(uint32_t frequency)
|
||||||
{
|
{
|
||||||
|
@ -96,7 +96,7 @@ void dacInit()
|
||||||
bool dacQueue(AudioBuffer *buffer)
|
bool dacQueue(AudioBuffer *buffer)
|
||||||
{
|
{
|
||||||
if (dacIdle) {
|
if (dacIdle) {
|
||||||
dacIdle = 0;
|
dacIdle = false;
|
||||||
DMA1_Stream5->CR &= ~DMA_SxCR_EN ; // Disable DMA channel
|
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->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);
|
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
|
DAC->SR = DAC_SR_DMAUDR1; // Write 1 to clear flag
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
dacIdle = 1;
|
dacIdle = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -44,8 +44,6 @@ void dacStop();
|
||||||
|
|
||||||
extern void setSampleRate(uint32_t frequency);
|
extern void setSampleRate(uint32_t frequency);
|
||||||
|
|
||||||
extern int dacIdle;
|
|
||||||
|
|
||||||
#define VOLUME_LEVEL_MAX 23
|
#define VOLUME_LEVEL_MAX 23
|
||||||
#define VOLUME_LEVEL_DEF 12
|
#define VOLUME_LEVEL_DEF 12
|
||||||
static const int8_t volumeScale[VOLUME_LEVEL_MAX+1] =
|
static const int8_t volumeScale[VOLUME_LEVEL_MAX+1] =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue