#include "mcu_init.h" #include "tos.h" #define TASK_SIZE 1024 k_task_t k_task_task1; k_task_t k_task_task2; uint8_t k_task1_stk[TASK_SIZE]; uint8_t k_task2_stk[TASK_SIZE]; int share = 0xCBA7F9; k_sem_t sem; typedef struct { int port; int pin; } Led_t; Led_t leds[] = { { LEDR_GPIO_PORT, LEDR_PIN }, { LEDG_GPIO_PORT, LEDG_PIN }, { LEDB_GPIO_PORT, LEDB_PIN } }; void task1(void *pdata) { int task_cnt1 = 0; while (1) { printf("hello world from %s cnt: %d\n", __func__, task_cnt1++); tos_sem_pend(&sem, ~0U); for(int i=0; i