TOOONEEEEE

This commit is contained in:
Tom-on64 2026-04-25 05:40:35 +02:00
parent 09b1a6707a
commit 17a3a79c44
3 changed files with 5 additions and 4 deletions

3
main.c
View File

@ -68,8 +68,7 @@ void core1_main(void) {
while (1) { while (1) {
update_buttons(); update_buttons();
update_inputs(); update_inputs();
//printf("vco_mode: %d, quant_enabled: %d amen_enabled: %d\n", state.vco_mode,state.quant_enabled,state.amen_enabled); printf("Sample: %f\n", state.dbg_sample);
//printf("clock_bpm: %f\n",state.clock_bpm);
sleep_ms(1); sleep_ms(1);
} }
} }

4
pwm.c
View File

@ -1,8 +1,8 @@
#include <hardware/pwm.h> #include <hardware/pwm.h>
#include <pico/types.h> #include <pico/types.h>
#include <stdio.h>
#include "const.h" #include "const.h"
#include "state.h"
#include "synth.h" #include "synth.h"
#include "pwm.h" #include "pwm.h"
@ -15,7 +15,7 @@ void pwm_isr(void) {
pwm_clear_irq(slice); pwm_clear_irq(slice);
float sample = get_sample(); float sample = get_sample();
printf("sample: %f\n", sample); state.dbg_sample = sample;
uint16_t level = (uint16_t)((sample + 1.0f) * 0.5f * 3400.0f); uint16_t level = (uint16_t)((sample + 1.0f) * 0.5f * 3400.0f);
pwm_set_chan_level(slice, chan, level); pwm_set_chan_level(slice, chan, level);

View File

@ -23,6 +23,8 @@ typedef struct {
vco_mode_t vco_mode; vco_mode_t vco_mode;
bool quant_enabled; bool quant_enabled;
bool amen_enabled; bool amen_enabled;
float dbg_sample;
} state_t; } state_t;
extern state_t state; extern state_t state;