summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/modesp.c
diff options
context:
space:
mode:
Diffstat (limited to 'esp8266/modesp.c')
-rw-r--r--esp8266/modesp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/esp8266/modesp.c b/esp8266/modesp.c
index 44401d3a61..885e7ae95e 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);