|
1 |
| -//! C1 Minimal Input Module |
| 1 | +//! QT PY RP2040 with Framework 16 Input Module Firmware |
2 | 2 | //!
|
3 | 3 | //! Neopixel/WS2812 compatible RGB LED is connected to GPIO12.
|
4 | 4 | //! This pin doesn't support SPI TX.
|
@@ -53,15 +53,10 @@ pub type Ws2812<'a> = ws2812_pio::Ws2812<
|
53 | 53 | >;
|
54 | 54 |
|
55 | 55 | use fl16_inputmodules::control::*;
|
56 |
| -use fl16_inputmodules::serialnum::{device_release, get_serialnum}; |
| 56 | +use fl16_inputmodules::serialnum::device_release; |
57 | 57 |
|
58 |
| -// TODO: Need to adjust |
59 |
| -// FRA - Framwork |
60 |
| -// 000 - C1 Minimal Input Module (No assigned value) |
61 |
| -// AM - Atemitech |
62 |
| -// 00 - Default Configuration |
63 |
| -// 00000000 - Device Identifier |
64 |
| -const DEFAULT_SERIAL: &str = "FRA000AM0000000000"; |
| 58 | +const FRAMEWORK_VID: u16 = 0x32AC; |
| 59 | +const COMMUNITY_PID: u16 = 0x001F; |
65 | 60 |
|
66 | 61 | #[entry]
|
67 | 62 | fn main() -> ! {
|
@@ -103,16 +98,9 @@ fn main() -> ! {
|
103 | 98 | // Set up the USB Communications Class Device driver
|
104 | 99 | let mut serial = SerialPort::new(&usb_bus);
|
105 | 100 |
|
106 |
| - let serialnum = if let Some(serialnum) = get_serialnum() { |
107 |
| - serialnum.serialnum |
108 |
| - } else { |
109 |
| - DEFAULT_SERIAL |
110 |
| - }; |
111 |
| - |
112 |
| - let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(0x32ac, 0x01AF)) |
| 101 | + let mut usb_dev = UsbDeviceBuilder::new(&usb_bus, UsbVidPid(FRAMEWORK_VID, COMMUNITY_PID)) |
113 | 102 | .manufacturer("Adafruit")
|
114 |
| - .product("QT PY") |
115 |
| - .serial_number(serialnum) |
| 103 | + .product("QT PY - Framework 16 Inputmodule FW") |
116 | 104 | .max_power(500)
|
117 | 105 | .device_release(device_release())
|
118 | 106 | .device_class(USB_CLASS_CDC)
|
@@ -194,9 +182,6 @@ fn handle_sleep(
|
194 | 182 |
|
195 | 183 | // Turn off LED
|
196 | 184 | ws2812.write([colors::BLACK].iter().cloned()).unwrap();
|
197 |
| - |
198 |
| - // TODO: Set up SLEEP# pin as interrupt and wfi |
199 |
| - //cortex_m::asm::wfi(); |
200 | 185 | }
|
201 | 186 | (SimpleSleepState::Sleeping, true) => (),
|
202 | 187 | (SimpleSleepState::Sleeping, false) => {
|
|
0 commit comments