Beispiel #1
0
/*******************************************************************************************************
 *
 *         函数名称: 
 *
 *         函数功能:  温度控制任务
 *
 *         入口参数: 
 *
 *         出口参数: 无
 *
 *             说明:
 *
 *******************************************************************************************************/
void  TmptrCtrlTask(void *p_arg)
{
    AppData.set_tmptr = (int16_t)((uint32_t)p_arg);
    
    while(TRUE_P)
    {
        if (AppData.set_tmptr >= (AppData.cur_tmptr + 2)) //2度
        {
            OUT_WARM_UP();
            //OUT_H_WARM_UP();

        }
        else if (AppData.cur_tmptr >= (AppData.set_tmptr + 2)) //2度
        {
             //风冷
             //OUT_COOL_DW();
             OUT_COOL_DW_FAN();
                                                   
        }
        
        OS_Trace("TmptrCtrlTask Run\n");
        
        OSTimeDlyHMSM(0, 0, 0, 800);

    }

}
Beispiel #2
0
Status OS_TimeGet(const OS_TimeFormat format, OS_DateTime* os_time_p)
{
Status s;
    if (OS_NULL == os_time_p) { return S_INVALID_PTR; }
    IF_STATUS(s = OS_DriverIoCtl(os_env.drv_rtc, DRV_REQ_RTC_TIME_GET, (void*)os_time_p)) { return s; }
    //Convert time to specified format.
    switch (format) {
        case OS_TIME_UNDEF:
        case OS_TIME_GMT:
        case OS_TIME_GMT_OFFSET:
        case OS_TIME_LOCAL:
        case OS_TIME_UPTIME:
            break;
        default:
            OS_Trace(D_WARNING, "\nUndefined time format!");
            break;
    }
    return s;
}
Beispiel #3
0
/*******************************************************************************************************
 *
 *         函数名称: 
 *
 *         函数功能: 温度采样值数据获取
 *
 *         入口参数: 
 *
 *         出口参数: 无
 *
 *             说明:
 *
 *******************************************************************************************************/
void  TmptrSamplTask(void *p_arg)
{

    INT16S       tmptr[2] = {0};
    INT16S       rt_v = 1;     
    //uint32_t     debug_v = 0;
    

    OSTimeDlyHMSM(0, 0, 0, 100);
    while(TRUE_P) 
    {
        rt_v = GemTemptr(&tmptr[0]);
        if (rt_v > 0)
        { 
            
            //SendFrame(FRM_CMD_TMPTR_V, (uint8_t *)&tmptr, 4);   //4即4个字节
            //debug_v++;
            SendFrame(FRM_CMD_TMPTR_V, (uint8_t *)&tmptr[0], 4);   //4即4个字节
            AppData.cur_tmptr = tmptr[0];
            OS_Trace("Tmptr Value = %d\n",tmptr[0]);
    
        }
        else if (rt_v == TMPTR_INIT_TMOUT)
        {
           ;///TRACE("init timeout\r\n");
        }
        else if (rt_v == TMPTR_INIT_OVER)
        {
           ; ///TRACE("init over\r\n");
        }
        
        OSTimeDlyHMSM(0, 0, 0, 200);

    } 


}
Beispiel #4
0
void Trace(CONST INT8S File[], INT16U Line)
{
  OS_Trace(File,"FUNC",Line); 
}