diff options
| author | Lucian Copeland <hierophect@gmail.com> | 2020-08-14 16:33:24 -0400 |
|---|---|---|
| committer | Lucian Copeland <hierophect@gmail.com> | 2020-08-14 16:36:02 -0400 |
| commit | 0fc730bc5aeab1187a0b175aa4d390c0e7da7e1b (patch) | |
| tree | e0bc8d2e5034223c31375dc697befbe884ccb15f /ports/nrf | |
| parent | 88fcc19e24597140fb3e5f45ab8d87705fb4f5ed (diff) | |
Expand PulseOut API, debug cleanup
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..9f5efcfdc 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 PWM Carrier instead")); + } + if (refcount == 0) { timer = nrf_peripherals_allocate_timer_or_throw(); } |
