aboutsummaryrefslogtreecommitdiff
path: root/shared-bindings/microcontroller
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2018-07-31 13:39:12 -0700
committerScott Shawcroft <scott@tannewt.org>2018-07-31 13:50:48 -0700
commit0bf999f52a50590f4c660df41aa979f39da04c38 (patch)
tree4a34f433c428351c0a6be0033dc5235c8f29fbbd /shared-bindings/microcontroller
parent4e7eee3553665116e625891d01f9ea89c527a24a (diff)
Use more mp_raise_* to save 28 bytes code size.
Diffstat (limited to 'shared-bindings/microcontroller')
-rw-r--r--shared-bindings/microcontroller/Pin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/shared-bindings/microcontroller/Pin.c b/shared-bindings/microcontroller/Pin.c
index fd5285192..33bd43347 100644
--- a/shared-bindings/microcontroller/Pin.c
+++ b/shared-bindings/microcontroller/Pin.c
@@ -30,6 +30,7 @@
#include "py/nlr.h"
#include "py/obj.h"
+#include "py/runtime.h"
//| .. currentmodule:: microcontroller
//|
@@ -74,7 +75,7 @@ const mp_obj_type_t mcu_pin_type = {
void assert_pin(mp_obj_t obj, bool none_ok) {
if ((obj != mp_const_none || !none_ok) && !MP_OBJ_IS_TYPE(obj, &mcu_pin_type)) {
- nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "Expected a %q", mcu_pin_type.name));
+ mp_raise_TypeError_varg("Expected a %q", mcu_pin_type.name);
}
}