Skip to content

Commit 101e4a4

Browse files
Merge pull request sandeepmistry#188 from dsanders11/pwm-polarity
Use falling edge polarity for PWM to match standard Arduino
2 parents d21e2d4 + b619597 commit 101e4a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/nRF5/wiring_analog_nRF52.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void analogWrite( uint32_t ulPin, uint32_t ulValue )
222222
for (int i = 0; i < PWM_COUNT; i++) {
223223
if (pwmChannelPins[i] == 0xFFFFFFFF || pwmChannelPins[i] == ulPin) {
224224
pwmChannelPins[i] = ulPin;
225-
pwmChannelSequence[i] = ulValue;
225+
pwmChannelSequence[i] = ulValue | bit(15);
226226

227227
NRF_PWM_Type* pwm = pwms[i];
228228

0 commit comments

Comments
 (0)