Skip to content
Snippets Groups Projects
Unverified Commit 5c096dd8 authored by Eric Brombaugh's avatar Eric Brombaugh Committed by GitHub
Browse files

Update README.md

parent e8305bfc
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment