summaryrefslogtreecommitdiff
path: root/shared-bindings/microcontroller/Pin.c
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2018-07-31 19:09:10 -0400
committerGitHub <noreply@github.com>2018-07-31 19:09:10 -0400
commit761f9a938e3b8f8ddadc5b16687126c92a68cdd4 (patch)
treec1a43903e4b29fc537f4d373e4f826b469177f0d /shared-bindings/microcontroller/Pin.c
parentbf033123a7fa75394fd7a01d17ec99afd9abe645 (diff)
parent0bf999f52a50590f4c660df41aa979f39da04c38 (diff)
Merge pull request #1075 from tannewt/more_mp_raise
Use more mp_raise_* to save 28 bytes code size.
Diffstat (limited to 'shared-bindings/microcontroller/Pin.c')
-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);
}
}