diff --git a/esp-hal-common/src/mcpwm/mod.rs b/esp-hal-common/src/mcpwm/mod.rs index b03823bd6d5..989d1a178b2 100644 --- a/esp-hal-common/src/mcpwm/mod.rs +++ b/esp-hal-common/src/mcpwm/mod.rs @@ -295,10 +295,10 @@ unsafe impl PwmPeripheral for PWM { match (OP, IS_A) { (0, true) => OutputSignal::PWM0_0A, (1, true) => OutputSignal::PWM0_1A, - (2, true) => OutputSignal::PWM0_1A, + (2, true) => OutputSignal::PWM0_2A, (0, false) => OutputSignal::PWM0_0B, (1, false) => OutputSignal::PWM0_1B, - (2, false) => OutputSignal::PWM0_1B, + (2, false) => OutputSignal::PWM0_2B, _ => unreachable!(), } } @@ -318,10 +318,10 @@ unsafe impl PwmPeripheral for crate::peripherals::PWM1 { match (OP, IS_A) { (0, true) => OutputSignal::PWM1_0A, (1, true) => OutputSignal::PWM1_1A, - (2, true) => OutputSignal::PWM1_1A, + (2, true) => OutputSignal::PWM1_2A, (0, false) => OutputSignal::PWM1_0B, (1, false) => OutputSignal::PWM1_1B, - (2, false) => OutputSignal::PWM1_1B, + (2, false) => OutputSignal::PWM1_2B, _ => unreachable!(), } } diff --git a/esp-hal-common/src/mcpwm/operator.rs b/esp-hal-common/src/mcpwm/operator.rs index 49086496b0e..e0541caed90 100644 --- a/esp-hal-common/src/mcpwm/operator.rs +++ b/esp-hal-common/src/mcpwm/operator.rs @@ -255,7 +255,7 @@ impl<'d, Pin: OutputPin, PWM: PwmPeripheral, const OP: u8, const IS_A: bool> } } - /// Set how a new timestamp syncs with the timer. + /// Write a new timestamp. /// The written value will take effect according to the set /// [`PwmUpdateMethod`]. #[cfg(esp32)] @@ -282,7 +282,7 @@ impl<'d, Pin: OutputPin, PWM: PwmPeripheral, const OP: u8, const IS_A: bool> #[cfg(esp32s3)] pub fn set_timestamp(&mut self, value: u16) { // SAFETY: - // We only write to our GENx_TSTMP_x register + // We only write to our CMPRx_VALUEx register let block = unsafe { &*PWM::block() }; match (OP, IS_A) { (0, true) => block.cmpr0_value0.write(|w| w.cmpr0_a().variant(value)),