cc26x2r1在TI-RTOS中如何使用HWI,使用定时器产生硬件中断。使系统进入HWI线程,但是在配置中断向量和定时器时出现问题。cc26x2文档并没有提及中断号,官方sdk中并没有HWI相关例子代码,这对学习TI-RTOS产生了很大的困惑,有能够参考的cc2652的HWI配置例子吗?以下是我配置的文件,系统始终不能进入HWI.
cfg文件配置如下
var Types = xdc.useModule('xdc.runtime.Types'); var halHwi0Params = new halHwi.Params(); halHwi0Params.instance.name = "halHwi0"; Program.global.halHwi0 = halHwi.create(31, "&hwi_ledController", halHwi0Params);
.c代码如下:
void hwi_ledController(){GPIO_toggle(CONFIG_LED_0); } void timer_init() {Timer_Handle timer0;Timer_Params params;Timer_init();Timer_Params_init(¶ms);params.period = 1000000;params.periodUnits = Timer_PERIOD_US;params.timerMode = Timer_CONTINUOUS_CALLBACK;params.timerCallback = hwi_ledController;timer0 = Timer_open(CONFIG_TIMER_0, ¶ms);if (timer0 == NULL) {/* Failed to initialized timer */while (1) {}}if (Timer_start(timer0) == Timer_STATUS_ERROR) {/* Failed to start timer */while (1) {}} } int main() {/* Call driver init functions */Board_init();GPIO_init();timer_init();BIOS_start(); /* terminates program and dumps SysMin output */return(0); }
Viki Shi:
Debugging provides an example of using GPIOs and Hwis.
文档请看这边:dev.ti.com/…/debugging-index.html
Daoming Liu:
回复 Viki Shi:
您好,您能截个图吗?看了您提供的连接,并没有发现如何配置TI-RTOS的HWI配置方法。我现在需要做实验学习TI-RTOS,需要在RTOS产生HWI并点亮一个led。
Viki Shi:
回复 Daoming Liu:
那推荐参考GPIOinterrupt这个例程,地址: dev.ti.com/…/node