RTX_hook.c 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /**************************************************************************/
  2. /*!
  3. @file rtx_hook.c
  4. @author Hau Huynh
  5. @brief Board file for the LPC1347 LPCXpresso board from NXP
  6. @ingroup Boards
  7. @section LICENSE
  8. Software License Agreement (BSD License)
  9. Copyright (c) 2012 K. Townsend
  10. All rights reserved.
  11. Redistribution and use in source and binary forms, with or without
  12. modification, are permitted provided that the following conditions are met:
  13. 1. Redistributions of source code must retain the above copyright
  14. notice, this list of conditions and the following disclaimer.
  15. 2. Redistributions in binary form must reproduce the above copyright
  16. notice, this list of conditions and the following disclaimer in the
  17. documentation and/or other materials provided with the distribution.
  18. 3. Neither the name of the copyright holders nor the
  19. names of its contributors may be used to endorse or promote products
  20. derived from this software without specific prior written permission.
  21. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
  22. EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  23. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  24. DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
  25. DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  26. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  27. LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  28. ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  30. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. */
  32. /**************************************************************************/
  33. #include "projectconfig.h"
  34. #if defined CFG_CMSIS_RTOS
  35. /*----------------------------------------------------------------------------
  36. * Global Functions
  37. *---------------------------------------------------------------------------*/
  38. /*--------------------------- os_idle_demon ---------------------------------*/
  39. void os_idle_demon (void) {
  40. /* The idle demon is a system thread, running when no other thread is */
  41. /* ready to run. */
  42. for (;;) {
  43. /* HERE: include optional user code to be executed when no thread runs.*/
  44. }
  45. }
  46. #if (OS_SYSTICK == 0) // Functions for alternative timer as RTX kernel timer
  47. /*--------------------------- os_tick_init ----------------------------------*/
  48. // Initialize alternative hardware timer as RTX kernel timer
  49. // Return: IRQ number of the alternative hardware timer
  50. int os_tick_init (void) {
  51. return (-1); /* Return IRQ number of timer (0..239) */
  52. }
  53. /*--------------------------- os_tick_val -----------------------------------*/
  54. // Get alternative hardware timer current value (0 .. OS_TRV)
  55. uint32_t os_tick_val (void) {
  56. return (0);
  57. }
  58. /*--------------------------- os_tick_ovf -----------------------------------*/
  59. // Get alternative hardware timer overflow flag
  60. // Return: 1 - overflow, 0 - no overflow
  61. uint32_t os_tick_ovf (void) {
  62. return (0);
  63. }
  64. /*--------------------------- os_tick_irqack --------------------------------*/
  65. // Acknowledge alternative hardware timer interrupt
  66. void os_tick_irqack (void) {
  67. /* ... */
  68. }
  69. #endif // (OS_SYSTICK == 0)
  70. /*--------------------------- os_error --------------------------------------*/
  71. void os_error (uint32_t err_code) {
  72. /* This function is called when a runtime error is detected. Parameter */
  73. /* 'err_code' holds the runtime error code (defined in RTL.H). */
  74. /* HERE: include optional code to be executed on runtime error. */
  75. for (;;);
  76. }
  77. /*----------------------------------------------------------------------------
  78. * end of file
  79. *---------------------------------------------------------------------------*/
  80. #endif