Skip to content

Commit 91d896f

Browse files
committed
RP2040: don't expose MSC interface when resetting via 1200bps touch
1 parent d3b66c3 commit 91d896f

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

Diff for: variants/NANO_RP2040_CONNECT/double_tap_usb_boot.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ extern "C" {
33
#include "pico/time.h"
44
#include "pico/bootrom.h"
55
}
6+
#include "macros.h"
7+
#include "pins_arduino.h"
68

79
// Allow user override of the LED mask
810
#ifndef USB_BOOT_LED_ACTIVITY_MASK
@@ -33,7 +35,7 @@ static void boot_double_tap_check() {
3335
}
3436

3537
magic_location[0] = 0;
36-
reset_usb_boot(USB_BOOT_LED_ACTIVITY_MASK, 0);
38+
reset_usb_boot(digitalPinToPinName(LED_BUILTIN), 0);
3739
}
3840

3941
class DoubleTap {

Diff for: variants/NANO_RP2040_CONNECT/variant.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ uint8_t getUniqueSerialNumber(uint8_t* name) {
9191
}
9292

9393
void _ontouch1200bps_() {
94-
reset_usb_boot(0, 0);
94+
reset_usb_boot(digitalPinToPinName(LED_BUILTIN), 1);
9595
}
9696

9797
#endif

Diff for: variants/RASPBERRY_PI_PICO/double_tap_usb_boot.cpp

+3-6
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ extern "C" {
33
#include "pico/time.h"
44
#include "pico/bootrom.h"
55
}
6-
7-
// Allow user override of the LED mask
8-
#ifndef USB_BOOT_LED_ACTIVITY_MASK
9-
#define USB_BOOT_LED_ACTIVITY_MASK 1
10-
#endif
6+
#include "macros.h"
7+
#include "pins_arduino.h"
118

129
// Doesn't make any sense for a RAM only binary
1310
#if !PICO_NO_FLASH
@@ -33,7 +30,7 @@ static void boot_double_tap_check() {
3330
}
3431

3532
magic_location[0] = 0;
36-
reset_usb_boot(USB_BOOT_LED_ACTIVITY_MASK, 0);
33+
reset_usb_boot(LED_BUILTIN, 0);
3734
}
3835

3936
class DoubleTap {

Diff for: variants/RASPBERRY_PI_PICO/variant.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ uint8_t getUniqueSerialNumber(uint8_t* name) {
8080
}
8181

8282
void _ontouch1200bps_() {
83-
reset_usb_boot(0, 0);
83+
reset_usb_boot(digitalPinToPinName(LED_BUILTIN), 1);
8484
}
8585

8686
#endif

0 commit comments

Comments
 (0)