示例#1
0
static void sys_reset(void)
{
  copy_initialized();
  clear_bss();
  main();
  while(1);
}
static void
sys_reset(void)
{
  copy_initialized();
  clear_bss();
  enable_fault_exceptions();
  start_hse_clock();
  use_pll();
  main();
  while(1);
  
}
示例#3
0
static void
sys_reset(void)
{
    unsigned int volatile *d;
    d = dummy;

    /* turn on the internal oscillator */
    RCC->CR |= RCC_CR_HSION;

    /* turn off the external oscillator, the clock security system, and the PLL */
    RCC->CR &= (uint32_t)0xFEF6FFFF;

    /* disable and clear any pending interrupts  */
    RCC->CIR =
        RCC_CIR_LSIRDYC |
        RCC_CIR_LSERDYC |
        RCC_CIR_HSIRDYC |
        RCC_CIR_HSERDYC |
        RCC_CIR_PLLRDYC |
        RCC_CIR_CSSC;

    /* turn on the flash pre-fetch buffer and set its wait state to 2 */
    FLASH->ACR |= FLASH_ACR_PRFTBE;
    FLASH->ACR  = (FLASH->ACR & ~FLASH_ACR_LATENCY) | FLASH_ACR_LATENCY_2;

    copy_initialized();
    clear_bss();
    enable_fault_exceptions();
    clock_config();
    start_hse_clock();
    flash_config();
    use_pll();

    main();
    while(1);

}