forked from NaxdyOrg/NaxGCC-FW
fix: disable rumble for now (or we might blow a fuse, lel)
This commit is contained in:
parent
1861b89505
commit
d0aeafc069
3 changed files with 12 additions and 10 deletions
|
@ -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.manufacturer = Some("Naxdy");
|
||||||
usb_config.product = Some("NaxGCC");
|
usb_config.product = Some("NaxGCC");
|
||||||
usb_config.serial_number = Some(serial);
|
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.max_packet_size_0 = 64;
|
||||||
usb_config.device_class = 0;
|
usb_config.device_class = 0;
|
||||||
usb_config.device_protocol = 0;
|
usb_config.device_protocol = 0;
|
||||||
|
|
|
@ -397,8 +397,8 @@ pub async fn input_loop(
|
||||||
btn_x: Input<'static, PIN_18>,
|
btn_x: Input<'static, PIN_18>,
|
||||||
btn_y: Input<'static, PIN_19>,
|
btn_y: Input<'static, PIN_19>,
|
||||||
btn_start: Input<'static, PIN_5>,
|
btn_start: Input<'static, PIN_5>,
|
||||||
pwm_rumble: Pwm<'static, PWM_CH4>,
|
// pwm_rumble: Pwm<'static, PWM_CH4>,
|
||||||
pwm_brake: Pwm<'static, PWM_CH6>,
|
// pwm_brake: Pwm<'static, PWM_CH6>,
|
||||||
mut spi: Spi<'static, SPI0, embassy_rp::spi::Blocking>,
|
mut spi: Spi<'static, SPI0, embassy_rp::spi::Blocking>,
|
||||||
mut spi_acs: Output<'static, PIN_24>,
|
mut spi_acs: Output<'static, PIN_24>,
|
||||||
mut spi_ccs: Output<'static, PIN_23>,
|
mut spi_ccs: Output<'static, PIN_23>,
|
||||||
|
@ -476,6 +476,8 @@ pub async fn input_loop(
|
||||||
|
|
||||||
let input_fut = async {
|
let input_fut = async {
|
||||||
loop {
|
loop {
|
||||||
|
let timer = Timer::after_micros(500);
|
||||||
|
|
||||||
update_button_states(
|
update_button_states(
|
||||||
&mut gcc_state,
|
&mut gcc_state,
|
||||||
&btn_a,
|
&btn_a,
|
||||||
|
@ -492,7 +494,7 @@ pub async fn input_loop(
|
||||||
&btn_ddown,
|
&btn_ddown,
|
||||||
);
|
);
|
||||||
|
|
||||||
yield_now().await;
|
timer.await;
|
||||||
|
|
||||||
// not every loop pass is going to update the stick state
|
// not every loop pass is going to update the stick state
|
||||||
match STICK_SIGNAL.try_take() {
|
match STICK_SIGNAL.try_take() {
|
||||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -84,11 +84,11 @@ fn main() -> ! {
|
||||||
pwm_config.enable = true;
|
pwm_config.enable = true;
|
||||||
pwm_config.compare_b = 255;
|
pwm_config.compare_b = 255;
|
||||||
|
|
||||||
let pwm_rumble = Pwm::new_output_b(p.PWM_CH4, p.PIN_25, 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());
|
// let pwm_brake = Pwm::new_output_b(p.PWM_CH6, p.PIN_29, pwm_config.clone());
|
||||||
|
|
||||||
pwm_rumble.set_counter(255);
|
// pwm_rumble.set_counter(0);
|
||||||
pwm_brake.set_counter(0);
|
// pwm_brake.set_counter(255);
|
||||||
|
|
||||||
executor0.run(|spawner| {
|
executor0.run(|spawner| {
|
||||||
spawner
|
spawner
|
||||||
|
@ -106,8 +106,8 @@ fn main() -> ! {
|
||||||
Input::new(p.PIN_18, gpio::Pull::Up),
|
Input::new(p.PIN_18, gpio::Pull::Up),
|
||||||
Input::new(p.PIN_19, gpio::Pull::Up),
|
Input::new(p.PIN_19, gpio::Pull::Up),
|
||||||
Input::new(p.PIN_5, gpio::Pull::Up),
|
Input::new(p.PIN_5, gpio::Pull::Up),
|
||||||
pwm_rumble,
|
// pwm_rumble,
|
||||||
pwm_brake,
|
// pwm_brake,
|
||||||
spi,
|
spi,
|
||||||
spi_acs,
|
spi_acs,
|
||||||
spi_ccs,
|
spi_ccs,
|
||||||
|
|
Loading…
Reference in a new issue