parent
39340ea11f
commit
ff44507e26
7
main.c
7
main.c
|
@ -9,3 +9,10 @@
|
||||||
#define CLKINT (1 << 2) // Bit 2 of CSR to specify CPU clock
|
#define CLKINT (1 << 2) // Bit 2 of CSR to specify CPU clock
|
||||||
#define CLOCK_HZ 16000000 // Clock frequency of EK-TM4C123GXL
|
#define CLOCK_HZ 16000000 // Clock frequency of EK-TM4C123GXL
|
||||||
#define SYSTICK_RELOAD_VALUE(us) ((CLOCK_HZ / 1000000) * (us) - 1) // SysTick reload value in microseconds based on clock frequency
|
#define SYSTICK_RELOAD_VALUE(us) ((CLOCK_HZ / 1000000) * (us) - 1) // SysTick reload value in microseconds based on clock frequency
|
||||||
|
|
||||||
|
void systick_setting(void)
|
||||||
|
{
|
||||||
|
STRELOAD = SYSTICK_RELOAD_VALUE(1000); // RELOAD VALUE FOR 1ms
|
||||||
|
STCTRL |= ENABLE | CLKINT; // Enable SysTick with system clock
|
||||||
|
STCURRENT = 0; // Clear current value
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue