c_cpp 发送临时和卷STM32。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了c_cpp 发送临时和卷STM32。相关的知识,希望对你有一定的参考价值。

#include "Creelinks.h"
#include "CeTempDh11.h"
#include "CePC33V.h"

CePC33V myPc;
CeTempDh11 myDh11;
CeTempDh11Result* result;


#define MY_TASK1_STACK_BUF_SIZE 1024

CE_STK MY_TASK1_STACK_BUF[MY_TASK1_STACK_BUF_SIZE];

CeTask myTask1;

void myTask1CallBack(void * pAddPar)
{
    double voltage;
    while(1)
    {
        ceDebugOp.printf("Task 1 is running...");
        ceTempDh11Op.startConvert(&myDh11);
        voltage = cePC33VOp.getVoltage(&myPc);
        ceSystemOp.delayMs(50);
        result = ceTempDh11Op.getTemperatureAndHumidity(&myDh11);
        ceDebugOp.printf("The voltage is: %fV\n", voltage);
        ceDebugOp.printf("Convert Finish:Temperature=%d, Humidity=%d\n",
                          result->temperature, result->humidity);
        ceSystemOp.delayMs(2000);
    }
}


int main(void)
{
    ceSystemOp.initial();
    ceDebugOp.initial(R9Uart);

    ceTempDh11Op.initial(&myDh11, R1AGP);
    cePC33VOp.initial(&myPc, R20AGI);

    ceDebugOp.printf("Debug start....");
    myTask1.ID = 0x0033;
    myTask1.taskName = "My Task1";
    myTask1.callBack = myTask1CallBack;
    myTask1.pAddPar = &myTask1;
    myTask1.taskPriority = CE_TASK_PRIORITY_H;
    myTask1.taskStackBuf = MY_TASK1_STACK_BUF;
    myTask1.taskStackBufSize = MY_TASK1_STACK_BUF_SIZE;

    ceTaskOp.registerTask(&myTask1);
    ceTaskOp.mainTask();

    return 0;
}

以上是关于c_cpp 发送临时和卷STM32。的主要内容,如果未能解决你的问题,请参考以下文章

c_cpp STM32F103超频

c_cpp sw4stm32 helloworld

c_cpp STM32F4标准库GPIO设置

c_cpp STM32 C简单粗暴的散列映射hashmap

c_cpp sw4stm32_use_semihosting

STM32中vPortFree()出现异常的问题解决(未完成)