/boards/dk-lm3s9b96-em2-cc1101_868-simpliciti/simpliciti_hub_ap/startup_ewarm.c

https://github.com/hrshygoodness/Luminary-Micro-Library · C · 235 lines · 118 code · 11 blank · 106 comment · 3 complexity · e7d8525d0ebeab44a6818b0cae9428f8 MD5 · raw file

  1. //*****************************************************************************
  2. //
  3. // startup_ewarm.c - Startup code for use with IAR's Embedded Workbench,
  4. // version 5.
  5. //
  6. // Copyright (c) 2010-2012 Texas Instruments Incorporated. All rights reserved.
  7. // Software License Agreement
  8. //
  9. // Texas Instruments (TI) is supplying this software for use solely and
  10. // exclusively on TI's microcontroller products. The software is owned by
  11. // TI and/or its suppliers, and is protected under applicable copyright
  12. // laws. You may not combine this software with "viral" open-source
  13. // software in order to form a larger program.
  14. //
  15. // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  16. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  17. // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  18. // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  19. // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  20. // DAMAGES, FOR ANY REASON WHATSOEVER.
  21. //
  22. // This is part of revision 9107 of the DK-LM3S9B96-EM2-CC1101_868-SIMPLICITI Firmware Package.
  23. //
  24. //*****************************************************************************
  25. //*****************************************************************************
  26. //
  27. // Enable the IAR extensions for this source file.
  28. //
  29. //*****************************************************************************
  30. #pragma language=extended
  31. //*****************************************************************************
  32. //
  33. // Forward declaration of the default fault handlers.
  34. //
  35. //*****************************************************************************
  36. void ResetISR(void);
  37. static void NmiSR(void);
  38. static void FaultISR(void);
  39. static void IntDefaultHandler(void);
  40. //*****************************************************************************
  41. //
  42. // External declarations for the interrupt handlers used by the application.
  43. //
  44. //*****************************************************************************
  45. extern void TouchScreenIntHandler(void);
  46. extern void BSP_GpioPort1Isr(void);
  47. extern void BSP_GpioPort1Isr(void);
  48. extern void BSP_GpioPort1Isr(void);
  49. extern void SysTickHandler(void);
  50. //*****************************************************************************
  51. //
  52. // The entry point for the application startup code.
  53. //
  54. //*****************************************************************************
  55. extern void __iar_program_start(void);
  56. //*****************************************************************************
  57. //
  58. // Reserve space for the system stack.
  59. //
  60. //*****************************************************************************
  61. static unsigned long pulStack[256] @ ".noinit";
  62. //*****************************************************************************
  63. //
  64. // A union that describes the entries of the vector table. The union is needed
  65. // since the first entry is the stack pointer and the remainder are function
  66. // pointers.
  67. //
  68. //*****************************************************************************
  69. typedef union
  70. {
  71. void (*pfnHandler)(void);
  72. unsigned long ulPtr;
  73. }
  74. uVectorEntry;
  75. //*****************************************************************************
  76. //
  77. // The vector table. Note that the proper constructs must be placed on this to
  78. // ensure that it ends up at physical address 0x0000.0000.
  79. //
  80. //*****************************************************************************
  81. __root const uVectorEntry __vector_table[] @ ".intvec" =
  82. {
  83. { .ulPtr = (unsigned long)pulStack + sizeof(pulStack) },
  84. // The initial stack pointer
  85. ResetISR, // The reset handler
  86. NmiSR, // The NMI handler
  87. FaultISR, // The hard fault handler
  88. IntDefaultHandler, // The MPU fault handler
  89. IntDefaultHandler, // The bus fault handler
  90. IntDefaultHandler, // The usage fault handler
  91. 0, // Reserved
  92. 0, // Reserved
  93. 0, // Reserved
  94. 0, // Reserved
  95. IntDefaultHandler, // SVCall handler
  96. IntDefaultHandler, // Debug monitor handler
  97. 0, // Reserved
  98. IntDefaultHandler, // The PendSV handler
  99. SysTickHandler, // The SysTick handler
  100. IntDefaultHandler, // GPIO Port A
  101. IntDefaultHandler, // GPIO Port B
  102. BSP_GpioPort1Isr, // GPIO Port C
  103. IntDefaultHandler, // GPIO Port D
  104. IntDefaultHandler, // GPIO Port E
  105. IntDefaultHandler, // UART0 Rx and Tx
  106. IntDefaultHandler, // UART1 Rx and Tx
  107. IntDefaultHandler, // SSI0 Rx and Tx
  108. IntDefaultHandler, // I2C0 Master and Slave
  109. IntDefaultHandler, // PWM Fault
  110. IntDefaultHandler, // PWM Generator 0
  111. IntDefaultHandler, // PWM Generator 1
  112. IntDefaultHandler, // PWM Generator 2
  113. IntDefaultHandler, // Quadrature Encoder 0
  114. IntDefaultHandler, // ADC Sequence 0
  115. IntDefaultHandler, // ADC Sequence 1
  116. IntDefaultHandler, // ADC Sequence 2
  117. TouchScreenIntHandler, // ADC Sequence 3
  118. IntDefaultHandler, // Watchdog timer
  119. IntDefaultHandler, // Timer 0 subtimer A
  120. IntDefaultHandler, // Timer 0 subtimer B
  121. IntDefaultHandler, // Timer 1 subtimer A
  122. IntDefaultHandler, // Timer 1 subtimer B
  123. IntDefaultHandler, // Timer 2 subtimer A
  124. IntDefaultHandler, // Timer 2 subtimer B
  125. IntDefaultHandler, // Analog Comparator 0
  126. IntDefaultHandler, // Analog Comparator 1
  127. IntDefaultHandler, // Analog Comparator 2
  128. IntDefaultHandler, // System Control (PLL, OSC, BO)
  129. IntDefaultHandler, // FLASH Control
  130. IntDefaultHandler, // GPIO Port F
  131. BSP_GpioPort1Isr, // GPIO Port G
  132. BSP_GpioPort1Isr, // GPIO Port H
  133. IntDefaultHandler, // UART2 Rx and Tx
  134. IntDefaultHandler, // SSI1 Rx and Tx
  135. IntDefaultHandler, // Timer 3 subtimer A
  136. IntDefaultHandler, // Timer 3 subtimer B
  137. IntDefaultHandler, // I2C1 Master and Slave
  138. IntDefaultHandler, // Quadrature Encoder 1
  139. IntDefaultHandler, // CAN0
  140. IntDefaultHandler, // CAN1
  141. IntDefaultHandler, // CAN2
  142. IntDefaultHandler, // Ethernet
  143. IntDefaultHandler, // Hibernate
  144. IntDefaultHandler, // USB0
  145. IntDefaultHandler, // PWM Generator 3
  146. IntDefaultHandler, // uDMA Software Transfer
  147. IntDefaultHandler, // uDMA Error
  148. IntDefaultHandler, // ADC1 Sequence 0
  149. IntDefaultHandler, // ADC1 Sequence 1
  150. IntDefaultHandler, // ADC1 Sequence 2
  151. IntDefaultHandler, // ADC1 Sequence 3
  152. IntDefaultHandler, // I2S0
  153. IntDefaultHandler, // External Bus Interface 0
  154. IntDefaultHandler // GPIO Port J
  155. };
  156. //*****************************************************************************
  157. //
  158. // This is the code that gets called when the processor first starts execution
  159. // following a reset event. Only the absolutely necessary set is performed,
  160. // after which the application supplied entry() routine is called. Any fancy
  161. // actions (such as making decisions based on the reset cause register, and
  162. // resetting the bits in that register) are left solely in the hands of the
  163. // application.
  164. //
  165. //*****************************************************************************
  166. void
  167. ResetISR(void)
  168. {
  169. //
  170. // Call the application's entry point.
  171. //
  172. __iar_program_start();
  173. }
  174. //*****************************************************************************
  175. //
  176. // This is the code that gets called when the processor receives a NMI. This
  177. // simply enters an infinite loop, preserving the system state for examination
  178. // by a debugger.
  179. //
  180. //*****************************************************************************
  181. static void
  182. NmiSR(void)
  183. {
  184. //
  185. // Enter an infinite loop.
  186. //
  187. while(1)
  188. {
  189. }
  190. }
  191. //*****************************************************************************
  192. //
  193. // This is the code that gets called when the processor receives a fault
  194. // interrupt. This simply enters an infinite loop, preserving the system state
  195. // for examination by a debugger.
  196. //
  197. //*****************************************************************************
  198. static void
  199. FaultISR(void)
  200. {
  201. //
  202. // Enter an infinite loop.
  203. //
  204. while(1)
  205. {
  206. }
  207. }
  208. //*****************************************************************************
  209. //
  210. // This is the code that gets called when the processor receives an unexpected
  211. // interrupt. This simply enters an infinite loop, preserving the system state
  212. // for examination by a debugger.
  213. //
  214. //*****************************************************************************
  215. static void
  216. IntDefaultHandler(void)
  217. {
  218. //
  219. // Go into an infinite loop.
  220. //
  221. while(1)
  222. {
  223. }
  224. }