zephyr/drivers
Andy Ross 0baf72e1c7 drivers/timer/nrf_rtc_timer: Fix round-up for rapid tick rates
When the tick rate was less than MIN_DELAY, bumping a "too soon"
expiration by just one tick may not be enough and we could
theoretically miss the counter.

Instead, eliminate the MIN_DELAY computation and write to the spec:
NRF guarantees that the RTC will generate an interrupt for a
comparator value two cycles in the future.  And further, we can test
at the set point to see if we "just missed" the interrupt (i.e. zero
cycles delay) and flag a synchronous interrupt.  So we only need to
miss a requested interrupt now for the special case of exactly one
cycle in the future, and then we're only late by one cycle.  That's
optimal.

Also fixes an off-by-one in the next cycle computation.  By API
convention, an ticks argument of one or less means "at the next tick"
and not "right now".  So we need to add one to the target cycle to
avoid incorrectly triggering a synchronous interrupt.  This was a
non-issue when a tick is longer than a hardware cycle but is needed
now.

Also handles the edge case with zero latency interrupts (which are
unmaskable) which might mess up timing.  This was always a problem,
but we're more sensitive now and it's comparatively more likely to
occur.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2019-07-02 22:52:29 -04:00
..
adc shell: adc: adc shell for testing adcs 2019-06-28 10:07:18 -05:00
aio cleanup: include/: move aio_comparator.h to drivers/aio_comparator.h 2019-06-27 22:55:49 -04:00
audio cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
bluetooth Bluetooth: Introduce separate pool for discardable events 2019-07-01 16:36:15 +03:00
can drivers: can: stm32: Update enable driver help message 2019-07-02 18:57:23 -04:00
clock_control drivers: clock_control: nrf: Add option to use external LF source 2019-07-02 12:58:06 +02:00
console cleanup: include/: move misc/printk.h to sys/printk.h 2019-06-27 22:55:49 -04:00
counter drivers: counter: Add NXP MCUX GPT counter driver 2019-07-01 11:53:07 -05:00
crypto cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
display cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
dma cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
entropy cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
ethernet cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
flash cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
gpio cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
hwinfo cleanup: include/: move misc/printk.h to sys/printk.h 2019-06-27 22:55:49 -04:00
i2c cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
i2s cleanup: include/: move misc/__assert.h to sys/__assert.h 2019-06-27 22:55:49 -04:00
ieee802154 cleanup: include/: move misc/byteorder.h to sys/byteorder.h 2019-06-27 22:55:49 -04:00
interrupt_controller arch/x86: eliminate include/arch/x86/irq_controller.h 2019-07-02 19:30:00 -04:00
ipm cleanup: include/: move misc/printk.h to sys/printk.h 2019-06-27 22:55:49 -04:00
led cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
led_strip cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
modem cleanup: include/: move misc/printk.h to sys/printk.h 2019-06-27 22:55:49 -04:00
net cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
neural_net cleanup: include/: move gna.h to drivers/gna.h 2019-06-27 22:55:49 -04:00
pci cleanup: include/: move misc/printk.h to sys/printk.h 2019-06-27 22:55:49 -04:00
pcie drivers/pcie/shell: add basic probe for MSI-X capability 2019-06-10 10:52:02 -04:00
pinmux cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
ptp_clock net: ptp: clock: Add usermode support to ptp_clock_get() 2019-06-25 15:22:51 +03:00
pwm cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
rtc cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
sensor drivers: sensor: temp_nrf5: Code cleanup 2019-07-02 15:54:25 -04:00
serial cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
spi cleanup: include/: move misc/util.h to sys/util.h 2019-06-27 22:55:49 -04:00
timer drivers/timer/nrf_rtc_timer: Fix round-up for rapid tick rates 2019-07-02 22:52:29 -04:00
usb usb_dc_stm32: Don't update ret_bytes if send fails in usb_dc_ep_write() 2019-07-02 19:05:37 -04:00
watchdog drivers: watchdog: mcux_wdog32: add driver for the NXP Kinetis WDOG32 2019-07-02 18:00:16 -05:00
wifi wifi: eswifi: Implement TCP listen/accept 2019-07-02 09:08:59 +03:00
CMakeLists.txt net: ptp: clock: Add usermode support to ptp_clock_get() 2019-06-25 15:22:51 +03:00
Kconfig uart/ns16550, drivers/pcie: add PCI(e) support 2019-04-17 10:50:05 -07:00