This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] CC2642R-Q1:多角色示例-实施1ms 计时器

Guru**** 2587365 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/1406521/cc2642r-q1-multi-role-example---implement-1ms-timer

器件型号:CC2642R-Q1

工具与软件:

你好

我尝试为 DRV8243实现控制功能、为此、我准备了一个计时器。 但是、当我调用 Timer_start 函数时、处理器会冻结。 请帮帮我。

uint8_t 状态;
int *ptrInteger =&gui_deviceControlUpdateTask;
//(*fun_ptr)=&GUI_deviceControlUpdateTask;

Timer_Params_(T&params);
paramstime.periodUnits = Timer_period_Hz;
paramstime.period = 1000;
paramstime.timerMode = Timer_continuous_callback;
paramstime.timerCallback =* ptrInteger;
HandleTime = Timer_open (CONFIG_TIMER_0、&paramstime);
if (HandleTime == NULL){
// Timer_open()失败
display_printf (dispHandle、13、0、"drv824xInithandlefail:");
}
STATUS = Timer_start (HandleTime);
如果(STATUS = Timer_STATUS_ERROR){
//Timer_start()失败
display_printf (dispHandle、14、0、"drv824xInitfail:");
}
//睡眠(10000 );
// Timer_stop (HandleTime);

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    我看到此代码中有两个令人关注的行:

    int *ptrInteger = &gui_deviceControlUpdateTask;
    
    
    paramstime.timerCallback = *ptrInteger;
    

    。  paramstime.timerCallback 应该使用一个函数指针、但是、看起来你在取消对整数的引用(我将关闭变量的命名)。

    您是否介意多给我一些关于代码的信息?

    我能看到回调的代码吗?

    此致!

    Nima Behmanesh