chore(radio): remove EEPROM macros and related code (#5461)

This commit is contained in:
philmoz
2024-08-22 10:32:16 +10:00
committed by GitHub
parent 8cfa5b4846
commit e0ec49d84e
83 changed files with 27 additions and 3177 deletions
-26
View File
@@ -69,8 +69,6 @@ const int16_t sineValues[] =
#define SINE_INDEX_Q3 768
#define MAX_SINE_INDEX 1024
#if defined(SDCARD)
const char * const unitsFilenames[] = {
"",
"volt",
@@ -345,13 +343,6 @@ void playModelName()
audioQueue.playFile(filename);
}
#else // defined(SDCARD)
#define isAudioFileReferenced(i, f) false
#endif // defined(SDCARD)
AudioQueue audioQueue __DMA; // to place it in the RAM section on Horus, to have file buffers in RAM for DMA access
AudioBuffer audioBuffers[AUDIO_BUFFER_COUNT] __DMA;
@@ -397,8 +388,6 @@ inline void mixSample(audio_data_t * result, int sample, unsigned int fade)
*result = limit(AUDIO_DATA_MIN, *result + ((sample >> fade) >> (16-AUDIO_BITS_PER_SAMPLE)), AUDIO_DATA_MAX);
}
#if defined(SDCARD)
#define RIFF_CHUNK_SIZE 12
uint8_t wavBuffer[AUDIO_BUFFER_SIZE*2] __DMA;
@@ -485,12 +474,6 @@ int WavContext::mixBuffer(AudioBuffer *buffer, int volume, unsigned int fade)
}
return 0;
}
#else
int WavContext::mixBuffer(AudioBuffer *buffer, int volume, unsigned int fade)
{
return 0;
}
#endif
const uint8_t toneVolumes[] = { 10, 8, 6, 4, 2 };
inline float evalVolumeRatio(int freq, int volume)
@@ -737,7 +720,6 @@ void AudioQueue::playTone(uint16_t freq, uint16_t len, uint16_t pause, uint8_t f
RTOS_UNLOCK_MUTEX(audioMutex);
}
#if defined(SDCARD)
void AudioQueue::playFile(const char * filename, uint8_t flags, uint8_t id, int8_t fragmentVolume)
{
#if defined(SIMU)
@@ -800,8 +782,6 @@ void AudioQueue::stopSD()
playTone(0, 0, 100, PLAY_NOW); // insert a 100ms pause
}
#endif
void AudioQueue::stopAll()
{
flush();
@@ -931,14 +911,12 @@ void audioEvent(unsigned int index)
}
if (g_eeGeneral.beepMode >= e_mode_nokeys || (g_eeGeneral.beepMode >= e_mode_alarms && index <= AU_ERROR)) {
#if defined(SDCARD)
char filename[AUDIO_FILENAME_MAXLEN + 1];
if (index < AU_SPECIAL_SOUND_FIRST && isAudioFileReferenced(index, filename)) {
audioQueue.stopPlay(ID_PLAY_PROMPT_BASE + index);
audioQueue.playFile(filename, 0, ID_PLAY_PROMPT_BASE + index);
return;
}
#endif
switch (index) {
case AU_INACTIVITY:
audioQueue.playTone(2250, 80, 20, PLAY_REPEAT(2));
@@ -1090,7 +1068,6 @@ void audioEvent(unsigned int index)
}
}
#if defined(SDCARD)
void pushUnit(uint8_t unit, uint8_t idx, uint8_t id, uint8_t fragmentVolume)
{
if (unit < DIM(unitsFilenames)) {
@@ -1104,11 +1081,9 @@ void pushUnit(uint8_t unit, uint8_t idx, uint8_t id, uint8_t fragmentVolume)
TRACE("pushUnit: out of bounds unit : %d", unit); // We should never get here, but given the nature of TTS files, this prevent segfault in case of bug there.
}
}
#endif
void pushPrompt(uint16_t prompt, uint8_t id, uint8_t fragmentVolume)
{
#if defined(SDCARD)
char filename[AUDIO_FILENAME_MAXLEN+1];
char * str = strAppendSystemAudioPath(filename);
strcpy(str, "0000" SOUNDS_EXT);
@@ -1117,7 +1092,6 @@ void pushPrompt(uint16_t prompt, uint8_t id, uint8_t fragmentVolume)
prompt /= 10;
}
audioQueue.playFile(filename, 0, id, fragmentVolume);
#endif
}
void onKeyError()