Skip to content

Commit aa93097

Browse files
committed
revise to use mp_raise_msg insead of nlr_raise....
1 parent d6c2694 commit aa93097

File tree

1 file changed

+3
-2
lines changed
  • shared-module/bitbangio

1 file changed

+3
-2
lines changed

shared-module/bitbangio/I2C.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "py/mperrno.h"
2929
#include "py/nlr.h"
3030
#include "py/obj.h"
31+
#include "py/runtime.h"
3132

3233
#include "common-hal/microcontroller/Pin.h"
3334
#include "shared-bindings/microcontroller/__init__.h"
@@ -54,8 +55,8 @@ STATIC void scl_release(bitbangio_i2c_obj_t *self) {
5455
common_hal_mcu_delay_us(1);
5556
}
5657
if(count==0) { /// raise exception on timeout
57-
nlr_raise(mp_obj_new_exception_msg(&mp_type_TimeoutError,
58-
"Clock Stretching Timeout."));
58+
mp_raise_msg(&mp_type_TimeoutError,
59+
"Clock Stretching Timeout.");
5960
}
6061
}
6162

0 commit comments

Comments
 (0)