Fixed error
This commit is contained in:
parent
c31efd0f15
commit
86d2f8ea95
@ -169,19 +169,6 @@ fn main() -> ! {
|
|||||||
// Initialize button matrix
|
// Initialize button matrix
|
||||||
button_matrix.init_pins();
|
button_matrix.init_pins();
|
||||||
|
|
||||||
// Scan matrix to get initial state
|
|
||||||
for _ in 0..10 {
|
|
||||||
button_matrix.scan_matrix(&mut delay);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fallback way to enter bootloader
|
|
||||||
if button_matrix.buttons_pressed()[0] {
|
|
||||||
status_led.update(StatusMode::Bootloader);
|
|
||||||
let gpio_activity_pin_mask: u32 = 0;
|
|
||||||
let disable_interface_mask: u32 = 0;
|
|
||||||
rp2040_hal::rom_data::reset_to_usb_boot(gpio_activity_pin_mask, disable_interface_mask);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Configure USB
|
// Configure USB
|
||||||
let usb_bus = UsbBusAllocator::new(waveshare_rp2040_zero::hal::usb::UsbBus::new(
|
let usb_bus = UsbBusAllocator::new(waveshare_rp2040_zero::hal::usb::UsbBus::new(
|
||||||
pac.USBCTRL_REGS,
|
pac.USBCTRL_REGS,
|
||||||
@ -259,6 +246,19 @@ fn main() -> ! {
|
|||||||
DynamicSmootherEcoI32::new(BASE_FREQ, SAMPLE_FREQ, SENSITIVITY),
|
DynamicSmootherEcoI32::new(BASE_FREQ, SAMPLE_FREQ, SENSITIVITY),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Scan matrix to get initial state
|
||||||
|
for _ in 0..10 {
|
||||||
|
button_matrix.scan_matrix(&mut delay);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fallback way to enter bootloader
|
||||||
|
if button_matrix.buttons_pressed()[0] {
|
||||||
|
status_led.update(StatusMode::Bootloader);
|
||||||
|
let gpio_activity_pin_mask: u32 = 0;
|
||||||
|
let disable_interface_mask: u32 = 0;
|
||||||
|
rp2040_hal::rom_data::reset_to_usb_boot(gpio_activity_pin_mask, disable_interface_mask);
|
||||||
|
}
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
if status_led_count_down.wait().is_ok() {
|
if status_led_count_down.wait().is_ok() {
|
||||||
update_status_led(&mut status_led, &mode);
|
update_status_led(&mut status_led, &mode);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user