OpenAtomFoundation / TobudOS

开放原子开源基金会孵化的物联网操作系统,捐赠前为腾讯物联网终端操作系统TencentOS Tiny
https://cloud.tencent.com/product/tos-tiny
5.97k stars 1.61k forks source link

[HUST CSE]Modify incorrect expressions passed into the assert function #360

Closed zjgfree closed 1 year ago

zjgfree commented 1 year ago

在原本的代码中,kSWM_FIXEDPIN_NUM_FUNCS在fsl_swm_connections.h中定义的值为 kSWM_FIXEDPIN_NUM_FUNCS = 0x80000041 导致assert函数无法检验条件正确性并终止程序执行。 原代码为: assert((func > 0) || func < kSWM_FIXEDPIN_NUM_FUNCS); 结合函数使用语境,将'||'修改为'&&',修改后代码如下: assert((func > 0) && func < kSWM_FIXEDPIN_NUM_FUNCS); 从而解决了这个问题。

tencent-adm commented 1 year ago

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.