MQX Lite task stub

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MQX Lite task stub

跳至解决方案
1,234 次查看
carloscuev
Contributor V

Hi, I'm starting to use MQX Lite and I'm noticing that it creates a stub with a int counter; and a counter++; line like this:

MQX Lite.png

The questions are: Is it really needed? Why does it instruct to write our code after the counter++? Is it ok if I remove it?

I've removed it and my LedTask still works fine, is there any warning on doing so?

Thanks.

0 项奖励
回复
1 解答
1,137 次查看
RadekS
NXP Employee
NXP Employee

No, it is not needed.

It is just example code.

You can delete it or modify.....

In fact endless while loop is also just typical example code, you can use any other approach.

Variable “counter” could be sometimes used for debugging purposes – for test whether task something does (however you have LED output, so it is duplicity information)….

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,138 次查看
RadekS
NXP Employee
NXP Employee

No, it is not needed.

It is just example code.

You can delete it or modify.....

In fact endless while loop is also just typical example code, you can use any other approach.

Variable “counter” could be sometimes used for debugging purposes – for test whether task something does (however you have LED output, so it is duplicity information)….

0 项奖励
回复
1,137 次查看
carloscuev
Contributor V

Great, thanks!

0 项奖励
回复