From 0bf999f52a50590f4c660df41aa979f39da04c38 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 31 Jul 2018 13:39:12 -0700 Subject: Use more mp_raise_* to save 28 bytes code size. --- shared-bindings/microcontroller/Pin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'shared-bindings/microcontroller') 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); } } -- cgit v1.2.3