File tree Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Expand file tree Collapse file tree 2 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -583,7 +583,7 @@ STATIC mp_obj_t esp_flash_read(mp_obj_t offset_in, mp_obj_t len_or_buf_in) {
583
583
if (alloc_buf ) {
584
584
m_del (byte , buf , len );
585
585
}
586
- nlr_raise ( mp_obj_new_exception_arg1 ( & mp_type_OSError , MP_OBJ_NEW_SMALL_INT ( res == SPI_FLASH_RESULT_TIMEOUT ? MP_ETIMEDOUT : MP_EIO )) );
586
+ mp_raise_OSError ( res == SPI_FLASH_RESULT_TIMEOUT ? MP_ETIMEDOUT : MP_EIO );
587
587
}
588
588
STATIC MP_DEFINE_CONST_FUN_OBJ_2 (esp_flash_read_obj , esp_flash_read );
589
589
@@ -598,9 +598,7 @@ STATIC mp_obj_t esp_flash_write(mp_obj_t offset_in, const mp_obj_t buf_in) {
598
598
if (res == SPI_FLASH_RESULT_OK ) {
599
599
return mp_const_none ;
600
600
}
601
- nlr_raise (mp_obj_new_exception_arg1 (
602
- & mp_type_OSError ,
603
- MP_OBJ_NEW_SMALL_INT (res == SPI_FLASH_RESULT_TIMEOUT ? MP_ETIMEDOUT : MP_EIO )));
601
+ mp_raise_OSError (res == SPI_FLASH_RESULT_TIMEOUT ? MP_ETIMEDOUT : MP_EIO );
604
602
}
605
603
STATIC MP_DEFINE_CONST_FUN_OBJ_2 (esp_flash_write_obj , esp_flash_write );
606
604
@@ -610,9 +608,7 @@ STATIC mp_obj_t esp_flash_erase(mp_obj_t sector_in) {
610
608
if (res == SPI_FLASH_RESULT_OK ) {
611
609
return mp_const_none ;
612
610
}
613
- nlr_raise (mp_obj_new_exception_arg1 (
614
- & mp_type_OSError ,
615
- MP_OBJ_NEW_SMALL_INT (res == SPI_FLASH_RESULT_TIMEOUT ? MP_ETIMEDOUT : MP_EIO )));
611
+ mp_raise_OSError (res == SPI_FLASH_RESULT_TIMEOUT ? MP_ETIMEDOUT : MP_EIO );
616
612
}
617
613
STATIC MP_DEFINE_CONST_FUN_OBJ_1 (esp_flash_erase_obj , esp_flash_erase );
618
614
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_0(os_uname_obj, os_uname);
74
74
#if MICROPY_VFS_FAT
75
75
mp_obj_t vfs_proxy_call (qstr method_name , mp_uint_t n_args , const mp_obj_t * args ) {
76
76
if (MP_STATE_PORT (fs_user_mount )[0 ] == NULL ) {
77
- nlr_raise ( mp_obj_new_exception_arg1 ( & mp_type_OSError , MP_OBJ_NEW_SMALL_INT ( MP_ENODEV )) );
77
+ mp_raise_OSError ( MP_ENODEV );
78
78
}
79
79
80
80
mp_obj_t meth [n_args + 2 ];
You can’t perform that action at this time.
0 commit comments