/******************************************************************************
 * @file     system_spc1168.c
 * @brief    CMSIS Device System Source File for SPC1168 Device Series
 * @version  V1.8.0
 * @date     31-Dec-2021
 *
 * @note
 * Copyright (C) 2021 Spintrol Limited. All rights reserved.
 *
 * @attention
 * THIS SOFTWARE JUST PROVIDES CUSTOMERS WITH CODING INFORMATION REGARDING 
 * THEIR PRODUCTS, WHICH AIMS AT SAVING TIME FOR THEM. SPINTROL SHALL NOT BE
 * LIABLE FOR THE USE OF THE SOFTWARE. SPINTROL DOES NOT GUARANTEE THE 
 * CORRECTNESS OF THIS SOFTWARE AND RESERVES THE RIGHT TO MODIFY THE SOFTWARE 
 * WITHOUT NOTIFICATION.
 *
 ******************************************************************************/

#include "spc1168.h"




/**
 *  @brief  System Core Clock Variable
 *          After each device reset the RCO0 is used as System clock source.
 */
uint32_t SystemCoreClock = __RCO0_CLOCK;  /* System Core Clock Frequency      */




/**
 *  @brief  System Information Data Variable
 */
SysInfoStruct SysInfo;




/******************************************************************************
 * @brief      Updates the SystemCoreClock with current core Clock
 *             retrieved from cpu registers.
 *
 * @param[in]  none
 *
 * @return     none
 *
 ******************************************************************************/
void SystemCoreClockUpdate (void)
{
  SystemCoreClock = __RCO0_CLOCK;
}




/******************************************************************************
 * @brief      Initialize the system
 *
 * @param[in]  none
 *
 * @return     none
 *
 ******************************************************************************/
void SystemInit (void)
{
  #if (__FPU_USED == 1)
    SCB->CPACR |= ((3UL << 10*2) |                 /* set CP10 Full Access */
                   (3UL << 11*2)  );               /* set CP11 Full Access */
  #endif

#ifdef UNALIGNED_SUPPORT_DISABLE
  SCB->CCR |= SCB_CCR_UNALIGN_TRP_Msk;
#endif

  SystemCoreClock = __RCO0_CLOCK;
}


/******************* (C) COPYRIGHT 2021 SPINTROL LIMITED ***** END OF FILE ****/
