syswatch.h 916 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * File : syswatch.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006 - 2018, RT-Thread Development Team
  5. *
  6. * SPDX-License-Identifier: Apache-2.0
  7. *
  8. * Change Logs:
  9. * Date Author Notes
  10. * 2020-01-10 qiyongzhong first version
  11. */
  12. #ifndef __SYSWATCH_H__
  13. #define __SYSWATCH_H__
  14. #include <syswatch_config.h>
  15. #ifdef SYSWATCH_USING
  16. typedef enum{
  17. SYSWATCH_EVENT_SYSTEM_RESET = 0, //系统复位事件,事件前回调
  18. SYSWATCH_EVENT_THREAD_KILL, //杀掉线程事件,事件前回调
  19. SYSWATCH_EVENT_THREAD_RESUMED, //恢复线程事件,事件后回调
  20. }syswatch_event_t;
  21. typedef void ( * syswatch_event_hook_t)(syswatch_event_t eid, rt_thread_t except_thread);
  22. void syswatch_set_event_hook(syswatch_event_hook_t hook);//set syswatch event callback function
  23. int syswatch_init(void);//Initialize syswatch components
  24. #endif //SYSWATCH_USING
  25. #endif //__SYSWATCH_H__