Raspberry Pi port, piCore-17.0 is available!
The second sleep is not needed, sync does not return until all file have been written.