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 ;/*****************************************************************************
sahilmgandhi 18:6a4db94011d3 2 ; * @file: startup_LPC11u6x.s
sahilmgandhi 18:6a4db94011d3 3 ; * @purpose: CMSIS Cortex-M0PLUS Core Device Startup File
sahilmgandhi 18:6a4db94011d3 4 ; * for the NXP LPC11u6x Device Series (manually edited)
sahilmgandhi 18:6a4db94011d3 5 ; * @version: V1.00
sahilmgandhi 18:6a4db94011d3 6 ; * @date: 19. October 2009
sahilmgandhi 18:6a4db94011d3 7 ; *----------------------------------------------------------------------------
sahilmgandhi 18:6a4db94011d3 8 ; *
sahilmgandhi 18:6a4db94011d3 9 ; * Copyright (C) 2009 ARM Limited. All rights reserved.
sahilmgandhi 18:6a4db94011d3 10 ; *
sahilmgandhi 18:6a4db94011d3 11 ; * ARM Limited (ARM) is supplying this software for use with Cortex-Mx
sahilmgandhi 18:6a4db94011d3 12 ; * processor based microcontrollers. This file can be freely distributed
sahilmgandhi 18:6a4db94011d3 13 ; * within development tools that are supporting such ARM based processors.
sahilmgandhi 18:6a4db94011d3 14 ; *
sahilmgandhi 18:6a4db94011d3 15 ; * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
sahilmgandhi 18:6a4db94011d3 16 ; * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
sahilmgandhi 18:6a4db94011d3 17 ; * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
sahilmgandhi 18:6a4db94011d3 18 ; * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
sahilmgandhi 18:6a4db94011d3 19 ; * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
sahilmgandhi 18:6a4db94011d3 20 ; *
sahilmgandhi 18:6a4db94011d3 21 ; ******************************************************************************/
sahilmgandhi 18:6a4db94011d3 22
sahilmgandhi 18:6a4db94011d3 23 ;
sahilmgandhi 18:6a4db94011d3 24 ; The modules in this file are included in the libraries, and may be replaced
sahilmgandhi 18:6a4db94011d3 25 ; by any user-defined modules that define the PUBLIC symbol _program_start or
sahilmgandhi 18:6a4db94011d3 26 ; a user defined start symbol.
sahilmgandhi 18:6a4db94011d3 27 ; To override the cstartup defined in the library, simply add your modified
sahilmgandhi 18:6a4db94011d3 28 ; version to the workbench project.
sahilmgandhi 18:6a4db94011d3 29 ;
sahilmgandhi 18:6a4db94011d3 30 ; The vector table is normally located at address 0.
sahilmgandhi 18:6a4db94011d3 31 ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6.
sahilmgandhi 18:6a4db94011d3 32 ; The name "__vector_table" has special meaning for C-SPY:
sahilmgandhi 18:6a4db94011d3 33 ; it is where the SP start value is found, and the NVIC vector
sahilmgandhi 18:6a4db94011d3 34 ; table register (VTOR) is initialized to this address if != 0.
sahilmgandhi 18:6a4db94011d3 35 ;
sahilmgandhi 18:6a4db94011d3 36 ; Cortex-M version
sahilmgandhi 18:6a4db94011d3 37 ;
sahilmgandhi 18:6a4db94011d3 38
sahilmgandhi 18:6a4db94011d3 39 MODULE ?cstartup
sahilmgandhi 18:6a4db94011d3 40
sahilmgandhi 18:6a4db94011d3 41 ;; Forward declaration of sections.
sahilmgandhi 18:6a4db94011d3 42 SECTION CSTACK:DATA:NOROOT(3)
sahilmgandhi 18:6a4db94011d3 43
sahilmgandhi 18:6a4db94011d3 44 SECTION .intvec:CODE:NOROOT(2)
sahilmgandhi 18:6a4db94011d3 45
sahilmgandhi 18:6a4db94011d3 46 EXTERN __iar_program_start
sahilmgandhi 18:6a4db94011d3 47 EXTERN SystemInit
sahilmgandhi 18:6a4db94011d3 48 PUBLIC __vector_table
sahilmgandhi 18:6a4db94011d3 49 PUBLIC __vector_table_0x1c
sahilmgandhi 18:6a4db94011d3 50 PUBLIC __Vectors
sahilmgandhi 18:6a4db94011d3 51 PUBLIC __Vectors_End
sahilmgandhi 18:6a4db94011d3 52 PUBLIC __Vectors_Size
sahilmgandhi 18:6a4db94011d3 53
sahilmgandhi 18:6a4db94011d3 54 DATA
sahilmgandhi 18:6a4db94011d3 55
sahilmgandhi 18:6a4db94011d3 56 __vector_table
sahilmgandhi 18:6a4db94011d3 57 DCD sfe(CSTACK)
sahilmgandhi 18:6a4db94011d3 58 DCD Reset_Handler
sahilmgandhi 18:6a4db94011d3 59
sahilmgandhi 18:6a4db94011d3 60 DCD NMI_Handler
sahilmgandhi 18:6a4db94011d3 61 DCD HardFault_Handler
sahilmgandhi 18:6a4db94011d3 62 DCD 0
sahilmgandhi 18:6a4db94011d3 63 DCD 0
sahilmgandhi 18:6a4db94011d3 64 DCD 0
sahilmgandhi 18:6a4db94011d3 65 __vector_table_0x1c
sahilmgandhi 18:6a4db94011d3 66 DCD 0
sahilmgandhi 18:6a4db94011d3 67 DCD 0
sahilmgandhi 18:6a4db94011d3 68 DCD 0
sahilmgandhi 18:6a4db94011d3 69 DCD 0
sahilmgandhi 18:6a4db94011d3 70 DCD SVC_Handler
sahilmgandhi 18:6a4db94011d3 71 DCD 0
sahilmgandhi 18:6a4db94011d3 72 DCD 0
sahilmgandhi 18:6a4db94011d3 73 DCD PendSV_Handler
sahilmgandhi 18:6a4db94011d3 74 DCD SysTick_Handler
sahilmgandhi 18:6a4db94011d3 75
sahilmgandhi 18:6a4db94011d3 76 DCD PIN_INT0_IRQHandler ; Pin interrupt 0
sahilmgandhi 18:6a4db94011d3 77 DCD PIN_INT1_IRQHandler ; Pin interrupt 1
sahilmgandhi 18:6a4db94011d3 78 DCD PIN_INT2_IRQHandler ; Pin interrupt 2
sahilmgandhi 18:6a4db94011d3 79 DCD PIN_INT3_IRQHandler ; Pin interrupt 3
sahilmgandhi 18:6a4db94011d3 80 DCD PIN_INT4_IRQHandler ; Pin interrupt 4
sahilmgandhi 18:6a4db94011d3 81 DCD PIN_INT5_IRQHandler ; Pin interrupt 5
sahilmgandhi 18:6a4db94011d3 82 DCD PIN_INT6_IRQHandler ; Pin interrupt 6
sahilmgandhi 18:6a4db94011d3 83 DCD PIN_INT7_IRQHandler ; Pin interrupt 7
sahilmgandhi 18:6a4db94011d3 84 DCD GINT0_IRQHandler ; Port interrupt group 0
sahilmgandhi 18:6a4db94011d3 85 DCD GINT1_IRQHandler ; Port interrupt group 1
sahilmgandhi 18:6a4db94011d3 86 DCD I2C1_IRQHandler ; I2C1 interrupt
sahilmgandhi 18:6a4db94011d3 87 DCD USART1_4_IRQHandler ; USARTS 1 and 4 shared interrupt
sahilmgandhi 18:6a4db94011d3 88 DCD USART2_3_IRQHandler ; USARTS 2 and 3 shared interrupt
sahilmgandhi 18:6a4db94011d3 89 DCD SCT0_1_IRQHandler ; SCT 0 and 1 shared interrupt
sahilmgandhi 18:6a4db94011d3 90 DCD SSP1_IRQHandler ; SSP1 interrupt
sahilmgandhi 18:6a4db94011d3 91 DCD I2C0_IRQHandler ; I2C0 interrupt
sahilmgandhi 18:6a4db94011d3 92 DCD CT16B0_IRQHandler ; CT16B0 (16-bit Timer 0)
sahilmgandhi 18:6a4db94011d3 93 DCD CT16B1_IRQHandler ; CT16B1 (16-bit Timer 1)
sahilmgandhi 18:6a4db94011d3 94 DCD CT32B0_IRQHandler ; CT32B0 (32-bit Timer 0)
sahilmgandhi 18:6a4db94011d3 95 DCD CT32B1_IRQHandler ; CT32B0 (32-bit Timer 1)
sahilmgandhi 18:6a4db94011d3 96 DCD SSP0_IRQHandler ; SSP0 interrupt interrupt
sahilmgandhi 18:6a4db94011d3 97 DCD USART0_IRQHandler ; USART 0 interrupt interrupt
sahilmgandhi 18:6a4db94011d3 98 DCD USB_IRQHandler ; USB IRQ interrupt
sahilmgandhi 18:6a4db94011d3 99 DCD USB_FIQ_IRQHandler ; USB FIQ interrupt
sahilmgandhi 18:6a4db94011d3 100 DCD ADC_A_IRQHandler ; ADC A sequence (A/D Converter) interrupt
sahilmgandhi 18:6a4db94011d3 101 DCD RTC_IRQHandler ; RTC interrupt
sahilmgandhi 18:6a4db94011d3 102 DCD BOD_WDT_IRQHandler ; Shared BOD (Brownout Detect) and WDT interrupts
sahilmgandhi 18:6a4db94011d3 103 DCD FLASH_IRQHandler ; Flash Memory Controller interrupt
sahilmgandhi 18:6a4db94011d3 104 DCD DMA_IRQHandler ; DMA Controller interrupt
sahilmgandhi 18:6a4db94011d3 105 DCD ADC_B_IRQHandler ; ADC B sequence interrupt
sahilmgandhi 18:6a4db94011d3 106 DCD USBWakeup_IRQHandler ; USB wake-up interrupt
sahilmgandhi 18:6a4db94011d3 107 DCD Reserved_IRQHandler
sahilmgandhi 18:6a4db94011d3 108
sahilmgandhi 18:6a4db94011d3 109 __Vectors_End
sahilmgandhi 18:6a4db94011d3 110
sahilmgandhi 18:6a4db94011d3 111 __Vectors EQU __vector_table
sahilmgandhi 18:6a4db94011d3 112 __Vectors_Size EQU __Vectors_End - __Vectors
sahilmgandhi 18:6a4db94011d3 113
sahilmgandhi 18:6a4db94011d3 114
sahilmgandhi 18:6a4db94011d3 115 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
sahilmgandhi 18:6a4db94011d3 116 ;;
sahilmgandhi 18:6a4db94011d3 117 ;; Default interrupt handlers.
sahilmgandhi 18:6a4db94011d3 118 ;;
sahilmgandhi 18:6a4db94011d3 119 THUMB
sahilmgandhi 18:6a4db94011d3 120 PUBWEAK Reset_Handler
sahilmgandhi 18:6a4db94011d3 121 SECTION .text:CODE:NOROOT:REORDER(2)
sahilmgandhi 18:6a4db94011d3 122 Reset_Handler
sahilmgandhi 18:6a4db94011d3 123 LDR R0, =SystemInit
sahilmgandhi 18:6a4db94011d3 124 BLX R0
sahilmgandhi 18:6a4db94011d3 125 LDR R0, =__iar_program_start
sahilmgandhi 18:6a4db94011d3 126 BX R0
sahilmgandhi 18:6a4db94011d3 127
sahilmgandhi 18:6a4db94011d3 128 PUBWEAK NMI_Handler
sahilmgandhi 18:6a4db94011d3 129 SECTION .text:CODE:REORDER:NOROOT(1)
sahilmgandhi 18:6a4db94011d3 130 NMI_Handler
sahilmgandhi 18:6a4db94011d3 131 B .
sahilmgandhi 18:6a4db94011d3 132
sahilmgandhi 18:6a4db94011d3 133 PUBWEAK HardFault_Handler
sahilmgandhi 18:6a4db94011d3 134 SECTION .text:CODE:REORDER:NOROOT(1)
sahilmgandhi 18:6a4db94011d3 135 HardFault_Handler
sahilmgandhi 18:6a4db94011d3 136 B .
sahilmgandhi 18:6a4db94011d3 137
sahilmgandhi 18:6a4db94011d3 138 PUBWEAK SVC_Handler
sahilmgandhi 18:6a4db94011d3 139 SECTION .text:CODE:REORDER:NOROOT(1)
sahilmgandhi 18:6a4db94011d3 140 SVC_Handler
sahilmgandhi 18:6a4db94011d3 141 B .
sahilmgandhi 18:6a4db94011d3 142
sahilmgandhi 18:6a4db94011d3 143 PUBWEAK PendSV_Handler
sahilmgandhi 18:6a4db94011d3 144 SECTION .text:CODE:REORDER:NOROOT(1)
sahilmgandhi 18:6a4db94011d3 145 PendSV_Handler
sahilmgandhi 18:6a4db94011d3 146 B .
sahilmgandhi 18:6a4db94011d3 147
sahilmgandhi 18:6a4db94011d3 148 PUBWEAK SysTick_Handler
sahilmgandhi 18:6a4db94011d3 149 SECTION .text:CODE:REORDER:NOROOT(1)
sahilmgandhi 18:6a4db94011d3 150 SysTick_Handler
sahilmgandhi 18:6a4db94011d3 151 B .
sahilmgandhi 18:6a4db94011d3 152
sahilmgandhi 18:6a4db94011d3 153 PUBWEAK Reserved_IRQHandler
sahilmgandhi 18:6a4db94011d3 154 SECTION .text:CODE:REORDER:NOROOT(1)
sahilmgandhi 18:6a4db94011d3 155 Reserved_IRQHandler
sahilmgandhi 18:6a4db94011d3 156 B .
sahilmgandhi 18:6a4db94011d3 157
sahilmgandhi 18:6a4db94011d3 158
sahilmgandhi 18:6a4db94011d3 159 PUBWEAK PIN_INT0_IRQHandler
sahilmgandhi 18:6a4db94011d3 160 PUBWEAK PIN_INT1_IRQHandler
sahilmgandhi 18:6a4db94011d3 161 PUBWEAK PIN_INT2_IRQHandler
sahilmgandhi 18:6a4db94011d3 162 PUBWEAK PIN_INT3_IRQHandler
sahilmgandhi 18:6a4db94011d3 163 PUBWEAK PIN_INT4_IRQHandler
sahilmgandhi 18:6a4db94011d3 164 PUBWEAK PIN_INT5_IRQHandler
sahilmgandhi 18:6a4db94011d3 165 PUBWEAK PIN_INT6_IRQHandler
sahilmgandhi 18:6a4db94011d3 166 PUBWEAK PIN_INT7_IRQHandler
sahilmgandhi 18:6a4db94011d3 167 PUBWEAK GINT0_IRQHandler
sahilmgandhi 18:6a4db94011d3 168 PUBWEAK GINT1_IRQHandler
sahilmgandhi 18:6a4db94011d3 169 PUBWEAK I2C1_IRQHandler
sahilmgandhi 18:6a4db94011d3 170 PUBWEAK USART1_4_IRQHandler
sahilmgandhi 18:6a4db94011d3 171 PUBWEAK USART2_3_IRQHandler
sahilmgandhi 18:6a4db94011d3 172 PUBWEAK SCT0_1_IRQHandler
sahilmgandhi 18:6a4db94011d3 173 PUBWEAK SSP1_IRQHandler
sahilmgandhi 18:6a4db94011d3 174 PUBWEAK I2C0_IRQHandler
sahilmgandhi 18:6a4db94011d3 175 PUBWEAK CT16B0_IRQHandler
sahilmgandhi 18:6a4db94011d3 176 PUBWEAK CT16B1_IRQHandler
sahilmgandhi 18:6a4db94011d3 177 PUBWEAK CT32B0_IRQHandler
sahilmgandhi 18:6a4db94011d3 178 PUBWEAK CT32B1_IRQHandler
sahilmgandhi 18:6a4db94011d3 179 PUBWEAK SSP0_IRQHandler
sahilmgandhi 18:6a4db94011d3 180 PUBWEAK USART0_IRQHandler
sahilmgandhi 18:6a4db94011d3 181 PUBWEAK USB_IRQHandler
sahilmgandhi 18:6a4db94011d3 182 PUBWEAK USB_FIQ_IRQHandler
sahilmgandhi 18:6a4db94011d3 183 PUBWEAK ADC_A_IRQHandler
sahilmgandhi 18:6a4db94011d3 184 PUBWEAK RTC_IRQHandler
sahilmgandhi 18:6a4db94011d3 185 PUBWEAK BOD_WDT_IRQHandler
sahilmgandhi 18:6a4db94011d3 186 PUBWEAK FLASH_IRQHandler
sahilmgandhi 18:6a4db94011d3 187 PUBWEAK DMA_IRQHandler
sahilmgandhi 18:6a4db94011d3 188 PUBWEAK ADC_B_IRQHandler
sahilmgandhi 18:6a4db94011d3 189 PUBWEAK USBWakeup_IRQHandler
sahilmgandhi 18:6a4db94011d3 190
sahilmgandhi 18:6a4db94011d3 191 SECTION .text:CODE:REORDER:NOROOT(1)
sahilmgandhi 18:6a4db94011d3 192 THUMB
sahilmgandhi 18:6a4db94011d3 193
sahilmgandhi 18:6a4db94011d3 194 PIN_INT0_IRQHandler
sahilmgandhi 18:6a4db94011d3 195 PIN_INT1_IRQHandler
sahilmgandhi 18:6a4db94011d3 196 PIN_INT2_IRQHandler
sahilmgandhi 18:6a4db94011d3 197 PIN_INT3_IRQHandler
sahilmgandhi 18:6a4db94011d3 198 PIN_INT4_IRQHandler
sahilmgandhi 18:6a4db94011d3 199 PIN_INT5_IRQHandler
sahilmgandhi 18:6a4db94011d3 200 PIN_INT6_IRQHandler
sahilmgandhi 18:6a4db94011d3 201 PIN_INT7_IRQHandler
sahilmgandhi 18:6a4db94011d3 202 GINT0_IRQHandler
sahilmgandhi 18:6a4db94011d3 203 GINT1_IRQHandler
sahilmgandhi 18:6a4db94011d3 204 I2C1_IRQHandler
sahilmgandhi 18:6a4db94011d3 205 USART1_4_IRQHandler
sahilmgandhi 18:6a4db94011d3 206 USART2_3_IRQHandler
sahilmgandhi 18:6a4db94011d3 207 SCT0_1_IRQHandler
sahilmgandhi 18:6a4db94011d3 208 SSP1_IRQHandler
sahilmgandhi 18:6a4db94011d3 209 I2C0_IRQHandler
sahilmgandhi 18:6a4db94011d3 210 CT16B0_IRQHandler
sahilmgandhi 18:6a4db94011d3 211 CT16B1_IRQHandler
sahilmgandhi 18:6a4db94011d3 212 CT32B0_IRQHandler
sahilmgandhi 18:6a4db94011d3 213 CT32B1_IRQHandler
sahilmgandhi 18:6a4db94011d3 214 SSP0_IRQHandler
sahilmgandhi 18:6a4db94011d3 215 USART0_IRQHandler
sahilmgandhi 18:6a4db94011d3 216 USB_IRQHandler
sahilmgandhi 18:6a4db94011d3 217 USB_FIQ_IRQHandler
sahilmgandhi 18:6a4db94011d3 218 ADC_A_IRQHandler
sahilmgandhi 18:6a4db94011d3 219 RTC_IRQHandler
sahilmgandhi 18:6a4db94011d3 220 BOD_WDT_IRQHandler
sahilmgandhi 18:6a4db94011d3 221 FLASH_IRQHandler
sahilmgandhi 18:6a4db94011d3 222 DMA_IRQHandler
sahilmgandhi 18:6a4db94011d3 223 ADC_B_IRQHandler
sahilmgandhi 18:6a4db94011d3 224 USBWakeup_IRQHandler
sahilmgandhi 18:6a4db94011d3 225 Default_Handler
sahilmgandhi 18:6a4db94011d3 226 B Default_Handler
sahilmgandhi 18:6a4db94011d3 227
sahilmgandhi 18:6a4db94011d3 228 SECTION .crp:CODE:ROOT(2)
sahilmgandhi 18:6a4db94011d3 229 DATA
sahilmgandhi 18:6a4db94011d3 230 /* Code Read Protection
sahilmgandhi 18:6a4db94011d3 231 NO_ISP 0x4E697370 - Prevents sampling of pin PIO0_1 for entering ISP mode
sahilmgandhi 18:6a4db94011d3 232 CRP1 0x12345678 - Write to RAM command cannot access RAM below 0x10000300.
sahilmgandhi 18:6a4db94011d3 233 - Copy RAM to flash command can not write to Sector 0.
sahilmgandhi 18:6a4db94011d3 234 - Erase command can erase Sector 0 only when all sectors
sahilmgandhi 18:6a4db94011d3 235 are selected for erase.
sahilmgandhi 18:6a4db94011d3 236 - Compare command is disabled.
sahilmgandhi 18:6a4db94011d3 237 - Read Memory command is disabled.
sahilmgandhi 18:6a4db94011d3 238 CRP2 0x87654321 - Read Memory is disabled.
sahilmgandhi 18:6a4db94011d3 239 - Write to RAM is disabled.
sahilmgandhi 18:6a4db94011d3 240 - "Go" command is disabled.
sahilmgandhi 18:6a4db94011d3 241 - Copy RAM to flash is disabled.
sahilmgandhi 18:6a4db94011d3 242 - Compare is disabled.
sahilmgandhi 18:6a4db94011d3 243 CRP3 0x43218765 - Access to chip via the SWD pins is disabled. ISP entry
sahilmgandhi 18:6a4db94011d3 244 by pulling PIO0_1 LOW is disabled if a valid user code is
sahilmgandhi 18:6a4db94011d3 245 present in flash sector 0.
sahilmgandhi 18:6a4db94011d3 246 Caution: If CRP3 is selected, no future factory testing can be
sahilmgandhi 18:6a4db94011d3 247 performed on the device.
sahilmgandhi 18:6a4db94011d3 248 */
sahilmgandhi 18:6a4db94011d3 249 DCD 0xFFFFFFFF
sahilmgandhi 18:6a4db94011d3 250
sahilmgandhi 18:6a4db94011d3 251 END