summaryrefslogtreecommitdiff
path: root/shared-module
diff options
context:
space:
mode:
Diffstat (limited to 'shared-module')
-rw-r--r--shared-module/bitbangio/I2C.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/shared-module/bitbangio/I2C.c b/shared-module/bitbangio/I2C.c
index ac2f9aead..8381f051a 100644
--- a/shared-module/bitbangio/I2C.c
+++ b/shared-module/bitbangio/I2C.c
@@ -28,6 +28,7 @@
#include "py/mperrno.h"
#include "py/nlr.h"
#include "py/obj.h"
+#include "py/runtime.h"
#include "common-hal/microcontroller/Pin.h"
#include "shared-bindings/microcontroller/__init__.h"
@@ -54,8 +55,8 @@ STATIC void scl_release(bitbangio_i2c_obj_t *self) {
common_hal_mcu_delay_us(1);
}
if(count==0) { /// raise exception on timeout
- nlr_raise(mp_obj_new_exception_msg(&mp_type_TimeoutError,
- "Clock Stretching Timeout."));
+ mp_raise_msg(&mp_type_TimeoutError,
+ "Clock Stretching Timeout.");
}
}