Refs #1486. Added call to SystemCoreClockUpdate() at the start of Init() for all XMC1/4 demo programs.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@945 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
Frank Voorburg 2022-04-27 12:26:10 +00:00
parent 35c581ac22
commit 91aa952080
6 changed files with 26 additions and 0 deletions

View File

@ -38,6 +38,7 @@
/****************************************************************************************
* Function prototypes
****************************************************************************************/
static void Init(void);
static void PostInit(void);
@ -49,6 +50,8 @@ static void PostInit(void);
****************************************************************************************/
int main(void)
{
/* initialize the microcontroller */
Init();
/* initialize the bootloader */
BootInit();
/* post initialization of the microcontroller */
@ -60,10 +63,23 @@ int main(void)
/* run the bootloader task */
BootTask();
}
/* set program exit code. note that the program should never get here */
return 0;
} /*** end of main ***/
/************************************************************************************//**
** \brief Initializes the microcontroller.
** \return none.
**
****************************************************************************************/
static void Init(void)
{
/* ensure that SystemCoreClock variable is set */
SystemCoreClockUpdate();
} /*** end of Init ***/
/************************************************************************************//**
** \brief Post initialization of the microcontroller. Contains all initialization
** code that should run after the bootloader's core was initialized.

View File

@ -70,6 +70,8 @@ int main(void)
****************************************************************************************/
static void Init(void)
{
/* ensure that SystemCoreClock variable is set */
SystemCoreClockUpdate();
/* init the led driver */
LedInit();
/* init the timer driver */

View File

@ -73,6 +73,8 @@ void main(void)
****************************************************************************************/
static void Init(void)
{
/* ensure that SystemCoreClock variable is set */
SystemCoreClockUpdate();
} /*** end of Init ***/

View File

@ -69,6 +69,8 @@ void main(void)
****************************************************************************************/
static void Init(void)
{
/* ensure that SystemCoreClock variable is set */
SystemCoreClockUpdate();
/* init the led driver */
LedInit();
/* init the timer driver */

View File

@ -115,6 +115,8 @@ static void Init(void)
XMC_UART_CH_CONFIG_t rs232_config;
#endif
/* ensure that SystemCoreClock variable is set */
SystemCoreClockUpdate();
/* initialize LED1 on P5.9 as digital output */
XMC_GPIO_SetMode(P5_9, XMC_GPIO_MODE_OUTPUT_PUSH_PULL);
/* initialize BUTTON1 as digital input. */

View File

@ -112,6 +112,8 @@ static void Init(void)
XMC_UART_CH_CONFIG_t rs232_config;
#endif
/* ensure that SystemCoreClock variable is set */
SystemCoreClockUpdate();
/* initialize LED1 on P5.9 as digital output */
XMC_GPIO_SetMode(P5_9, XMC_GPIO_MODE_OUTPUT_PUSH_PULL);
/* initialize BUTTON1 as digital input. */