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 drivers: pwm: add Renesas R-Car driver 2022-09-07 15:50:49 +02:00
Kconfig drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
Kconfig.b91 drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.esp32 drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.gd32 drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.gecko drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.imx drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.it8xxx2 drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.litex drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.mcux drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.mcux_ftm drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.mcux_pwt drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.mcux_sctimer drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.mcux_tpm drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.npcx drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.nrf5_sw drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.nrfx drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.rcar drivers: pwm: add Renesas R-Car driver 2022-09-07 15:50:49 +02:00
Kconfig.rpi_pico drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.rv32m1_tpm drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.sam drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.sam0 drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.sifive drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
Kconfig.stm32 drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.test drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.xec drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
Kconfig.xlnx drivers: pwm: Update drivers to use devicetree Kconfig symbol 2022-07-22 07:50:44 -05:00
pwm_b91.c drivers: pwm: Use a common initialization priority 2022-10-03 15:24:38 -04:00
pwm_capture.c includes: prefer <zephyr/kernel.h> over <zephyr/zephyr.h> 2022-09-05 16:31:47 +02:00
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 drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
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 drivers: migrate includes to <zephyr/...> 2022-05-06 19:58:21 +02:00
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