nuttx/arch/arm
Brunocor26 53ef7c0635 arch/arm/rp23xx: Fix PWM frequency and duty cycle calculation.
Fixed three bugs in the RP23XX PWM driver:

* setup_period: The previous divisor calculation used integer arithmetic
  that caused overflow and loss of precision. The divider is now computed
  as a 16-bit fixed-point value (div16) using 64-bit arithmetic, and
  clamped to the valid hardware range (0x10 to 0xFFF).

* setup_pulse: The compare value was incorrectly scaled by TOP instead
  of 65535, producing wrong duty cycles. The formula is now corrected
  to ((duty * (top + 1)) / 65535) with an overflow guard.

* pwm_start: The driver was not updated as part of the breaking change
  introduced in commit 4df80e19 ("!drivers/pwm: remove PWM_MULTICHAN
  option"). Access to single channel API is now info->channels[0].duty
  instead of info[0].duty.

Signed-off-by: Brunocor26 <bruno.correia@ubi.pt>
2026-05-25 10:29:17 +08:00
..
include arch/arm/stm32n6: Add STM32N6 chip support. 2026-05-18 14:50:29 -03:00
src arch/arm/rp23xx: Fix PWM frequency and duty cycle calculation. 2026-05-25 10:29:17 +08:00
CMakeLists.txt arch/arm: migrate to SPDX identifier 2024-12-06 09:25:23 +08:00
Kconfig arch/arm/stm32n6: Add STM32N6 chip support. 2026-05-18 14:50:29 -03:00