Browse Source

Don't disable interrupt in update()

dds
PaulStoffregen 6 years ago
parent
commit
dffb84f2b6
1 changed files with 0 additions and 5 deletions
  1. +0
    -5
      synth_wavetable.cpp

+ 0
- 5
synth_wavetable.cpp View File

* *
*/ */
void AudioSynthWavetable::update(void) { void AudioSynthWavetable::update(void) {
cli();
// exit if nothing to do // exit if nothing to do
if (env_state == STATE_IDLE || (current_sample->LOOP == false && tone_phase >= current_sample->MAX_PHASE)) { if (env_state == STATE_IDLE || (current_sample->LOOP == false && tone_phase >= current_sample->MAX_PHASE)) {
env_state = STATE_IDLE; env_state = STATE_IDLE;
sei();
return; return;
} }
// else locally copy object state and continue // else locally copy object state and continue
int32_t mod_phase = this->mod_phase; int32_t mod_phase = this->mod_phase;
int32_t mod_pitch_offset_init = this->mod_pitch_offset_init; int32_t mod_pitch_offset_init = this->mod_pitch_offset_init;
int32_t mod_pitch_offset_scnd = this->mod_pitch_offset_scnd; int32_t mod_pitch_offset_scnd = this->mod_pitch_offset_scnd;
sei();


audio_block_t* block; audio_block_t* block;
block = allocate(); block = allocate();
} }


// copy state back, unless there was a state change // copy state back, unless there was a state change
cli();
if (this->state_change == false) { if (this->state_change == false) {
this->tone_phase = tone_phase; this->tone_phase = tone_phase;
this->env_state = env_state; this->env_state = env_state;
this->vib_phase = this->mod_phase = TRIANGLE_INITIAL_PHASE; this->vib_phase = this->mod_phase = TRIANGLE_INITIAL_PHASE;
} }
} }
sei();


transmit(block); transmit(block);
release(block); release(block);

Loading…
Cancel
Save