systick_wrapper_gcc.S 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ;/****************************************************************************
  2. ;* Copyright 2022 Gorgon Meducer (Email:embedded_zhuoran@hotmail.com) *
  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. ;****************************************************************************/
  17. .syntax unified
  18. .arch armv6-m
  19. .text
  20. .thumb
  21. .thumb_func
  22. .align 2
  23. .globl __wrap_SysTick_Handler
  24. .type __wrap_SysTick_Handler, %function
  25. __wrap_SysTick_Handler:
  26. push {r4, r5}
  27. push {r4, lr}
  28. ldr R0, =user_code_insert_to_systick_handler
  29. blx R0
  30. pop {r4, r5}
  31. mov lr, r5
  32. pop {r4, r5}
  33. ldr R0, =__real_SysTick_Handler
  34. bx R0
  35. .globl __ensure_systick_wrapper
  36. .type __ensure_systick_wrapper, %function
  37. __ensure_systick_wrapper:
  38. bx lr