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

📄 retarget.c

📁 在ARM7和UC/OSII的平台上实现了GPS自动报站的功能,涉及GPS模块LEA_4S的驱动,位置速寻算法,语音芯片ISD4004的录放音驱动,LED页面管理等等.从启动代码到操作系统的移植以及到业
💻 C
字号:
//*----------------------------------------------------------------------------
//*         ATMEL Microcontroller Software Support  -  ROUSSET  -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name           : retarget.c
//* Object              : ADS basic definition for no semihosting
//*
//* 1.1 28/06/01 JPP    : Creation
//*----------------------------------------------------------------------------


//* Semihosting Flag
//#ifndef SEMIHOSTING

#include <rt_misc.h>

// define the heap size

//       RAM:
//                             ---------------
//           SP -> top of RAM |   0x20x0000   |
//                            |               |
//           Heap base        | SP - HEAP_SIZE|
//                             ---------------
//                            |               |
//           text(code)       |   0x2000000   |
//                            |  reset + size |
//                             ---------------
//                            |   0x2000000   | Entry point
//           reset(code)       ---------------
/*在目前平台上内部RAM8kb 0~2000 外部RAM256KB 40000~80000,这样定义有一定的问题,
  这时堆基址为0xffff1eb8,该地址为外围I/O口地址,有冲突.需要重新定义*/
//define HEAP_SIZE  (4*1024)  
#define HEAP_SIZE 	(64 *1024)

//*----------------------------------------------------------------------------
//* Function Name       : _sys_exit
//* Object              : Wait for error system return main. Called, eventually,
//*						  by all exits from the library.
//* Input Parameters    : return_code
//* Output Parameters   : none
//* Functions called    : none
//*----------------------------------------------------------------------------
void _sys_exit(int return_code)
{
  while(1); //* endless loop
}

//*----------------------------------------------------------------------------
//* Function Name       : _ttywrch
//* Object              : This function writes a character to the console. The
//*						console might have been redirected. You can use this
//*  					function as a last resort error handling routine.
//* Input Parameters    : ch
//* Output Parameters   : none
//* Functions called    : none
//*----------------------------------------------------------------------------

void _ttywrch(int ch)
{

}

//*----------------------------------------------------------------------------
//* Function Name       : __user_initial_stackheap
//* Object              : Returns the locations of the initial stack and heap.
//* Input Parameters    :
//* Output Parameters   :The values returned in r0 to r3 depend on whether you
//*						are using the one or two region model:
//*			One region (r0,r1) is the single stack and heap region. r1 is
//*			greater than r0. r2 and r3 are ignored.
//*			Two regions (r0, r2) is the initial heap and (r3, r1) is the initial
//*			stack. r2 is greater than or equal to r0. r3 is less than r1.
//* Functions called    : none
//*----------------------------------------------------------------------------
/*
__value_in_regs struct __initial_stackheap __user_initial_stackheap(
        unsigned R0, unsigned SP, unsigned R2, unsigned SL)
{
    struct __initial_stackheap config;

    config.heap_base = SP - HEAP_SIZE;
    config.stack_base = SP;

    return config;
}
*/

__value_in_regs struct __initial_stackheap __user_initial_stackheap(
        unsigned R0, unsigned SP, unsigned R2, unsigned SL)
{
    struct __initial_stackheap config;

    config.heap_base  = 0x400000 + 0x70000;
    config.stack_base = 0x400000 + 0x80000;//SP;
    //config.heap_limit = config.heap_base - HEAP_SIZE;
	//config.stack_limit = 0x1000;
    return config;
}
//#endif // SEMIHOSTING

⌨️ 快捷键说明

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