app_freertos.c 710 B

12345678910111213141516171819202122232425
  1. #include <cmsis_os2.h>
  2. #include <FreeRTOS.h>
  3. #include <task.h>
  4. #include <main.h>
  5. void systemd(void *argument);
  6. osThreadId_t systemdHandle;
  7. const osThreadAttr_t systemd_attributes = {
  8. .name = "systemd",
  9. .priority = (osPriority_t) osPriorityNormal,
  10. .stack_size = 1024
  11. };
  12. void vApplicationStackOverflowHook(TaskHandle_t xTask, signed char *pcTaskName) {
  13. /* Run time stack overflow checking is performed if
  14. configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is
  15. called if a stack overflow is detected. */
  16. asm("bkpt 1");
  17. while(1);
  18. }
  19. void MX_FREERTOS_Init(void) {
  20. systemdHandle = osThreadNew(systemd, NULL, &systemd_attributes);
  21. }