Opencv 3.1 project on GR-PEACH board
Fork of gr-peach-opencv-project by
platform/mbed_sdk_boot.c@166:3a9487d57a5c, 2017-06-29 (annotated)
- Committer:
- thedo
- Date:
- Thu Jun 29 11:00:41 2017 +0000
- Revision:
- 166:3a9487d57a5c
This is Opencv 3.1 project on GR-PEACH board
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thedo | 166:3a9487d57a5c | 1 | /* mbed Microcontroller Library |
thedo | 166:3a9487d57a5c | 2 | * Copyright (c) 2017 ARM Limited |
thedo | 166:3a9487d57a5c | 3 | * |
thedo | 166:3a9487d57a5c | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
thedo | 166:3a9487d57a5c | 5 | * you may not use this file except in compliance with the License. |
thedo | 166:3a9487d57a5c | 6 | * You may obtain a copy of the License at |
thedo | 166:3a9487d57a5c | 7 | * |
thedo | 166:3a9487d57a5c | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
thedo | 166:3a9487d57a5c | 9 | * |
thedo | 166:3a9487d57a5c | 10 | * Unless required by applicable law or agreed to in writing, software |
thedo | 166:3a9487d57a5c | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
thedo | 166:3a9487d57a5c | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
thedo | 166:3a9487d57a5c | 13 | * See the License for the specific language governing permissions and |
thedo | 166:3a9487d57a5c | 14 | * limitations under the License. |
thedo | 166:3a9487d57a5c | 15 | */ |
thedo | 166:3a9487d57a5c | 16 | |
thedo | 166:3a9487d57a5c | 17 | #include "mbed_toolchain.h" |
thedo | 166:3a9487d57a5c | 18 | #include <stdlib.h> |
thedo | 166:3a9487d57a5c | 19 | #include <stdint.h> |
thedo | 166:3a9487d57a5c | 20 | |
thedo | 166:3a9487d57a5c | 21 | /* This startup is for mbed 2 baremetal. There is no config for RTOS for mbed 2, |
thedo | 166:3a9487d57a5c | 22 | * therefore we protect this file with MBED_CONF_RTOS_PRESENT |
thedo | 166:3a9487d57a5c | 23 | * Note: The new consolidated started for mbed OS is in rtos/mbed_boot code file. |
thedo | 166:3a9487d57a5c | 24 | */ |
thedo | 166:3a9487d57a5c | 25 | #if !defined(MBED_CONF_RTOS_PRESENT) |
thedo | 166:3a9487d57a5c | 26 | |
thedo | 166:3a9487d57a5c | 27 | /* mbed_main is a function that is called before main() |
thedo | 166:3a9487d57a5c | 28 | * mbed_sdk_init() is also a function that is called before main(), but unlike |
thedo | 166:3a9487d57a5c | 29 | * mbed_main(), it is not meant for user code, but for the SDK itself to perform |
thedo | 166:3a9487d57a5c | 30 | * initializations before main() is called. |
thedo | 166:3a9487d57a5c | 31 | */ |
thedo | 166:3a9487d57a5c | 32 | MBED_WEAK void mbed_main(void) |
thedo | 166:3a9487d57a5c | 33 | { |
thedo | 166:3a9487d57a5c | 34 | |
thedo | 166:3a9487d57a5c | 35 | } |
thedo | 166:3a9487d57a5c | 36 | |
thedo | 166:3a9487d57a5c | 37 | /* This function can be implemented by the target to perform higher level target initialization |
thedo | 166:3a9487d57a5c | 38 | */ |
thedo | 166:3a9487d57a5c | 39 | MBED_WEAK void mbed_sdk_init(void) |
thedo | 166:3a9487d57a5c | 40 | { |
thedo | 166:3a9487d57a5c | 41 | |
thedo | 166:3a9487d57a5c | 42 | } |
thedo | 166:3a9487d57a5c | 43 | |
thedo | 166:3a9487d57a5c | 44 | MBED_WEAK void software_init_hook_rtos() |
thedo | 166:3a9487d57a5c | 45 | { |
thedo | 166:3a9487d57a5c | 46 | // Nothing by default |
thedo | 166:3a9487d57a5c | 47 | } |
thedo | 166:3a9487d57a5c | 48 | |
thedo | 166:3a9487d57a5c | 49 | /* Toolchain specific main code */ |
thedo | 166:3a9487d57a5c | 50 | |
thedo | 166:3a9487d57a5c | 51 | #if defined (__CC_ARM) |
thedo | 166:3a9487d57a5c | 52 | |
thedo | 166:3a9487d57a5c | 53 | int $Super$$main(void); |
thedo | 166:3a9487d57a5c | 54 | |
thedo | 166:3a9487d57a5c | 55 | int $Sub$$main(void) |
thedo | 166:3a9487d57a5c | 56 | { |
thedo | 166:3a9487d57a5c | 57 | mbed_main(); |
thedo | 166:3a9487d57a5c | 58 | return $Super$$main(); |
thedo | 166:3a9487d57a5c | 59 | } |
thedo | 166:3a9487d57a5c | 60 | |
thedo | 166:3a9487d57a5c | 61 | void _platform_post_stackheap_init(void) |
thedo | 166:3a9487d57a5c | 62 | { |
thedo | 166:3a9487d57a5c | 63 | mbed_sdk_init(); |
thedo | 166:3a9487d57a5c | 64 | } |
thedo | 166:3a9487d57a5c | 65 | |
thedo | 166:3a9487d57a5c | 66 | #elif defined (__GNUC__) |
thedo | 166:3a9487d57a5c | 67 | |
thedo | 166:3a9487d57a5c | 68 | extern int __real_main(void); |
thedo | 166:3a9487d57a5c | 69 | |
thedo | 166:3a9487d57a5c | 70 | __attribute__((naked)) void software_init_hook(void) |
thedo | 166:3a9487d57a5c | 71 | { |
thedo | 166:3a9487d57a5c | 72 | mbed_sdk_init(); |
thedo | 166:3a9487d57a5c | 73 | software_init_hook_rtos(); |
thedo | 166:3a9487d57a5c | 74 | } |
thedo | 166:3a9487d57a5c | 75 | |
thedo | 166:3a9487d57a5c | 76 | |
thedo | 166:3a9487d57a5c | 77 | int __wrap_main(void) |
thedo | 166:3a9487d57a5c | 78 | { |
thedo | 166:3a9487d57a5c | 79 | mbed_main(); |
thedo | 166:3a9487d57a5c | 80 | return __real_main(); |
thedo | 166:3a9487d57a5c | 81 | } |
thedo | 166:3a9487d57a5c | 82 | |
thedo | 166:3a9487d57a5c | 83 | #elif defined (__ICCARM__) |
thedo | 166:3a9487d57a5c | 84 | |
thedo | 166:3a9487d57a5c | 85 | // cmsis.S file implements the mbed SDK boot for IAR |
thedo | 166:3a9487d57a5c | 86 | |
thedo | 166:3a9487d57a5c | 87 | #endif |
thedo | 166:3a9487d57a5c | 88 | |
thedo | 166:3a9487d57a5c | 89 | #endif |
thedo | 166:3a9487d57a5c | 90 |