systick_wrapper_ual.s 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. PRESERVE8
  18. THUMB
  19. AREA |.text|, CODE, READONLY
  20. |$Sub$$SysTick_Handler| PROC
  21. EXPORT |$Sub$$SysTick_Handler|
  22. IMPORT user_code_insert_to_systick_handler
  23. IMPORT |$Super$$SysTick_Handler|
  24. push {r4, r5}
  25. push {r4, lr}
  26. LDR R0, =user_code_insert_to_systick_handler
  27. BLX R0
  28. pop {r4, r5}
  29. mov lr, r5
  30. pop {r4, r5}
  31. LDR R0, =|$Super$$SysTick_Handler|
  32. BX R0
  33. ENDP
  34. ALIGN
  35. AREA |.text|, CODE, READONLY
  36. __ensure_systick_wrapper PROC
  37. EXPORT __ensure_systick_wrapper
  38. NOP
  39. BX LR
  40. ENDP
  41. END