Skip to content

Commit 2007a62

Browse files
committed
Merge pull request #1202 from vdorr/lib-1.5
modified analogWrite to wait for end of conversion
2 parents a71e46f + 2f4ce97 commit 2007a62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hardware/arduino/sam/cores/arduino/wiring_analog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ void analogWrite(uint32_t ulPin, uint32_t ulValue) {
243243

244244
// Write user value
245245
ulValue = mapResolution(ulValue, _writeResolution, DACC_RESOLUTION);
246-
while ((dacc_get_interrupt_status(DACC_INTERFACE) & DACC_ISR_TXRDY) == 0);
247246
dacc_write_conversion_data(DACC_INTERFACE, ulValue);
247+
while ((dacc_get_interrupt_status(DACC_INTERFACE) & DACC_ISR_EOC) == 0);
248248
return;
249249
}
250250
}

0 commit comments

Comments
 (0)