diff options
| author | Lucian Copeland <hierophect@gmail.com> | 2020-07-22 14:11:00 -0400 |
|---|---|---|
| committer | Lucian Copeland <hierophect@gmail.com> | 2020-07-22 14:22:05 -0400 |
| commit | c1f731d62e6d7bce385baec9ead3bafc46234805 (patch) | |
| tree | 4952b913b22b87734a3527a75060375d80801c7b /ports/stm/common-hal/pulseio | |
| parent | e232ec10ceb9c78df27cb4b5cee79079efd85d84 (diff) | |
Claim USB pins at startup to prevent overwrites
Diffstat (limited to 'ports/stm/common-hal/pulseio')
| -rw-r--r-- | ports/stm/common-hal/pulseio/PWMOut.c | 2 | ||||
| -rw-r--r-- | ports/stm/common-hal/pulseio/PulseIn.c | 3 | ||||
| -rw-r--r-- | ports/stm/common-hal/pulseio/PulseOut.c | 2 |
3 files changed, 4 insertions, 3 deletions
diff --git a/ports/stm/common-hal/pulseio/PWMOut.c b/ports/stm/common-hal/pulseio/PWMOut.c index 4df896feb..ddbadaf4c 100644 --- a/ports/stm/common-hal/pulseio/PWMOut.c +++ b/ports/stm/common-hal/pulseio/PWMOut.c @@ -33,7 +33,7 @@ #include "shared-bindings/microcontroller/__init__.h" #include STM32_HAL_H -#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" #include "timers.h" 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) { diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c index bf578bed2..bcc25d817 100644 --- a/ports/stm/common-hal/pulseio/PulseOut.c +++ b/ports/stm/common-hal/pulseio/PulseOut.c @@ -36,7 +36,7 @@ #include "supervisor/shared/translate.h" #include STM32_HAL_H -#include "common-hal/microcontroller/Pin.h" +#include "shared-bindings/microcontroller/Pin.h" #include "timers.h" // A single timer is shared amongst all PulseOut objects under the assumption that |
