From 4f2ba9fbdcbafd7ae09199186320f4173bcc8c31 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 10 May 2016 23:25:39 +0100 Subject: 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. --- esp8266/modesp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'esp8266/modesp.c') 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 #include #include -#include #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); -- cgit v1.2.3