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