This section walks you through the startup sequence of an ASF4 project. This system initialization sequence relies mainly on root level files, which are described in more detail in Root Level Files.
An empty ASF4 project, generated from Atmel START will contain only the atmel_start_init() function in main().
int main(void) { atmel_start_init(); /* Replace with your application code */ while(1) { } }
void system_init(void)
{
system_init();
temperature_sensors_init();
}
The system_init() function is implemented in driver_init.c and:
initializes the MCU (oscillators, clocks, flash wait states, etc.) using the init_mcu() function
initializes the peripherals, which have been selected (in our case the USART), using the USART_0_init() function
void system_init(void) { init_mcu(); USART_0_init(); }
The different initialization functions which are called in system_init(), use the configuration’s parameters that the user has selected during the Atmel START configuration process.