nvic_addr.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* mbed Microcontroller Library
  2. * Copyright (c) 2017-2017 ARM Limited
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef NVIC_ADDR_H
  17. #define NVIC_ADDR_H
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #if defined(__ICCARM__)
  22. #pragma section=".intvec"
  23. #define NVIC_FLASH_VECTOR_ADDRESS ((uint32_t)__section_begin(".intvec"))
  24. #elif defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050))
  25. extern uint32_t Load$$LR$$LR_IROM1$$Base[];
  26. #define NVIC_FLASH_VECTOR_ADDRESS ((uint32_t)Load$$LR$$LR_IROM1$$Base)
  27. #elif defined(__GNUC__)
  28. extern uint32_t g_pfnVectors[];
  29. #define NVIC_FLASH_VECTOR_ADDRESS ((uint32_t)g_pfnVectors)
  30. #else
  31. #error "Flash vector address not set for this toolchain"
  32. #endif
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif