diff options
| author | Scott Shawcroft <scott@adafruit.com> | 2020-08-20 11:24:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-20 11:24:08 -0700 |
| commit | 400701004b6e4e47e58db08c87c46609056d645f (patch) | |
| tree | 07179fdb71a67f43a74cbf2c212fbd5313aaad03 /ports/nrf | |
| parent | e47447ba592676c2ab57a4ae7c2aed4f7bd10004 (diff) | |
| parent | dd425ee6c54deee72d0fa7cd42282b8157a54da6 (diff) | |
Merge pull request #3279 from hierophect/esp32-pulseinout
ESP32-S2: Add PulseOut and PulseIn
Diffstat (limited to 'ports/nrf')
| -rw-r--r-- | ports/nrf/common-hal/pulseio/PulseOut.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ports/nrf/common-hal/pulseio/PulseOut.c b/ports/nrf/common-hal/pulseio/PulseOut.c index 270cb45d6..bdc5cfbef 100644 --- a/ports/nrf/common-hal/pulseio/PulseOut.c +++ b/ports/nrf/common-hal/pulseio/PulseOut.c @@ -100,7 +100,15 @@ void pulseout_reset() { } void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self, - const pulseio_pwmout_obj_t* carrier) { + const pulseio_pwmout_obj_t* carrier, + const mcu_pin_obj_t* pin, + uint32_t frequency, + uint16_t duty_cycle) { + if (!carrier || pin || frequency) { + mp_raise_NotImplementedError(translate("Port does not accept pins or frequency. \ + Construct and pass a PWMOut Carrier instead")); + } + if (refcount == 0) { timer = nrf_peripherals_allocate_timer_or_throw(); } |
