summaryrefslogtreecommitdiff
path: root/components/rust/core/src/api/queue.rs
diff options
context:
space:
mode:
authoryan hu <[email protected]>2026-08-07 18:05:09 +0800
committerRbb666 <[email protected]>2026-08-21 11:17:57 +0800
commit30af7388a4077354f6083082fee040595978bbac (patch)
treedfa0440a884847ff7d803bb3113dd3f9f916f74b /components/rust/core/src/api/queue.rs
parent339bffb702b911b55b0e6d54fa5ad9116295f048 (diff)
[rust][tools] Fix Rust build example configuration handling
Improve the Rust build integration across core, applications, components, and module examples. Fix build failure propagation, target and feature handling, linker flags, example configuration semantics, and add STM32 CI attach coverage.
Diffstat (limited to 'components/rust/core/src/api/queue.rs')
-rw-r--r--components/rust/core/src/api/queue.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/components/rust/core/src/api/queue.rs b/components/rust/core/src/api/queue.rs
index 96665e47f2..8a77374b90 100644
--- a/components/rust/core/src/api/queue.rs
+++ b/components/rust/core/src/api/queue.rs
@@ -20,7 +20,7 @@ pub type APIRawQueue = rt_mq_t;
pub(crate) fn queue_create(name: &str, len: u64, message_size: u64) -> Option<APIRawQueue> {
let s = CString::new(name).unwrap();
let raw;
- unsafe { raw = rt_mq_create(s.as_ptr(), message_size, len, 0) }
+ unsafe { raw = rt_mq_create(s.as_ptr(), message_size as rt_size_t, len as rt_size_t, 0) }
if raw == ptr::null_mut() {
None
} else {
@@ -35,7 +35,7 @@ pub(crate) fn queue_send_wait(
msg_size: u64,
tick: i32,
) -> RttCResult {
- unsafe { rt_mq_send_wait(handle, msg, msg_size, tick).into() }
+ unsafe { rt_mq_send_wait(handle, msg, msg_size as rt_size_t, tick).into() }
}
#[inline]
@@ -45,7 +45,12 @@ pub(crate) fn queue_receive_wait(
msg_size: u64,
tick: i32,
) -> RttCResult {
- unsafe { rt_mq_recv(handle, msg, msg_size, tick).into() }
+ let ret = unsafe { rt_mq_recv(handle, msg, msg_size as rt_size_t, tick) };
+ if ret >= 0 {
+ RttCResult::Ok
+ } else {
+ ret.into()
+ }
}
#[inline]