Skip to content

Commit a6ad1f2

Browse files
committed
ledmatrix: Can't detect dip1. Doesn't have external pullup/down
Signed-off-by: Daniel Schaefer <[email protected]>
1 parent bcd24c4 commit a6ad1f2

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

ledmatrix/src/main.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,7 @@ fn main() -> ! {
218218
&clocks.peripheral_clock,
219219
);
220220

221-
// Detect whether the dip1 pin is connected
222-
// We switched from bootsel button to DIP-switch with general purpose DIP1 pin in DVT2
223-
let mut dip1_present = false;
224221
let dip1 = pins.dip1.into_pull_up_input();
225-
if dip1.is_low().unwrap() {
226-
dip1_present = true;
227-
}
228-
let dip1 = dip1.into_pull_down_input();
229-
if dip1.is_high().unwrap() {
230-
dip1_present = true;
231-
}
232222

233223
let mut state = LedmatrixState {
234224
grid: percentage(0),
@@ -241,9 +231,7 @@ fn main() -> ! {
241231
pwm_freq: PwmFreqArg::P29k,
242232
debug_mode: false,
243233
};
244-
if dip1_present {
245-
state.debug_mode = dip1.is_high().unwrap();
246-
}
234+
state.debug_mode = dip1.is_low().unwrap();
247235
if !show_startup_animation(&state) {
248236
// If no startup animation, render another pattern
249237
// Lighting up every second column is a good pattern to test for noise.
@@ -294,9 +282,7 @@ fn main() -> ! {
294282
loop {
295283
last_sleep_reason = sleep_reason;
296284

297-
if dip1_present {
298-
state.debug_mode = dip1.is_high().unwrap();
299-
}
285+
state.debug_mode = dip1.is_low().unwrap();
300286
if sleep_present {
301287
// Go to sleep if the host is sleeping
302288
let host_sleeping = sleep.is_low().unwrap();

0 commit comments

Comments
 (0)