Commit 36bd1077 authored by Damien George's avatar Damien George
Browse files

stmhal: In SysTick IRQ handler, make uwTick variable non-volatile.

uwTick can only change in the SysTick IRQ so this IRQ function does not
need to take special care with this variable.  It's important to make
this IRQ function as efficient as possible.
parent e99e6c88
...@@ -261,7 +261,10 @@ void SysTick_Handler(void) { ...@@ -261,7 +261,10 @@ void SysTick_Handler(void) {
// Instead of calling HAL_IncTick we do the increment here of the counter. // Instead of calling HAL_IncTick we do the increment here of the counter.
// This is purely for efficiency, since SysTick is called 1000 times per // This is purely for efficiency, since SysTick is called 1000 times per
// second at the highest interrupt priority. // second at the highest interrupt priority.
extern __IO uint32_t uwTick; // Note: we don't need uwTick to be declared volatile here because this is
// the only place where it can be modified, and the code is more efficient
// without the volatile specifier.
extern uint32_t uwTick;
uwTick += 1; uwTick += 1;
// Read the systick control regster. This has the side effect of clearing // Read the systick control regster. This has the side effect of clearing
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment