flashloader: Delay 5 seconds before reading input
When the CP2104 USB serial chip on the Feather ESP8266 board sees
the DTR line go low, it causes a reset of the ESP8266. This is
needed for software (esptool) to be able to put the ESP8266 into its
bootloader mode.
Unfortunately this means any serial connection closing causes a
reboot, which has to reset the MCP23S18, which can cause garbage on
its GPIO lines going to the DB25 port.
When sendload is used to upload flashloader, it sends the program
over and then closes the serial connection, causing the WiFiStation
to reboot at the same time flashloader is executing and looking for
input (the size of the program it's about to write to flash). This
can cause flashloader to read bogus size bytes, but then sendload is
used again to upload the actual program being written and now it's
writing the two size bytes to flash plus the entire program being
offset by 2 bytes.
To work around this, delay 5 seconds on startup to ignore any
potential changes on the ack/busy lines.