Renesas GR-PEACH OpenCV Development / gr-peach-opencv-project-sd-card_update

Fork of gr-peach-opencv-project-sd-card by the do

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mbed_sdk_boot.c Source File

mbed_sdk_boot.c

00001 /* mbed Microcontroller Library
00002  * Copyright (c) 2017 ARM Limited
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #include "mbed_toolchain.h"
00018 #include <stdlib.h>
00019 #include <stdint.h>
00020 
00021 /* This startup is for mbed 2 baremetal. There is no config for RTOS for mbed 2,
00022  * therefore we protect this file with MBED_CONF_RTOS_PRESENT
00023  * Note: The new consolidated started for mbed OS is in rtos/mbed_boot code file.
00024  */
00025 #if !defined(MBED_CONF_RTOS_PRESENT)
00026 
00027 /* mbed_main is a function that is called before main()
00028  * mbed_sdk_init() is also a function that is called before main(), but unlike
00029  * mbed_main(), it is not meant for user code, but for the SDK itself to perform
00030  * initializations before main() is called.
00031  */
00032 MBED_WEAK void mbed_main(void) 
00033 {
00034 
00035 }
00036 
00037 /* This function can be implemented by the target to perform higher level target initialization
00038  */
00039 MBED_WEAK void mbed_sdk_init(void) 
00040 {
00041 
00042 }
00043 
00044 MBED_WEAK void software_init_hook_rtos()
00045 {
00046     // Nothing by default
00047 }
00048 
00049 /* Toolchain specific main code */
00050 
00051 #if defined (__CC_ARM)
00052 
00053 int $Super$$main(void);
00054 
00055 int $Sub$$main(void) 
00056 {
00057     mbed_main();
00058     return $Super$$main();
00059 }
00060 
00061 void _platform_post_stackheap_init(void) 
00062 {
00063     mbed_sdk_init();
00064 }
00065 
00066 #elif defined (__GNUC__) 
00067 
00068 extern int __real_main(void);
00069 
00070 __attribute__((naked)) void software_init_hook(void)
00071 {
00072     mbed_sdk_init();
00073     software_init_hook_rtos();
00074 }
00075 
00076 
00077 int __wrap_main(void) 
00078 {
00079     mbed_main();
00080     return __real_main();
00081 }
00082 
00083 #elif defined (__ICCARM__)
00084 
00085 // cmsis.S file implements the mbed SDK boot for IAR
00086 
00087 #endif
00088 
00089 #endif
00090