* Fix bug when read returns -1
When the socket down the "read" function returns -1.
Then the while(read_byte > 0) only works for signed types.
* Remove printf debug line
Support for using the MAC timer, a NMI with a higher priority than the
maskable interrupts, but with similar practical limitations to the MAC layer
handler.
A hostname is also useful in AP mode, so also default it in AP mode -
it was previously only defaulted in station mode.
Correct the host redirection logic, to work when no hostname is defined.
Remove the wificfg_got_sta_connect() function and replace it with
wificfg_wait_until_sta_connected(). This replaces a probe function with a wait
function, and this better fits the wifi layer using an event model - the wait
function can wait on a station connection event before returning.
The shutdown hooks are call when the wificfg restart function is used. It can
be used to implement a cleaner restart, for example blocking further i2c and
flash operations.
This also redefines the timeout in FreeRTOS clock ticks, and implements a two
stage wait: firstly spinning sampling frequently, and then falling back to a
longer wait while sampling less frequently and yielding.
This patch fixes the problem, while receiving R1b type of response from the card.
In case of R1b response the continuous stream that the card sends must be checked whether the signal indicates busy status and wait until a non zero response.
The issue was found by using f_mkdir("directory_name").
The function always returned FR_DISK_ERR due to an unhadled case in sdio_write_sectors().
According to this documentation: http://www.convict.lu/pdf/ProdManualSDCardv1.9.pdf#page=92 stop transmission command should be sent after writing multiple blocks.
This patch fixes this bug also adds a test case for it.
Look-up tables were used for determining the delay loop counts before.
Based on these hand-tuned values, the loop overhead was estimated for
each option -- 80 and 160 MHz, fast and slow GPIO access. Instead of the
great number of tunable parameters one now only has to tune the overhead
values if the code is changed.
Functions were added to the API which allow setting an arbitrary
frequency. API backward compatibility is retained.
i2c: fix potential overflow situation