Skip to content

Instantly share code, notes, and snippets.

@jefftenney
jefftenney / lptimTick.c
Last active January 19, 2026 18:00
No-Drift FreeRTOS tick/tickless for STM32 via LPTIM
// The original github gist for lptimTick.c is no longer maintained. It grew into a
// full-fledged repository, https://github.com/jefftenney/LPTIM-Tick/, which integrates
// lptimTick.c into a project for the STM32L476.
//
// Another repo, https://github.com/jefftenney/LPTIM-Tick-U5/, integrates a newer
// version of lptimTick.c into a project for STM32U585. The newer version of
// lptimTick.c supports the newest revision of the LPTIM timer silicon.
//
// Thus there are two actively maintained versions of lptimTick.c, and you must choose
// the correct one for your LPTIM silicon: