generated from PEG/EE690-EmSys-TiVA-Template
added systic handler 1
This commit is contained in:
parent
4ec5552313
commit
9c440fe641
23
main.c
23
main.c
|
@ -2,6 +2,9 @@
|
|||
#include <stdbool.h>
|
||||
#include "tm4c123gh6pm.h"
|
||||
|
||||
void Systick_Handler(void);
|
||||
void systickInit(void);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
SYSCTL_RCGC2_R |= 0x00000020; /* enable clock to GPIOF */
|
||||
|
@ -26,4 +29,22 @@ int main(void)
|
|||
|
||||
}
|
||||
|
||||
void Syst
|
||||
void systickInit()
|
||||
{
|
||||
NVIC_ST_CURRENT_R = 0;
|
||||
NVIC_ST_CTRL_R = 0x07;
|
||||
NVIC_ST_RELOAD_R = 8000000;
|
||||
}
|
||||
|
||||
void Systick_Handler()
|
||||
{
|
||||
systickInit();
|
||||
if (GPIO_PORTF_DATA_R & 0x04) {
|
||||
GPIO_PORTF_DATA_R &= ~0x04;
|
||||
|
||||
}
|
||||
else {
|
||||
GPIO_PORTF_DATA_R |= 0x04;
|
||||
}
|
||||
systickInit();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue