fix: disable rumble for now (or we might blow a fuse, lel)

This commit is contained in:
Naxdy 2024-03-27 22:31:55 +01:00
parent 1861b89505
commit d0aeafc069
Signed by: Naxdy
GPG key ID: CC15075846BCE91B
3 changed files with 12 additions and 10 deletions

View file

@ -260,7 +260,7 @@ pub async fn usb_transfer_loop(driver: Driver<'static, USB>, raw_serial: [u8; 8]
usb_config.manufacturer = Some("Naxdy");
usb_config.product = Some("NaxGCC");
usb_config.serial_number = Some(serial);
usb_config.max_power = 100;
usb_config.max_power = 10;
usb_config.max_packet_size_0 = 64;
usb_config.device_class = 0;
usb_config.device_protocol = 0;

View file

@ -397,8 +397,8 @@ pub async fn input_loop(
btn_x: Input<'static, PIN_18>,
btn_y: Input<'static, PIN_19>,
btn_start: Input<'static, PIN_5>,
pwm_rumble: Pwm<'static, PWM_CH4>,
pwm_brake: Pwm<'static, PWM_CH6>,
// pwm_rumble: Pwm<'static, PWM_CH4>,
// pwm_brake: Pwm<'static, PWM_CH6>,
mut spi: Spi<'static, SPI0, embassy_rp::spi::Blocking>,
mut spi_acs: Output<'static, PIN_24>,
mut spi_ccs: Output<'static, PIN_23>,
@ -476,6 +476,8 @@ pub async fn input_loop(
let input_fut = async {
loop {
let timer = Timer::after_micros(500);
update_button_states(
&mut gcc_state,
&btn_a,
@ -492,7 +494,7 @@ pub async fn input_loop(
&btn_ddown,
);
yield_now().await;
timer.await;
// not every loop pass is going to update the stick state
match STICK_SIGNAL.try_take() {

View file

@ -84,11 +84,11 @@ fn main() -> ! {
pwm_config.enable = true;
pwm_config.compare_b = 255;
let pwm_rumble = Pwm::new_output_b(p.PWM_CH4, p.PIN_25, pwm_config.clone());
let pwm_brake = Pwm::new_output_b(p.PWM_CH6, p.PIN_29, pwm_config.clone());
// let pwm_rumble = Pwm::new_output_b(p.PWM_CH4, p.PIN_25, pwm_config.clone());
// let pwm_brake = Pwm::new_output_b(p.PWM_CH6, p.PIN_29, pwm_config.clone());
pwm_rumble.set_counter(255);
pwm_brake.set_counter(0);
// pwm_rumble.set_counter(0);
// pwm_brake.set_counter(255);
executor0.run(|spawner| {
spawner
@ -106,8 +106,8 @@ fn main() -> ! {
Input::new(p.PIN_18, gpio::Pull::Up),
Input::new(p.PIN_19, gpio::Pull::Up),
Input::new(p.PIN_5, gpio::Pull::Up),
pwm_rumble,
pwm_brake,
// pwm_rumble,
// pwm_brake,
spi,
spi_acs,
spi_ccs,