mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-02 11:36:38 -04:00
More debug Audio Beep Test tweaks (#2028)
This commit is contained in:
parent
28a5fc5915
commit
81e24d582d
3 changed files with 41 additions and 12 deletions
|
@ -27,7 +27,13 @@
|
|||
// Functions for audio beep (used by Sonde RSSI)
|
||||
void ToneGen::configure_beep(const uint32_t freq, const uint32_t sample_rate) {
|
||||
f_delta_ = (float)(freq * sizeof(sine_table_i8)) / sample_rate;
|
||||
f_tone_phase_ = sizeof(sine_table_i8) / 4; // Start at sine peak to handle case of freq=sample_rate/2
|
||||
f_tone_phase_ = 0.0;
|
||||
|
||||
// For higher frequencies, start at sine peak to handle case of freq=sample_rate/2;
|
||||
// we don't want to sample the sine wave only when it's crossing 0!
|
||||
// There is still an amplitude issue though depending on magnitude of selected sine sample deltas.
|
||||
if (f_delta_ >= sizeof(sine_table_i8) / 4)
|
||||
f_tone_phase_ = sizeof(sine_table_i8) / 4;
|
||||
}
|
||||
|
||||
int16_t ToneGen::process_beep() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue