From a35d9b469d4ed65fd992771aa98ac57241983794 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Wed, 12 Jun 2019 01:00:59 -0700 Subject: Refactor deinit check to reduce code size. --- shared-bindings/pulseio/PulseOut.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'shared-bindings/pulseio/PulseOut.c') diff --git a/shared-bindings/pulseio/PulseOut.c b/shared-bindings/pulseio/PulseOut.c index 493b7e2ff..172459e5d 100644 --- a/shared-bindings/pulseio/PulseOut.c +++ b/shared-bindings/pulseio/PulseOut.c @@ -127,7 +127,9 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(pulseio_pulseout___exit___obj, 4, 4, //| STATIC mp_obj_t pulseio_pulseout_obj_send(mp_obj_t self_in, mp_obj_t pulses) { pulseio_pulseout_obj_t *self = MP_OBJ_TO_PTR(self_in); - raise_error_if_deinited(common_hal_pulseio_pulseout_deinited(self)); + if (common_hal_pulseio_pulseout_deinited(self)) { + raise_deinited_error(); + } mp_buffer_info_t bufinfo; mp_get_buffer_raise(pulses, &bufinfo, MP_BUFFER_READ); -- cgit v1.2.3