Skip to content

Commit ac2255b

Browse files
vdorrcmaglie
authored andcommitted
modified analogWrite to wait for end of conversion
1 parent 14893f5 commit ac2255b

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)