Skip to content

Commit 6546df0

Browse files
committed
UNO R4: add function to restore P214/P215 input capability
The function is not being called by default since the pins are unused on both Minima and WiFi. A third party, however, can just call it inside initVariant() to enable the pins
1 parent 9a838ba commit 6546df0

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Diff for: variants/MINIMA/variant.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ void usb_post_initialization() {
7979
((R_USB_FS0_Type*)R_USB_FS0_BASE)->USBMC_b.VDCEN = 1;
8080
}
8181

82+
void enableSubclockInputPins() {
83+
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_CGC);
84+
R_SYSTEM->SOSCCR_b.SOSTP = 1;
85+
R_BSP_RegisterProtectEnable(BSP_REG_PROTECT_CGC);
86+
}
8287

8388
void initVariant() {
8489
// bootloader configures LED_BUILTIN as PWM output, deconfigure it to avoid spurious signals

Diff for: variants/UNOWIFIR4/variant.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ void usb_post_initialization() {
108108
((R_USB_FS0_Type*)R_USB_FS0_BASE)->USBMC_b.VDCEN = 1;
109109
}
110110

111+
void enableSubclockInputPins() {
112+
R_BSP_RegisterProtectDisable(BSP_REG_PROTECT_CGC);
113+
R_SYSTEM->SOSCCR_b.SOSTP = 1;
114+
R_BSP_RegisterProtectEnable(BSP_REG_PROTECT_CGC);
115+
}
116+
111117
void initVariant() {
112118
__maybe_start_usb();
113119
// bootloader configures LED_BUILTIN as PWM output, deconfigure it to avoid spurious signals

0 commit comments

Comments
 (0)