Skip to content

Commit

Permalink
Allow the user to select one tone for the additive DAC (qmk#21591)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Nebuleon authored and jesperhellberg committed Sep 9, 2023
1 parent d1de858 commit 45d5de5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion platforms/chibios/drivers/audio_dac_additive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 45d5de5

Please sign in to comment.