2018-06-01 04:24:02 +00:00
|
|
|
/*
|
|
|
|
* Routines to access hardware
|
|
|
|
*
|
|
|
|
* Copyright (c) 2013 Realtek Semiconductor Corp.
|
|
|
|
*
|
|
|
|
* This module is a confidential and proprietary property of RealTek and
|
|
|
|
* possession or use of this module requires written permission of RealTek.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ameba_soc.h"
|
|
|
|
#include "build_info.h"
|
2018-10-18 08:55:11 +00:00
|
|
|
#include "rtconfig.h"
|
2018-06-01 04:24:02 +00:00
|
|
|
|
|
|
|
void APP_Start(void)
|
|
|
|
{
|
|
|
|
#if CONFIG_SOC_PS_MODULE
|
|
|
|
SOCPS_InitSYSIRQ();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern void PendSV_Handler(void);
|
|
|
|
extern void SysTick_Handler(void);
|
|
|
|
InterruptForOSInit((VOID*)NULL,
|
|
|
|
(VOID*)PendSV_Handler,
|
|
|
|
(VOID*)SysTick_Handler);
|
|
|
|
|
|
|
|
#if defined ( __ICCARM__ )
|
|
|
|
__iar_cstart_call_ctors(NULL);
|
|
|
|
#endif
|
|
|
|
// force SP align to 8 byte not 4 byte (initial SP is 4 byte align)
|
|
|
|
__asm(
|
|
|
|
"mov r0, sp\n"
|
|
|
|
"bic r0, r0, #7\n"
|
|
|
|
"mov sp, r0\n"
|
|
|
|
);
|
|
|
|
|
2018-10-18 08:55:11 +00:00
|
|
|
#ifdef RT_USING_USER_MAIN
|
2018-06-01 04:24:02 +00:00
|
|
|
/* startup RT-Thread RTOS */
|
|
|
|
rtthread_startup();
|
2018-10-18 08:55:11 +00:00
|
|
|
#else
|
|
|
|
extern int main(void);
|
|
|
|
extern int $Super$$main(void);
|
|
|
|
/* invoke system main function */
|
|
|
|
#if defined (__CC_ARM)
|
|
|
|
$Super$$main(); /* for ARMCC. */
|
|
|
|
#elif defined(__ICCARM__) || defined(__GNUC__)
|
|
|
|
main();
|
|
|
|
#endif
|
|
|
|
#endif
|
2018-06-01 04:24:02 +00:00
|
|
|
}
|