The commit ebdd2f9 defined some offsets to differentiate between the
standard, socket and file descriptors.
SPIFFS_FILEHDL_OFFSET was updated accordingly but the code didn't use
that constant and this broke the SPIFFS POSIX API.
Fix it by initializing the fh_ix_offset field of the spiffs_config
structure to SPIFFS_FILEHDL_OFFSET.
This patch gets the newlib standard stream descriptors playing well with the
lwip socket descriptors and the spiffs file descriptors. The LWIP_SOCKET_OFFSET
is now defined to be 3, rather than zero, to avoid clashing with the standard
stream descriptors, and the SPIFFS_FILEHDL_OFFSET is bumped up to start after
the lwip descriptors.
Original work by @ourairquality
* Sysparam threadsafe and SPI access
* Sysparam test cases
* Fix for negative int8
* Sysparam getting bool without memory allocation. Bool tests.
* SPI flash refactoring.
* Extract common spiflash.c into core.
* Use spiflash.c in sysparam.
* Use memcpy in spiflash.c insted of hand-written version.
* Tests for spiflash.c
* Allow changing write function of stdout.
Required for stdout redirection.
Works on blocks, not chars - does _not_ use sdk_os_putc !
Should work even when linking with SPIFFS.