diff --git a/buttons.c b/buttons.c index 5215dc0..0992f7e 100644 --- a/buttons.c +++ b/buttons.c @@ -4,25 +4,18 @@ #include #include "hardware/gpio.h" - void handle_vco_change(uint gpio, uint32_t events) { - if (gpio == VCO_BUTTON && (events & GPIO_IRQ_EDGE_RISE)) { - if (state.vco_mode == VCO_SAW) { - state.vco_mode = VCO_SINE; - } otherwise { - state.vco_mode++; - } - } + if (gpio == VCO_BUTTON && (events & GPIO_IRQ_EDGE_RISE)) { + if (state.vco_mode == VCO_SAW) state.vco_mode = VCO_SINE; + otherwise state.vco_mode++; + } } void update_button(uint pin, bool *button_state) { - if(gpio_get(pin) != *button_state) { - *button_state=!*button_state; - } + if(gpio_get(pin) != *button_state) *button_state = !*button_state; } void update_buttons() { - update_button(QUANT_BUTTON,&state.quant_enabled); - - -} \ No newline at end of file + update_button(QUANT_BUTTON, &state.quant_enabled); + update_button(AMEN_BUTTON, &state.amen_enabled); +} diff --git a/main.cc b/main.cc index 3971fa4..cae41b4 100644 --- a/main.cc +++ b/main.cc @@ -10,7 +10,6 @@ #include "hardware/pwm.h" #include "hardware/adc.h" #include "state.h" -#include "daisysp.h" state_t state; @@ -34,23 +33,18 @@ void init_all() { } adc_init(); for (uint8_t i=0; i < ARRAY_LENGTH(adc_gpio); i++) { - adc_gpio_init(adc_gpio[i]); - adc_select_input(i); + adc_gpio_init(adc_gpio[i]); + adc_select_input(i); } gpio_pull_down(VCO_BUTTON); gpio_set_irq_enabled_with_callback(VCO_BUTTON, GPIO_IRQ_EDGE_RISE, true, &handle_vco_change); } -daisysp::Oscillator osc; - __attribute__((noreturn)) int main() { init_all(); - osc.Init(SAMPLE_RATE); - - while (1) { - osc.SetFreq(state.vco_freq * 1760); - } + while (1) {} } +