#include "stm32g4xx.h"

// 16 MHz setup
void SystemInit(void)
{
    // FPU settings: enable CP10 and CP11 full access
    // SCB->CPACR |= ((3UL << 20U) | (3UL << 22U));

    // Reset RCC clock configuration to default
    RCC->CR |= RCC_CR_HSION;
    RCC->CFGR = 0x00000000U;
    RCC->CR &= ~(RCC_CR_HSEON | RCC_CR_PLLON | RCC_CR_CSSON);
    RCC->PLLCFGR = 0x00001000U;
    RCC->CR &= ~RCC_CR_HSEBYP;
    RCC->CIER = 0x00000000U;
}
