We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9389438 commit 6ff60a3Copy full SHA for 6ff60a3
targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/pwmout_api.c
@@ -295,9 +295,9 @@ void pwmout_period_us(pwmout_t *obj, int period)
295
void pwmout_pulsewidth(pwmout_t *obj, float pulse)
296
{
297
DEBUG_PRINTF("pwmout_pulsewidt: %f\r\n", pulse);
298
-
+
299
/* Cap pulsewidth to period before setting it. */
300
- if ((pulse * 1000000) > (float) (obj->pulse & ~SEQ_POLARITY_BIT)) {
+ if ((pulse * 1000000) > (float) obj->period) {
301
obj->pulse &= SEQ_POLARITY_BIT;
302
obj->pulse |= obj->period;
303
pwmout_pulsewidth_us(obj, obj->pulse);
@@ -354,4 +354,3 @@ const PinMap *pwmout_pinmap()
354
}
355
356
#endif // DEVICE_PWMOUT
357
0 commit comments