|
|
|
@ -2044,7 +2044,7 @@ void pwm_interrupt_handler() {
|
|
|
|
// if (random(0,2) == 1)
|
|
|
|
// if (random(0,2) == 1)
|
|
|
|
// pwm_rnd_bit *= (-1.0);
|
|
|
|
// pwm_rnd_bit *= (-1.0);
|
|
|
|
|
|
|
|
|
|
|
|
pwm_rnd_bit = (buffer[wave_position] > 0) ? 1 : 0;
|
|
|
|
pwm_rnd_bit = (buffer[wav_position] > 0) ? 1 : 0;
|
|
|
|
|
|
|
|
|
|
|
|
if ((pwm_value == (128 - pwm_amplitude)) && (pwm_rnd_bit == 1)) {
|
|
|
|
if ((pwm_value == (128 - pwm_amplitude)) && (pwm_rnd_bit == 1)) {
|
|
|
|
pwm_value = 128 + pwm_amplitude;
|
|
|
|
pwm_value = 128 + pwm_amplitude;
|
|
|
|
@ -2057,6 +2057,6 @@ void pwm_interrupt_handler() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pwm_set_gpio_level(AUDIO_OUT_PIN, pwm_value);
|
|
|
|
pwm_set_gpio_level(AUDIO_OUT_PIN, pwm_value);
|
|
|
|
if (wav_position++ > 950)
|
|
|
|
if (wav_position++ > 950)
|
|
|
|
wave_position = 0;
|
|
|
|
wav_position = 0;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|