Maybe works?
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
#include <hardware/sync.h>
|
||||
#include <hardware/irq.h>
|
||||
#include <pico/stdio.h>
|
||||
#include <pico/time.h>
|
||||
@@ -70,28 +71,52 @@ void core1_init(void) {
|
||||
set_toggle_button(2, true);
|
||||
}
|
||||
|
||||
void debug_print(void) {
|
||||
printf("\x1b[H\x1b[J");
|
||||
printf("0: %f, 1: %f, 2: %f, 3: %f, 4: %f, 5: %f, 6: %f, 7: %f\n",
|
||||
input.pots[0], input.pots[1], input.pots[2], input.pots[3],
|
||||
input.pots[4], input.pots[5], input.pots[6], input.pots[7]);
|
||||
printf(
|
||||
"vco_freq: %f\n"
|
||||
"vco_volume: %f\n"
|
||||
"filter_freq: %f\n"
|
||||
"filter_resonance: %f\n"
|
||||
"clock_bpm: %f\n"
|
||||
"env1_attack: %f\n"
|
||||
"env1_decay: %f\n"
|
||||
"env2_attack: %f\n"
|
||||
"env2_decay: %f\n"
|
||||
"reverb_amount: %f\n",
|
||||
state.vco_freq,
|
||||
state.vco_volume,
|
||||
state.filter_freq,
|
||||
state.filter_resonance,
|
||||
state.clock_bpm,
|
||||
state.env1_attack,
|
||||
state.env1_decay,
|
||||
state.env2_attack,
|
||||
state.env2_decay,
|
||||
state.reverb_amount
|
||||
);
|
||||
}
|
||||
|
||||
noreturn void core1_loop(void) {
|
||||
while (1) {
|
||||
update_inputs(&input);
|
||||
update_state(&state, &input);
|
||||
printf("%d %f\n", input.buttons[0], input.pots[0]);
|
||||
printf("%d\n", input.buttons[1]);
|
||||
printf("%d\n", input.buttons[2]);
|
||||
printf("%d\n", input.buttons[3]);
|
||||
sleep_ms(1);
|
||||
}
|
||||
}
|
||||
|
||||
noreturn void core0_loop(void) {
|
||||
while (1) {
|
||||
|
||||
}
|
||||
while (1) __wfi();
|
||||
}
|
||||
|
||||
int main() {
|
||||
stdio_init_all();
|
||||
core0_init();
|
||||
|
||||
core1_init();
|
||||
core0_init();
|
||||
|
||||
multicore_launch_core1(core1_loop);
|
||||
core0_loop();
|
||||
|
||||
Reference in New Issue
Block a user