/boards/ek-lm3s3748/qs-scope/startup_ewarm.c

https://github.com/hrshygoodness/Luminary-Micro-Library · C · 229 lines · 112 code · 11 blank · 106 comment · 3 complexity · 9bf3efa61b4f049de27325f311d82754 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) 2008-2013 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 10636 of the EK-LM3S3748 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 DataAcquisitionADCSeq0IntHandler(void);
  46. extern void DataAcquisitionAbortIntHandler(void);
  47. extern void ClassDPWMHandler(void);
  48. extern void SysTickIntHandler(void);
  49. extern void UARTStdioIntHandler(void);
  50. extern void USB0DualModeIntHandler(void);
  51. //*****************************************************************************
  52. //
  53. // The entry point for the application startup code.
  54. //
  55. //*****************************************************************************
  56. extern void __iar_program_start(void);
  57. //*****************************************************************************
  58. //
  59. // Reserve space for the system stack.
  60. //
  61. //*****************************************************************************
  62. static unsigned long pulStack[256] @ ".noinit";
  63. //*****************************************************************************
  64. //
  65. // A union that describes the entries of the vector table. The union is needed
  66. // since the first entry is the stack pointer and the remainder are function
  67. // pointers.
  68. //
  69. //*****************************************************************************
  70. typedef union
  71. {
  72. void (*pfnHandler)(void);
  73. unsigned long ulPtr;
  74. }
  75. uVectorEntry;
  76. //*****************************************************************************
  77. //
  78. // The vector table. Note that the proper constructs must be placed on this to
  79. // ensure that it ends up at physical address 0x0000.0000.
  80. //
  81. //*****************************************************************************
  82. __root const uVectorEntry __vector_table[] @ ".intvec" =
  83. {
  84. { .ulPtr = (unsigned long)pulStack + sizeof(pulStack) },
  85. // The initial stack pointer
  86. ResetISR, // The reset handler
  87. NmiSR, // The NMI handler
  88. FaultISR, // The hard fault handler
  89. IntDefaultHandler, // The MPU fault handler
  90. IntDefaultHandler, // The bus fault handler
  91. IntDefaultHandler, // The usage fault handler
  92. 0, // Reserved
  93. 0, // Reserved
  94. 0, // Reserved
  95. 0, // Reserved
  96. IntDefaultHandler, // SVCall handler
  97. IntDefaultHandler, // Debug monitor handler
  98. 0, // Reserved
  99. IntDefaultHandler, // The PendSV handler
  100. SysTickIntHandler, // The SysTick handler
  101. IntDefaultHandler, // GPIO Port A
  102. DataAcquisitionAbortIntHandler, // GPIO Port B
  103. IntDefaultHandler, // GPIO Port C
  104. IntDefaultHandler, // GPIO Port D
  105. IntDefaultHandler, // GPIO Port E
  106. UARTStdioIntHandler, // UART0 Rx and Tx
  107. IntDefaultHandler, // UART1 Rx and Tx
  108. IntDefaultHandler, // SSI0 Rx and Tx
  109. IntDefaultHandler, // I2C0 Master and Slave
  110. IntDefaultHandler, // PWM Fault
  111. IntDefaultHandler, // PWM Generator 0
  112. ClassDPWMHandler, // PWM Generator 1
  113. IntDefaultHandler, // PWM Generator 2
  114. IntDefaultHandler, // Quadrature Encoder 0
  115. DataAcquisitionADCSeq0IntHandler, // ADC Sequence 0
  116. IntDefaultHandler, // ADC Sequence 1
  117. IntDefaultHandler, // ADC Sequence 2
  118. IntDefaultHandler, // ADC Sequence 3
  119. IntDefaultHandler, // Watchdog timer
  120. IntDefaultHandler, // Timer 0 subtimer A
  121. IntDefaultHandler, // Timer 0 subtimer B
  122. IntDefaultHandler, // Timer 1 subtimer A
  123. IntDefaultHandler, // Timer 1 subtimer B
  124. IntDefaultHandler, // Timer 2 subtimer A
  125. IntDefaultHandler, // Timer 2 subtimer B
  126. IntDefaultHandler, // Analog Comparator 0
  127. IntDefaultHandler, // Analog Comparator 1
  128. IntDefaultHandler, // Analog Comparator 2
  129. IntDefaultHandler, // System Control (PLL, OSC, BO)
  130. IntDefaultHandler, // FLASH Control
  131. IntDefaultHandler, // GPIO Port F
  132. IntDefaultHandler, // GPIO Port G
  133. IntDefaultHandler, // GPIO Port H
  134. IntDefaultHandler, // UART2 Rx and Tx
  135. IntDefaultHandler, // SSI1 Rx and Tx
  136. IntDefaultHandler, // Timer 3 subtimer A
  137. IntDefaultHandler, // Timer 3 subtimer B
  138. IntDefaultHandler, // I2C1 Master and Slave
  139. IntDefaultHandler, // Quadrature Encoder 1
  140. IntDefaultHandler, // CAN0
  141. IntDefaultHandler, // CAN1
  142. IntDefaultHandler, // CAN2
  143. IntDefaultHandler, // Ethernet
  144. IntDefaultHandler, // Hibernate
  145. USB0DualModeIntHandler, // USB0
  146. IntDefaultHandler, // PWM Generator 3
  147. IntDefaultHandler, // uDMA Software Transfer
  148. IntDefaultHandler // uDMA Error
  149. };
  150. //*****************************************************************************
  151. //
  152. // This is the code that gets called when the processor first starts execution
  153. // following a reset event. Only the absolutely necessary set is performed,
  154. // after which the application supplied entry() routine is called. Any fancy
  155. // actions (such as making decisions based on the reset cause register, and
  156. // resetting the bits in that register) are left solely in the hands of the
  157. // application.
  158. //
  159. //*****************************************************************************
  160. void
  161. ResetISR(void)
  162. {
  163. //
  164. // Call the application's entry point.
  165. //
  166. __iar_program_start();
  167. }
  168. //*****************************************************************************
  169. //
  170. // This is the code that gets called when the processor receives a NMI. This
  171. // simply enters an infinite loop, preserving the system state for examination
  172. // by a debugger.
  173. //
  174. //*****************************************************************************
  175. static void
  176. NmiSR(void)
  177. {
  178. //
  179. // Enter an infinite loop.
  180. //
  181. while(1)
  182. {
  183. }
  184. }
  185. //*****************************************************************************
  186. //
  187. // This is the code that gets called when the processor receives a fault
  188. // interrupt. This simply enters an infinite loop, preserving the system state
  189. // for examination by a debugger.
  190. //
  191. //*****************************************************************************
  192. static void
  193. FaultISR(void)
  194. {
  195. //
  196. // Enter an infinite loop.
  197. //
  198. while(1)
  199. {
  200. }
  201. }
  202. //*****************************************************************************
  203. //
  204. // This is the code that gets called when the processor receives an unexpected
  205. // interrupt. This simply enters an infinite loop, preserving the system state
  206. // for examination by a debugger.
  207. //
  208. //*****************************************************************************
  209. static void
  210. IntDefaultHandler(void)
  211. {
  212. //
  213. // Go into an infinite loop.
  214. //
  215. while(1)
  216. {
  217. }
  218. }