The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
Anna Bridge
Date:
Wed Jan 17 16:13:02 2018 +0000
Revision:
160:5571c4ff569f
Child:
161:aa5281ff4a02
mbed library. Release version 158

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Anna Bridge 160:5571c4ff569f 1 /* mbed Microcontroller Library
Anna Bridge 160:5571c4ff569f 2 * Copyright (c) 2016 ARM Limited
Anna Bridge 160:5571c4ff569f 3 *
Anna Bridge 160:5571c4ff569f 4 * Licensed under the Apache License, Version 2.0 (the "License");
Anna Bridge 160:5571c4ff569f 5 * you may not use this file except in compliance with the License.
Anna Bridge 160:5571c4ff569f 6 * You may obtain a copy of the License at
Anna Bridge 160:5571c4ff569f 7 *
Anna Bridge 160:5571c4ff569f 8 * http://www.apache.org/licenses/LICENSE-2.0
Anna Bridge 160:5571c4ff569f 9 *
Anna Bridge 160:5571c4ff569f 10 * Unless required by applicable law or agreed to in writing, software
Anna Bridge 160:5571c4ff569f 11 * distributed under the License is distributed on an "AS IS" BASIS,
Anna Bridge 160:5571c4ff569f 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Anna Bridge 160:5571c4ff569f 13 * See the License for the specific language governing permissions and
Anna Bridge 160:5571c4ff569f 14 * limitations under the License.
Anna Bridge 160:5571c4ff569f 15 */
Anna Bridge 160:5571c4ff569f 16 #ifndef MBED_MBED_RTX_H
Anna Bridge 160:5571c4ff569f 17 #define MBED_MBED_RTX_H
Anna Bridge 160:5571c4ff569f 18
Anna Bridge 160:5571c4ff569f 19 #include <stdint.h>
Anna Bridge 160:5571c4ff569f 20
Anna Bridge 160:5571c4ff569f 21 #define OS_IDLE_THREAD_STACK_SIZE 512
Anna Bridge 160:5571c4ff569f 22
Anna Bridge 160:5571c4ff569f 23 #if defined(__CC_ARM)
Anna Bridge 160:5571c4ff569f 24 extern char Image$$ARM_LIB_STACK$$Base[];
Anna Bridge 160:5571c4ff569f 25 extern char Image$$ARM_LIB_STACK$$ZI$$Limit[];
Anna Bridge 160:5571c4ff569f 26 extern char Image$$ARM_LIB_HEAP$$Base[];
Anna Bridge 160:5571c4ff569f 27 #define ISR_STACK_START ((unsigned char*)Image$$ARM_LIB_STACK$$Base)
Anna Bridge 160:5571c4ff569f 28 #define ISR_STACK_SIZE ((uint32_t)((uint32_t)Image$$ARM_LIB_STACK$$ZI$$Limit - (uint32_t)Image$$ARM_LIB_STACK$$Base))
Anna Bridge 160:5571c4ff569f 29 #define INITIAL_SP (Image$$ARM_LIB_STACK$$ZI$$Limit)
Anna Bridge 160:5571c4ff569f 30 #define HEAP_START ((unsigned char*)Image$$ARM_LIB_HEAP$$Base)
Anna Bridge 160:5571c4ff569f 31 #define HEAP_SIZE ((uint32_t)((uint32_t)ISR_STACK_START - (uint32_t)HEAP_START))
Anna Bridge 160:5571c4ff569f 32 #elif defined(__GNUC__)
Anna Bridge 160:5571c4ff569f 33 extern uint32_t __StackTop;
Anna Bridge 160:5571c4ff569f 34 extern uint32_t __StackLimit;
Anna Bridge 160:5571c4ff569f 35 extern uint32_t __end__;
Anna Bridge 160:5571c4ff569f 36 #define ISR_STACK_START ((unsigned char*)&__StackLimit)
Anna Bridge 160:5571c4ff569f 37 #define ISR_STACK_SIZE ((uint32_t)((uint32_t)&__StackTop - (uint32_t)&__StackLimit))
Anna Bridge 160:5571c4ff569f 38 #define INITIAL_SP (&__StackTop)
Anna Bridge 160:5571c4ff569f 39 #define HEAP_START ((unsigned char*)&__end__)
Anna Bridge 160:5571c4ff569f 40 #define HEAP_SIZE ((uint32_t)((uint32_t)ISR_STACK_START - (uint32_t)HEAP_START))
Anna Bridge 160:5571c4ff569f 41 #elif defined(__ICCARM__)
Anna Bridge 160:5571c4ff569f 42 /* No region declarations needed */
Anna Bridge 160:5571c4ff569f 43 #else
Anna Bridge 160:5571c4ff569f 44 #error "no toolchain defined"
Anna Bridge 160:5571c4ff569f 45 #endif
Anna Bridge 160:5571c4ff569f 46
Anna Bridge 160:5571c4ff569f 47 #endif // MBED_MBED_RTX_H