12345678910111213141516171819202122232425262728293031323334353637 |
- #include "dev_task.h"
- #include <stdint.h>
- const uint16_t dev_task_cycle_tab[8] = {
- 5,
- 10,
- 50,
- 100,
- 200,
- 500,
- 1000,
- 2000,
- };
- dev_task_flag_un dev_task_flag;
- void dev_task_clock(void)
- {
- static volatile uint32_t sys_tick_count = 0;
- uint8_t i = 0;
- sys_tick_count++;
- for (i = 0; i < TASK_MASK_QTY; i++)
- {
- if (sys_tick_count % dev_task_cycle_tab[i] == 0x00)
- {
- dev_task_flag.all |= 0x01 << i;
- }
- }
- if (sys_tick_count > 4000000000)
- {
- sys_tick_count = 0;
- }
- }
|