main/alles.c
void toggle_midi() {
    if(global.status & MIDI_MODE) { 
        // just restart, easier that way
        esp_restart();
    } else {
        // If button pushed before wifi connects, wait for wifi to connect.
        while(!(global.status & WIFI_MANAGER_OK)) {
            vTaskDelay(100 / portTICK_PERIOD_MS);
        }
        // turn on midi
        global.status = MIDI_MODE | RUNNING;
        // Play a MIDI sound before shutting down voices
        midi_tone();
        fill_audio_buffer(1.0);
        fm_deinit(); // have to free RAM to start the BLE stack
        voices_deinit();
        midi_init();
    }
}
// Called when the MIDI button is hit. Toggle between MIDI on and off mode
Called when the MIDI button is hit. Toggle between MIDI on and off mode
Called when the MIDI button is hit . Toggle between MIDI on and off mode
void toggle_midi() {
    if(global.status & MIDI_MODE) { 
        esp_restart();
    } else {
        while(!(global.status & WIFI_MANAGER_OK)) {
            vTaskDelay(100 / portTICK_PERIOD_MS);
        }
        global.status = MIDI_MODE | RUNNING;
        midi_tone();
        fill_audio_buffer(1.0);
        fm_deinit(); 
        voices_deinit();
        midi_init();
    }
}
void toggle_midi ( ) { if ( global . status & MIDI_MODE ) { esp_restart ( ) ; } else { while ( ! ( global . status & WIFI_MANAGER_OK ) ) { vTaskDelay ( 100 / portTICK_PERIOD_MS ) ; } global . status = MIDI_MODE | RUNNING ; midi_tone ( ) ; fill_audio_buffer ( 1.0 ) ; fm_deinit ( ) ; voices_deinit ( ) ; midi_init ( ) ; } }
Called when the MIDI button is hit.
Called when the MIDI button is hit .
// just restart, easier that way // If button pushed before wifi connects, wait for wifi to connect. // turn on midi // Play a MIDI sound before shutting down voices // have to free RAM to start the BLE stack