Skip to content

Commit 4805ca6

Browse files
manchozpolldo
authored andcommitted
Set PWMs state to DISABLE at init
1 parent e55978e commit 4805ca6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

variants/ARDUINO_NANO33BLE/variant.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ void initVariant() {
8181

8282
digitalWrite(PIN_ENABLE_SENSORS_3V3, HIGH);
8383
digitalWrite(PIN_ENABLE_I2C_PULLUP, HIGH);
84+
85+
NRF_PWM_Type* PWM[] = {
86+
NRF_PWM0, NRF_PWM1, NRF_PWM2
87+
#ifdef NRF_PWM3
88+
,NRF_PWM3
89+
#endif
90+
};
91+
92+
for (int i = 0; i < (sizeof(PWM)/sizeof(PWM[0])); i++) {
93+
PWM[i]->ENABLE = 0;
94+
PWM[i]->PSEL.OUT[0] = 0xFFFFFFFFUL;
95+
}
8496
}
8597

8698
#ifdef SERIAL_CDC
@@ -111,4 +123,4 @@ void _ontouch1200bps_() {
111123
NVIC_SystemReset();
112124
}
113125

114-
#endif
126+
#endif

0 commit comments

Comments
 (0)