Now I can run the code (blink LED) normally, but this time there's always a pop-up whenever I pause the program, saying that it doesn't know which part of the source code it is currently at (screenshot is attached). I suspect it's because of the while statement in the delay function, but still I find this odd. Is this actually normal? I attached my main.c below
Code: Select all
#include "asf.h"
volatile uint32_t g_ul_ms_ticks = 0;
static void SysTick_Handler(void){
g_ul_ms_ticks++;
}
void mdelay(uint32_t ul_dly_ticks){
uint32_t ul_cur_ticks;
int a = 0;
ul_cur_ticks = g_ul_ms_ticks;
while ((g_ul_ms_ticks - ul_cur_ticks) < ul_dly_ticks);
}
int main (void)
{
sysclk_init();
board_init();
if (SysTick_Config(sysclk_get_cpu_hz() / 1000)) {
//Systick configuration error
while (1);
}
while(1)
{
gpio_set_pin_low(PIO_PA14_IDX);
mdelay(1000);
gpio_set_pin_high(PIO_PA14_IDX);
mdelay(1000);
}
}