mirror of
https://github.com/opentx/opentx.git
synced 2025-07-24 16:55:20 +03:00
Another STUPID bug on audio / ersky9x
This commit is contained in:
parent
89dd6aaf47
commit
c95ff048d8
3 changed files with 12 additions and 4 deletions
|
@ -157,7 +157,7 @@ extern uint16_t Sine_values[];
|
|||
#define CODEC_ID_PCM_S16LE 1
|
||||
#define CODEC_ID_PCM_ALAW 6
|
||||
uint8_t pcmCodec;
|
||||
uint16_t pcmFreq;
|
||||
uint16_t pcmFreq = 8000;
|
||||
|
||||
void audioTask(void* pdata)
|
||||
{
|
||||
|
@ -182,7 +182,7 @@ void AudioQueue::wakeup()
|
|||
static FIL wavFile;
|
||||
#endif
|
||||
|
||||
if (prioIdx >= 0 && prioIdx != ridx) {
|
||||
if (prioIdx >= 0) {
|
||||
ridx = prioIdx;
|
||||
prioIdx = -1;
|
||||
toneStop();
|
||||
|
@ -207,6 +207,7 @@ void AudioQueue::wakeup()
|
|||
FRESULT result = FR_OK;
|
||||
UINT read = 0;
|
||||
if (current.file[1]) {
|
||||
pcmFreq = 8000;
|
||||
wavSamplesBuffer = wavSamplesArray;
|
||||
result = f_open(&wavFile, current.file, FA_OPEN_EXISTING | FA_READ);
|
||||
if (result == FR_OK) {
|
||||
|
@ -412,7 +413,9 @@ void AudioQueue::play(uint8_t tFreq, uint8_t tLen, uint8_t tPause, uint8_t tFlag
|
|||
|
||||
void AudioQueue::playFile(const char *filename, uint8_t flags)
|
||||
{
|
||||
#ifndef SIMU
|
||||
#ifdef SIMU
|
||||
printf("playFile(\"%s\"\n", filename); fflush(stdout);
|
||||
#else
|
||||
CoEnterMutexSection(audioMutex);
|
||||
#endif
|
||||
|
||||
|
@ -635,4 +638,5 @@ void pushPrompt(uint16_t prompt)
|
|||
audioQueue.playFile(filename);
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
|
@ -78,7 +78,11 @@ class AudioQueue {
|
|||
|
||||
bool busy()
|
||||
{
|
||||
#ifdef SIMU
|
||||
return false;
|
||||
#else
|
||||
return (state != AUDIO_SLEEPING);
|
||||
#endif
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -1580,7 +1580,7 @@ void playValue(uint8_t idx)
|
|||
// no break
|
||||
case NUM_XCHNRAW+TELEM_A1-1:
|
||||
case NUM_XCHNRAW+TELEM_A2-1:
|
||||
idx -= NUM_XCHNRAW+MAX_TIMERS;
|
||||
idx -= (NUM_XCHNRAW+TELEM_A1-1);
|
||||
// A1 and A2
|
||||
{
|
||||
uint8_t att = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue