summaryrefslogtreecommitdiff
path: root/ports/stm
diff options
context:
space:
mode:
authorScott Shawcroft <scott@tannewt.org>2020-08-21 11:13:53 -0700
committerScott Shawcroft <scott@tannewt.org>2020-08-21 11:13:53 -0700
commita5b01f73612f23407d059879664834b40441f34e (patch)
treefbb1bde1cb5967de27a7bcecb755b1b19f5f36fd /ports/stm
parent6857f984269149b46d1cd4283506420f341b2601 (diff)
parent988e5caafc0866de6593d99632622a8fe62a9a9c (diff)
Merge remote-tracking branch 'adafruit/main' into add_pwmio
Diffstat (limited to 'ports/stm')
-rw-r--r--ports/stm/common-hal/pulseio/PulseOut.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/ports/stm/common-hal/pulseio/PulseOut.c b/ports/stm/common-hal/pulseio/PulseOut.c
index fb48561d8..3bf23ad14 100644
--- a/ports/stm/common-hal/pulseio/PulseOut.c
+++ b/ports/stm/common-hal/pulseio/PulseOut.c
@@ -113,7 +113,15 @@ void pulseout_reset() {
}
void common_hal_pulseio_pulseout_construct(pulseio_pulseout_obj_t* self,
- const pwmio_pwmout_obj_t* carrier) {
+ const pwmio_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"));
+ }
+
// Add to active PulseOuts
refcount++;
TIM_TypeDef * tim_instance = stm_peripherals_find_timer();