兼容rt-thread5.0以上版本,rt_mq_recv返回值的问题#13
Open
zenghaicang wants to merge 1 commit intoRT-Thread-packages:masterfrom
Open
兼容rt-thread5.0以上版本,rt_mq_recv返回值的问题#13zenghaicang wants to merge 1 commit intoRT-Thread-packages:masterfrom
zenghaicang wants to merge 1 commit intoRT-Thread-packages:masterfrom
Conversation
Rbb666
reviewed
Mar 15, 2025
|
|
||
| result = rt_mq_recv(player->mq, &msg, sizeof(struct play_msg), timeout); | ||
| if (result != RT_EOK) | ||
| #if RT_VER_NUM > 0x50000 |
Contributor
There was a problem hiding this comment.
请改成 #if defined(RT_VERSION_CHECK) && (RTTHREAD_VERSION >= RT_VERSION_CHECK(5, 0, 1)) 谢谢
Rbb666
reviewed
Mar 15, 2025
| @@ -315,7 +315,11 @@ static int wavplayer_event_handler(struct wavplayer *player, int timeout) | |||
| #endif | |||
|
|
|||
| result = rt_mq_recv(player->mq, &msg, sizeof(struct play_msg), timeout); | |||
Contributor
|
@zenghaicang 直接按照这个改下吧,已经验证过了: rt_ssize_t result;
struct play_msg msg;
#if (DBG_LEVEL >= DBG_LOG)
rt_uint8_t last_state;
#endif
result = rt_mq_recv(player->mq, &msg, sizeof(struct play_msg), timeout);
#if defined(RT_VERSION_CHECK) && (RTTHREAD_VERSION >= RT_VERSION_CHECK(5, 0, 1))
if (result <= 0)
#else
if (RT_EOK != result)
#endif
{
event = PLAYER_EVENT_NONE;
return event;
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
使用RT_VER_NUM宏,兼容rt-thread5.0以上版本。