zephyr/drivers/pwm
Henrik Brix Andersen b4912ea997 drivers: pwm: mcux: ftm: fix pwm capture timer overflow count edge cases
Depending on the timing of the edges of the signal to be captured, a timer
overflow interrupt flag may appear in the same ISR as a channel event (1st
or 2nd edge capture complete) flag. Change the timer overflow math to
compensate the timer overflow count based on whether the channel event
happened before or after the overflow flag occured.

For continuous PWM period captures, only the very first edge of the first
period requires an interrupt to be captured. Subsequent "first edges" are
the same edges as the second edge of the previous period. Depending on the
timing of the captured signal, enabling the 1st edge interrupt in this case
can cause the overflow count for subsequent first edges to be captured at
the wrong point in time.

Fixes: #52452

Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
2022-12-05 08:06:44 -06:00
..
CMakeLists.txt
Kconfig drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
Kconfig.b91
Kconfig.esp32
Kconfig.gd32
Kconfig.gecko
Kconfig.imx
Kconfig.it8xxx2
Kconfig.litex
Kconfig.mcux
Kconfig.mcux_ftm
Kconfig.mcux_pwt
Kconfig.mcux_sctimer
Kconfig.mcux_tpm
Kconfig.npcx
Kconfig.nrf5_sw
Kconfig.nrfx
Kconfig.rcar
Kconfig.rpi_pico
Kconfig.rv32m1_tpm
Kconfig.sam
Kconfig.sam0
Kconfig.sifive drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
Kconfig.stm32
Kconfig.test
Kconfig.xec
Kconfig.xlnx
pwm_b91.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_capture.c
pwm_gd32.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_gecko.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_handlers.c
pwm_imx.c include: add missing kernel.h include 2022-10-11 18:05:17 +02:00
pwm_ite_it8xxx2.c ITE drivers/pwm/it8xxx2: don't gate pwm clock when set cycle 2022-12-01 15:49:37 +01:00
pwm_led_esp32.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_litex.c drivers: gpio: it8xxx2: add missing chip_chipregs.h/soc_common.h 2022-10-11 18:05:17 +02:00
pwm_mc_esp32.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_mchp_xec.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_mcux_ftm.c drivers: pwm: mcux: ftm: fix pwm capture timer overflow count edge cases 2022-12-05 08:06:44 -06:00
pwm_mcux_pwt.c include: add missing irq.h include 2022-10-11 18:05:17 +02:00
pwm_mcux_sctimer.c drivers: pwm: pwm_mcux_sctimer: Fix stopping PWM 2022-11-07 10:10:37 -06:00
pwm_mcux_tpm.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_mcux.c arm: nxp: take PWM prescaler from device tree 2022-10-03 15:04:31 -05:00
pwm_npcx.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_nrf5_sw.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_nrfx.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_rcar.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_rpi_pico.c drivers: pwm: rpi_pico: Use “pico_channel” instead of “ch” 2022-10-04 10:36:20 +02:00
pwm_rv32m1_tpm.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_sam0_tcc.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_sam.c drivers: pwm: pwm_sam: Add inverted polarity support 2022-11-02 10:33:01 +01:00
pwm_shell.c
pwm_sifive.c include: add missing arch/cpu.h include 2022-10-11 18:05:17 +02:00
pwm_stm32.c include: add missing zephyr/irq.h include 2022-10-17 22:57:39 +09:00
pwm_test.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_xlnx_axi_timer.c include: add missing arch/cpu.h include 2022-10-11 18:05:17 +02:00