#include "myrtos.h"

osThreadId_t pHTaskHandle;
const osThreadAttr_t pHTask_attributes = {
  .name = "pHTask",
  .stack_size = 256 * 4,
  .priority = (osPriority_t) osPriorityLow,
};
__weak void pHTask(void *argument)
{
    for (;;)
    { 
        osDelay(1); 
    }
}


osThreadId_t voltageTaskHandle;
const osThreadAttr_t voltageTask_attributes = {
  .name = "voltageTask",
  .stack_size = 256 * 4,
  .priority = (osPriority_t) osPriorityLow,
};
__weak void voltageTask(void *argument)
{
    for (;;)
    { 
        osDelay(1); 
    }
}


osThreadId_t measureTaskHandle;
const osThreadAttr_t measureTask_attributes = {
  .name = "measureTask",
  .stack_size = 256 * 4,
  .priority = (osPriority_t) osPriorityLow,
};
__weak void measureTask(void *argument)
{
    for (;;)
    { 
        osDelay(1); 
    }
}

osTimerId_t measureTimerHandle;
const osTimerAttr_t measureTimer_attributes = {
  .name = "measureTimer"
};
__weak void measureTimer_Callback(void *argument)
{
}


/*  放在尾部 否则要在头文件 声明函数*/
void RTOS_Port(void)
{
  measureTaskHandle = osThreadNew( measureTask, NULL, &measureTask_attributes );
  measureTimerHandle = osTimerNew(measureTimer_Callback, osTimerPeriodic, NULL, &measureTimer_attributes);
 
  pHTaskHandle = osThreadNew( pHTask, NULL, &pHTask_attributes );
  voltageTaskHandle = osThreadNew( voltageTask, NULL, &measureTask_attributes );

}



