diff options
author | Damien George <damien.p.george@gmail.com> | 2016-05-10 23:25:39 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-05-10 23:30:39 +0100 |
commit | 4f2ba9fbdcbafd7ae09199186320f4173bcc8c31 (patch) | |
tree | 2146c48c85567dbe715630d2dffe95fa75c50cb0 /esp8266/modesp.c | |
parent | 5ab98d5c41bffa799a551a2731d904cab346898e (diff) |
esp8266: Convert to use new MP_Exxx errno symbols.
These symbols are still defined in terms of the system Exxx symbols, and
can be switched to internal numeric definitions at a later stage.
Note that extmod/modlwip still uses many system Exxx symbols.
Diffstat (limited to 'esp8266/modesp.c')
-rw-r--r-- | esp8266/modesp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/esp8266/modesp.c b/esp8266/modesp.c index 44401d3a6..885e7ae95 100644 --- a/esp8266/modesp.c +++ b/esp8266/modesp.c @@ -27,12 +27,12 @@ #include <stdio.h> #include <string.h> #include <stdbool.h> -#include <errno.h> #include "py/nlr.h" #include "py/obj.h" #include "py/gc.h" #include "py/runtime.h" +#include "py/mperrno.h" #include "py/mphal.h" #include "netutils.h" #include "queue.h" @@ -577,7 +577,7 @@ STATIC mp_obj_t esp_flash_read(mp_obj_t offset_in, mp_obj_t len_or_buf_in) { if (alloc_buf) { m_del(byte, buf, len); } - nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(res == SPI_FLASH_RESULT_TIMEOUT ? ETIMEDOUT : EIO))); + nlr_raise(mp_obj_new_exception_arg1(&mp_type_OSError, MP_OBJ_NEW_SMALL_INT(res == SPI_FLASH_RESULT_TIMEOUT ? MP_ETIMEDOUT : MP_EIO))); } STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp_flash_read_obj, esp_flash_read); @@ -594,7 +594,7 @@ STATIC mp_obj_t esp_flash_write(mp_obj_t offset_in, const mp_obj_t buf_in) { } nlr_raise(mp_obj_new_exception_arg1( &mp_type_OSError, - MP_OBJ_NEW_SMALL_INT(res == SPI_FLASH_RESULT_TIMEOUT ? ETIMEDOUT : EIO))); + MP_OBJ_NEW_SMALL_INT(res == SPI_FLASH_RESULT_TIMEOUT ? MP_ETIMEDOUT : MP_EIO))); } STATIC MP_DEFINE_CONST_FUN_OBJ_2(esp_flash_write_obj, esp_flash_write); @@ -606,7 +606,7 @@ STATIC mp_obj_t esp_flash_erase(mp_obj_t sector_in) { } nlr_raise(mp_obj_new_exception_arg1( &mp_type_OSError, - MP_OBJ_NEW_SMALL_INT(res == SPI_FLASH_RESULT_TIMEOUT ? ETIMEDOUT : EIO))); + MP_OBJ_NEW_SMALL_INT(res == SPI_FLASH_RESULT_TIMEOUT ? MP_ETIMEDOUT : MP_EIO))); } STATIC MP_DEFINE_CONST_FUN_OBJ_1(esp_flash_erase_obj, esp_flash_erase); |