⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 low_level_init.c

📁 本代码以AVR单片机为主控制器
💻 C
字号:
/**************************************************************
 **             - __low_level_init.c -
 **
 **     Special initializations that are performed before
 **     segment initialization. It is also possible to
 **     completely block the normal segment initialization.
 **
 **     Used with iccAVR.
 **
 **     $Revision: 1.2 $
 **
 **************************************************************/
#include <inavr.h>

extern void *__RSTACK_in_external_ram;

/**************************************************************
 **
 ** How to implement a low-level initialization function in C
 ** =========================================================
 **
 ** 1) Only use local auto variables.
 ** 2) Don't use global or static variables.
 ** 3) Don't use global or static objects (EC++ only).
 ** 4) Don't use agregate initializers, e.g. struct a b = {1};
 ** 5) Don't call any library functions (function calls that
 **    the compiler generates, e.g. to do integer math, are OK).
 ** 6) Setup the RSTACK as is appropriate! See code below.
 **
 **************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
char __low_level_init()
{
  /* Uncomment the statement below if the RSTACK */
  /* segment has been placed in external SRAM!   */

  /* __require(__RSTACK_in_external_ram); */

  /* If the low-level initialization routine is  */
  /* written in assembler, the line above should */
  /* be written as:                              */
  /*     EXTERN  __RSTACK_in_external_ram        */
  /*     REQUIRE __RSTACK_in_external_ram        */

  /* Add your custom setup here. */

  /* Return 1 to indicate that normal segment */
  /* initialization should be performed. If   */
  /* normal segment initialization should not */
  /* be performed, return 0.                  */
  return 0;
}
#ifdef __cplusplus
}
#endif

⌨️ 快捷键说明

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