diff options
author | Nebuleon <2391500+Nebuleon@users.noreply.github.com> | 2023-07-23 06:44:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-23 11:44:41 +0100 |
commit | a5e33b1c28cb774a038b1c0e4fed0da9f757def1 (patch) | |
tree | b8a5bf31b13e73cae9a1b27da66dd1d283c65855 /platforms/chibios/drivers | |
parent | 321c18acec029cd7ab46d2c5b92c149e38533249 (diff) |
Allow the user to select one tone for the additive DAC (#21591)
Previously, if the user tried to use `#define AUDIO_MAX_SIMULTANEOUS_TONES 1` to conserve CPU time, their firmware would fail to build with this error:
```
platforms/chibios/drivers/audio_dac_additive.c:91:73: error: excess elements in array initializer [-Werror]
91 | static float active_tones_snapshot[AUDIO_MAX_SIMULTANEOUS_TONES] = {0, 0};
| ^
```
This also affected the preset `#define AUDIO_DAC_QUALITY_VERY_HIGH`, which called up only one simultaneous tone at 88200 Hz.
Diffstat (limited to 'platforms/chibios/drivers')
-rw-r--r-- | platforms/chibios/drivers/audio_dac_additive.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/platforms/chibios/drivers/audio_dac_additive.c b/platforms/chibios/drivers/audio_dac_additive.c index 9a5fe4c336..0f29755d1a 100644 --- a/platforms/chibios/drivers/audio_dac_additive.c +++ b/platforms/chibios/drivers/audio_dac_additive.c @@ -89,7 +89,7 @@ static dacsample_t dac_buffer_empty[AUDIO_DAC_BUFFER_SIZE] = {AUDIO_DAC_OFF_VALU /* keep track of the sample position for for each frequency */ static float dac_if[AUDIO_MAX_SIMULTANEOUS_TONES] = {0.0}; -static float active_tones_snapshot[AUDIO_MAX_SIMULTANEOUS_TONES] = {0, 0}; +static float active_tones_snapshot[AUDIO_MAX_SIMULTANEOUS_TONES] = {0}; static uint8_t active_tones_snapshot_length = 0; typedef enum { |