Mouse code for the MacroRat

Dependencies:   ITG3200 QEI

Committer:
sahilmgandhi
Date:
Sat Jun 03 00:22:44 2017 +0000
Revision:
46:b156ef445742
Parent:
18:6a4db94011d3
Final code for internal battlebot competition.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sahilmgandhi 18:6a4db94011d3 1 /* [ROM = 512kb = 0x80000] */
sahilmgandhi 18:6a4db94011d3 2 define symbol __intvec_start__ = 0x08000000;
sahilmgandhi 18:6a4db94011d3 3 define symbol __region_ROM_start__ = 0x08000000;
sahilmgandhi 18:6a4db94011d3 4 define symbol __region_ROM_end__ = 0x0807FFFF;
sahilmgandhi 18:6a4db94011d3 5
sahilmgandhi 18:6a4db94011d3 6 /* [RAM = 128kb = 0x20000] Vector table dynamic copy: 102 vectors = 408 bytes (0x198) to be reserved in RAM */
sahilmgandhi 18:6a4db94011d3 7 define symbol __NVIC_start__ = 0x20000000;
sahilmgandhi 18:6a4db94011d3 8 define symbol __NVIC_end__ = 0x20000197; /* Aligned on 8 bytes */
sahilmgandhi 18:6a4db94011d3 9 define symbol __region_RAM_start__ = 0x20000198;
sahilmgandhi 18:6a4db94011d3 10 define symbol __region_RAM_end__ = 0x2001FFFF;
sahilmgandhi 18:6a4db94011d3 11
sahilmgandhi 18:6a4db94011d3 12 /* Memory regions */
sahilmgandhi 18:6a4db94011d3 13 define memory mem with size = 4G;
sahilmgandhi 18:6a4db94011d3 14 define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
sahilmgandhi 18:6a4db94011d3 15 define region RAM_region = mem:[from __region_RAM_start__ to __region_RAM_end__];
sahilmgandhi 18:6a4db94011d3 16
sahilmgandhi 18:6a4db94011d3 17 /* Stack and Heap */
sahilmgandhi 18:6a4db94011d3 18 /*Heap 1/4 of ram and stack 1/8*/
sahilmgandhi 18:6a4db94011d3 19 define symbol __size_cstack__ = 0x4000;
sahilmgandhi 18:6a4db94011d3 20 define symbol __size_heap__ = 0x8000;
sahilmgandhi 18:6a4db94011d3 21 define block CSTACK with alignment = 8, size = __size_cstack__ { };
sahilmgandhi 18:6a4db94011d3 22 define block HEAP with alignment = 8, size = __size_heap__ { };
sahilmgandhi 18:6a4db94011d3 23 define block STACKHEAP with fixed order { block HEAP, block CSTACK };
sahilmgandhi 18:6a4db94011d3 24
sahilmgandhi 18:6a4db94011d3 25 initialize by copy with packing = zeros { readwrite };
sahilmgandhi 18:6a4db94011d3 26 do not initialize { section .noinit };
sahilmgandhi 18:6a4db94011d3 27
sahilmgandhi 18:6a4db94011d3 28 place at address mem:__intvec_start__ { readonly section .intvec };
sahilmgandhi 18:6a4db94011d3 29
sahilmgandhi 18:6a4db94011d3 30 place in ROM_region { readonly };
sahilmgandhi 18:6a4db94011d3 31 place in RAM_region { readwrite, block STACKHEAP };