12345678910111213141516171819202122232425262728293031323334353637383940 |
- #include "FreeRTOS.h"
- #include "task.h"
- #include "queue.h"
- #include "semphr.h"
- #include "utility.h"
- #include "at32f403a_407_int.h"
- #include <stdio.h>
- #if 1
- // OS stack overflow hook
- #if (configCHECK_FOR_STACK_OVERFLOW > 0)
- void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName )
- {
- NVIC_SystemReset();
- }
- #endif
- #endif
- // OS malloc failed hook
- #if (configUSE_MALLOC_FAILED_HOOK > 0)
- void vApplicationMallocFailedHook(void)
- {
- NVIC_SystemReset();
- while(1);
- }
- #endif
- //
- void print_binary_byte(uint8_t val)
- {
- for (int i = 7; i >= 0; i--)
- {
- if (val & (1 << i))
- printf("1");
- else
- printf("0");
- }
- }
|