diff options
author | Matthijs Kooijman <matthijs@stdin.nl> | 2015-07-30 17:54:32 +0200 |
---|---|---|
committer | Matthijs Kooijman <matthijs@stdin.nl> | 2015-07-31 14:06:20 +0200 |
commit | 303ebdb0ccbc13dec765f1ce7ca681d73a7e9b90 (patch) | |
tree | 6e299ad815e577436c58612dd28cb19b6f68b88a /bootloaders/optiboot/optiboot.c | |
parent | 31e0c941240f2b1d0e4f97d6e65d3a1ad66fbae5 (diff) |
Prevent losing bytes in HardwareSerial::end()
end() already waited for the buffer to be empty, but then there could
still be two bytes in the hardware registers that still need to be
transmitted (which were dropped or kept in the buffer, depending on the
exact timing).
This changes the wait loop to a call to the flush() function, which
already takes care of really waiting for all bytes to be transmitted,
meaning it is safe to turn off the transmitter.
Diffstat (limited to 'bootloaders/optiboot/optiboot.c')
0 files changed, 0 insertions, 0 deletions