Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Fri May 26 17:21:04 2017 +0000
Revision:
34:69342782fb68
Parent:
18:6a4db94011d3
Added small reverse turns before the break so that we can stop faster.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /* mbed Microcontroller Library - stackheap
sahilmgandhi 18:6a4db94011d3 2 * Copyright (C) 2009-2015 ARM Limited. All rights reserved.
sahilmgandhi 18:6a4db94011d3 3 *
sahilmgandhi 18:6a4db94011d3 4 * Setup a fixed single stack/heap memory model,
sahilmgandhi 18:6a4db94011d3 5 * between the top of the RW/ZI region and the stackpointer
sahilmgandhi 18:6a4db94011d3 6 */
sahilmgandhi 18:6a4db94011d3 7
sahilmgandhi 18:6a4db94011d3 8 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 9 extern "C" {
sahilmgandhi 18:6a4db94011d3 10 #endif
sahilmgandhi 18:6a4db94011d3 11
sahilmgandhi 18:6a4db94011d3 12 #include <rt_misc.h>
sahilmgandhi 18:6a4db94011d3 13 #include <stdint.h>
sahilmgandhi 18:6a4db94011d3 14
sahilmgandhi 18:6a4db94011d3 15 extern char Image$$RW_IRAM1$$ZI$$Limit[];
sahilmgandhi 18:6a4db94011d3 16
sahilmgandhi 18:6a4db94011d3 17 extern __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) {
sahilmgandhi 18:6a4db94011d3 18 uint32_t zi_limit = (uint32_t)Image$$RW_IRAM1$$ZI$$Limit;
sahilmgandhi 18:6a4db94011d3 19 uint32_t sp_limit = __current_sp();
sahilmgandhi 18:6a4db94011d3 20
sahilmgandhi 18:6a4db94011d3 21 zi_limit = (zi_limit + 7) & ~0x7; // ensure zi_limit is 8-byte aligned
sahilmgandhi 18:6a4db94011d3 22
sahilmgandhi 18:6a4db94011d3 23 struct __initial_stackheap r;
sahilmgandhi 18:6a4db94011d3 24 r.heap_base = zi_limit;
sahilmgandhi 18:6a4db94011d3 25 r.heap_limit = sp_limit;
sahilmgandhi 18:6a4db94011d3 26 return r;
sahilmgandhi 18:6a4db94011d3 27 }
sahilmgandhi 18:6a4db94011d3 28
sahilmgandhi 18:6a4db94011d3 29 #ifdef __cplusplus
sahilmgandhi 18:6a4db94011d3 30 }
sahilmgandhi 18:6a4db94011d3 31 #endif