at91_low_level_init.c

来自「uCOS-II for AT91M55800A完整实例」· C语言 代码 · 共 69 行

C
69
字号
/**************************************************
 *
 * This module contains the function `__low_level_init', a function
 * that is called before the `main' function of the program.  Normally
 * low-level initializations - such as setting the prefered interrupt
 * level or setting the watchdog - can be performed here.
 *
 * Note that this function is called before the data segments are
 * initialized, this means that this function can't rely on the
 * values of global or static variables.
 *
 * When this function returns zero, the startup code will inhibit the
 * initialization of the data segments.  The result is faster startup,
 * the drawback is that neither global nor static data will be
 * initialized.
 *
 * Copyright 1999 IAR Systems. All rights reserved.
 *
 * $Revision: 1.3 $
 *
 * $Log $
 *
 **************************************************/

#include "config.h"

/* ICODE is the same segment as cstartup. By placing __low_level_init
 * in the same segment, we make sure it can be reached with BL. */

#ifdef __cplusplus
extern "C" {
#endif

#pragma language=extended


#pragma location="ICODE"
int
__low_level_init(void)
{
  /*==================================*/
  /*  Initialize hardware.            */
  /*==================================*/

#if AT91_EB55
  // Speed up the System Frequency.
  AT91_EB55_PllStart();
  // Enable peripheral clocks.
  AT91EnablePeripheralClocks();
#endif

  // The PIO is enabled early to make the LED's available for tracing.
  AT91InitPIO();

  /*==================================*/
  /* Choose if segment initialization */
  /* should be done or not.           */
  /* Return: 0 to omit seg_init       */
  /*         1 to run seg_init        */
  /*==================================*/
  return (1);
}

#pragma language=default

#ifdef __cplusplus
}
#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?