Hello,I cant see how the following code dmaking a delay?
We have SysTick iterrupt which i dont know what it means.
What is the meaning of SysTick_Config(CMU_ClockFreqGet(cmuClock_CORE)?
Thanks.
We have SysTick iterrupt which i dont know what it means.
What is the meaning of SysTick_Config(CMU_ClockFreqGet(cmuClock_CORE)?
Thanks.
Code:
#include <stdint.h>
#include <stdbool.h>
#include "em_device.h"
#include "em_chip.h"
#include "em_cmu.h"
#include "em_emu.h"
#include "bsp.h"
#include "bsp_trace.h"
void SysTick_Handler(void)
{
msTicks++; /* increment counter necessary in Delay()*/
}
void Delay(uint32_t dlyTicks)
{
uint32_t curTicks;
curTicks = msTicks;
while ((msTicks - curTicks) < dlyTicks) ;
}
int main(void)
{
/* Chip errata */
CHIP_Init();
CMU_ClockEnable(cmuClock_GPIO,true);
/* Setup SysTick Timer for 1 msec interrupts */
if (SysTick_Config(CMU_ClockFreqGet(cmuClock_CORE) / 1000)) {
while (1) ;
}
}