diff --git a/examples/systick_irq/README.md b/examples/systick_irq/README.md index 26e561ef98affb57cc7e1b2b8c752c089c86b81e..9ca11cb3c225054e2fe688168274efd48eff9adf 100644 --- a/examples/systick_irq/README.md +++ b/examples/systick_irq/README.md @@ -4,11 +4,11 @@ interrupts for timing. Many bare-metal and RTOS based embedded applications will use the Systick IRQ for timing, periodic housekeeping and task arbitration so knowing how to set that up is useful. -Note that this example is *NOT* compatible with the Delay_*() functions that are -part of the ch32v003fun library - those functions use the Systick counter for -doing busy-wait delays and assume that the CNT register rolls over at 32-bit -maximum. Do not use the built-in Delay_Ms() and related functions when using -Systick for IRQs. +This code is compatible with the busywait delay functions in the ch32v003fun +library because it allows the Systick CNT register to keep running over its full +32-bit range. It does not set the STRE bit in the CTRL register so the counter +does not reset when the CMP register matches. In order to do this, the CMP register +is advanced at every IRQ. Note also the use of the `__attribute__((interrupt))` syntax in declaring the IRQ handler. Some of the IRQ examples from the WCH HAL library have slightly