File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
libraries/Bluefruit52Lib/examples/Hardware/hw_systick Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 13
13
*********************************************************************/
14
14
#include < Arduino.h>
15
15
16
+ // Interval between systick event
17
+ #define TICK_INTERVAL_MS 50
18
+
16
19
// Note: Extern "C" is required since all the IRQ hardware handler is
17
20
// declared as "C function" within the startup (assembly) file.
18
21
// Without it, our SysTick_Handler will be declared as "C++ function"
@@ -37,8 +40,15 @@ void SysTick_Handler(void)
37
40
38
41
void setup ()
39
42
{
40
- // Set up systick to fire 10 times per second
41
- SysTick_Config (F_CPU/10 );
43
+ /* Input parameter is number of ticks between interrupts handler i.e SysTick_Handler
44
+ * 1000 ms --> F_CPU ticks
45
+ * T ms --> (F_CPU/1000)*T ticks
46
+ *
47
+ * Note: Since systick is 24-bit timer, the max tick value is 0xFFFFFF, F_CPU = 64 Mhz
48
+ * --> our Tmax = 0xFFFFFF/64000 ~ 262 ms
49
+ */
50
+
51
+ SysTick_Config ( (F_CPU/1000 )*TICK_INTERVAL_MS );
42
52
}
43
53
44
54
void loop ()
You can’t perform that action at this time.
0 commit comments