PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)
mbed-pokitto/targets/cmsis/TARGET_NXP/TARGET_LPC11U6X/TOOLCHAIN_ARM_MICRO/sys.cpp@64:6e6c6c2b664e, 2018-11-18 (annotated)
- Committer:
- spinal
- Date:
- Sun Nov 18 15:47:54 2018 +0000
- Revision:
- 64:6e6c6c2b664e
- Parent:
- 5:ea7377f3d1af
added fix for directrectangle()
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Pokitto | 5:ea7377f3d1af | 1 | /* mbed Microcontroller Library - stackheap |
Pokitto | 5:ea7377f3d1af | 2 | * Copyright (C) 2009-2011 ARM Limited. All rights reserved. |
Pokitto | 5:ea7377f3d1af | 3 | * |
Pokitto | 5:ea7377f3d1af | 4 | * Setup a fixed single stack/heap memory model, |
Pokitto | 5:ea7377f3d1af | 5 | * between the top of the RW/ZI region and the stackpointer |
Pokitto | 5:ea7377f3d1af | 6 | */ |
Pokitto | 5:ea7377f3d1af | 7 | |
Pokitto | 5:ea7377f3d1af | 8 | #ifdef __cplusplus |
Pokitto | 5:ea7377f3d1af | 9 | extern "C" { |
Pokitto | 5:ea7377f3d1af | 10 | #endif |
Pokitto | 5:ea7377f3d1af | 11 | |
Pokitto | 5:ea7377f3d1af | 12 | #include <rt_misc.h> |
Pokitto | 5:ea7377f3d1af | 13 | #include <stdint.h> |
Pokitto | 5:ea7377f3d1af | 14 | |
Pokitto | 5:ea7377f3d1af | 15 | extern char Image$$RW_IRAM1$$ZI$$Limit[]; |
Pokitto | 5:ea7377f3d1af | 16 | |
Pokitto | 5:ea7377f3d1af | 17 | extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) { |
Pokitto | 5:ea7377f3d1af | 18 | uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit; |
Pokitto | 5:ea7377f3d1af | 19 | uint32_t sp_limit = __current_sp(); |
Pokitto | 5:ea7377f3d1af | 20 | |
Pokitto | 5:ea7377f3d1af | 21 | zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned |
Pokitto | 5:ea7377f3d1af | 22 | |
Pokitto | 5:ea7377f3d1af | 23 | struct __initial_stackheap r; |
Pokitto | 5:ea7377f3d1af | 24 | r.heap_base = zi_limit; |
Pokitto | 5:ea7377f3d1af | 25 | r.heap_limit = sp_limit; |
Pokitto | 5:ea7377f3d1af | 26 | return r; |
Pokitto | 5:ea7377f3d1af | 27 | } |
Pokitto | 5:ea7377f3d1af | 28 | |
Pokitto | 5:ea7377f3d1af | 29 | #ifdef __cplusplus |
Pokitto | 5:ea7377f3d1af | 30 | } |
Pokitto | 5:ea7377f3d1af | 31 | #endif |