summaryrefslogtreecommitdiff
path: root/ports/stm/common-hal/pulseio/PulseIn.c
diff options
context:
space:
mode:
authorLucian Copeland <hierophect@gmail.com>2020-07-22 14:11:00 -0400
committerLucian Copeland <hierophect@gmail.com>2020-07-22 14:22:05 -0400
commitc1f731d62e6d7bce385baec9ead3bafc46234805 (patch)
tree4952b913b22b87734a3527a75060375d80801c7b /ports/stm/common-hal/pulseio/PulseIn.c
parente232ec10ceb9c78df27cb4b5cee79079efd85d84 (diff)
Claim USB pins at startup to prevent overwrites
Diffstat (limited to 'ports/stm/common-hal/pulseio/PulseIn.c')
-rw-r--r--ports/stm/common-hal/pulseio/PulseIn.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ports/stm/common-hal/pulseio/PulseIn.c b/ports/stm/common-hal/pulseio/PulseIn.c
index 811fc8c49..4052c240f 100644
--- a/ports/stm/common-hal/pulseio/PulseIn.c
+++ b/ports/stm/common-hal/pulseio/PulseIn.c
@@ -31,6 +31,7 @@
#include "py/gc.h"
#include "py/runtime.h"
#include "shared-bindings/microcontroller/__init__.h"
+#include "shared-bindings/microcontroller/Pin.h"
#include "shared-bindings/pulseio/PulseIn.h"
#include "timers.h"
@@ -174,7 +175,7 @@ void common_hal_pulseio_pulsein_construct(pulseio_pulsein_obj_t* self, const mcu
// Interrupt starts immediately
assign_EXTI_Interrupt(self, pin->number);
HAL_NVIC_EnableIRQ(self->irq);
- claim_pin(pin);
+ common_hal_mcu_pin_claim(pin);
}
bool common_hal_pulseio_pulsein_deinited(pulseio_pulsein_obj_t* self) {