summaryrefslogtreecommitdiff
path: root/ports/nrf
diff options
context:
space:
mode:
authorLucian Copeland <hierophect@gmail.com>2020-08-14 16:33:24 -0400
committerLucian Copeland <hierophect@gmail.com>2020-08-14 16:36:02 -0400
commit0fc730bc5aeab1187a0b175aa4d390c0e7da7e1b (patch)
treee0bc8d2e5034223c31375dc697befbe884ccb15f /ports/nrf
parent88fcc19e24597140fb3e5f45ab8d87705fb4f5ed (diff)
Expand PulseOut API, debug cleanup
Diffstat (limited to 'ports/nrf')
-rw-r--r--ports/nrf/common-hal/pulseio/PulseOut.c10
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();
}