Ye
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "hardware/gpio.h"
|
||||
#include "hardware/pwm.h"
|
||||
@@ -23,6 +22,9 @@ state_t state;
|
||||
|
||||
void init_all() {
|
||||
stdio_init_all();
|
||||
|
||||
sleep_ms(2000);
|
||||
|
||||
puts("Starting PIN initialization");
|
||||
const uint8_t out_gpio[] = {MUX_S0,MUX_S1,MUX_S2, STATUS_LED};
|
||||
const uint8_t in_gpio[] = {VCO_BUTTON,QUANT_BUTTON,AMEN_BUTTON};
|
||||
@@ -43,6 +45,9 @@ void init_all() {
|
||||
adc_select_input(i);
|
||||
}
|
||||
|
||||
// Synth
|
||||
synth_init();
|
||||
|
||||
// PWM bullshit
|
||||
gpio_set_function(AUDIO_OUT, GPIO_FUNC_PWM);
|
||||
|
||||
@@ -55,6 +60,7 @@ void init_all() {
|
||||
pwm_set_irq_enabled(slice, true);
|
||||
irq_set_exclusive_handler(PWM_IRQ_WRAP, pwm_isr);
|
||||
irq_set_enabled(PWM_IRQ_WRAP, true);
|
||||
|
||||
}
|
||||
|
||||
__attribute__((noreturn))
|
||||
@@ -62,8 +68,8 @@ void core1_main(void) {
|
||||
while (1) {
|
||||
update_buttons();
|
||||
update_inputs();
|
||||
printf("vco_mode: %d, quant_enabled: %d amen_enabled: %d\n", state.vco_mode,state.quant_enabled,state.amen_enabled);
|
||||
printf("clock_bpm: %f\n",state.clock_bpm);
|
||||
//printf("vco_mode: %d, quant_enabled: %d amen_enabled: %d\n", state.vco_mode,state.quant_enabled,state.amen_enabled);
|
||||
//printf("clock_bpm: %f\n",state.clock_bpm);
|
||||
sleep_ms(1);
|
||||
}
|
||||
}
|
||||
@@ -71,9 +77,7 @@ void core1_main(void) {
|
||||
__attribute__((noreturn))
|
||||
int main() {
|
||||
init_all();
|
||||
|
||||
multicore_launch_core1(core1_main);
|
||||
|
||||
while (1) {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user