afd47d58ac
This commit makes the low-level flash C functions usable by code other than flashbdev.c (eg by mboot). Changes in this commit are: - flash_erase() and flash_write() now return an errno error code, a negative value on error. - flash_erase() now automatically locks the flash, as well as unlocking it. - flash_write() now automatically unlocks the flash, as well as locking it. - flashbdev.c is modified for the above changes. Signed-off-by: Damien George <damien@micropython.org>