Comments (3)
No, queues cannot be used for heap allocated data structures, which is by FreeRTOS's design, and which is enforced using Rust's copy semantics. Try to redesign your application to pass only Copy structures. If you really need that, you might want to look into storing data into a global, shared vector (Arc<Mutex<Vec>>) and passing plain IDs using queues.
from freertos.rs.
Sorry for annoying, I believe that in FreeRTOS it possible to allocation data in heap and then send pointer to allocated memory to queue. Then receiver will be responsible to free memory. Of course allocated memory must not used by sender when he sent pointer to queue.
In Rust we can use Box
for this purpose, but, as I understood now, it is require separated implementation, that will be:
- consume
Box
byinto_raw
- send raw pointer by queue
- restore
Box
at receiver side byBox::from_raw
from raw pointer
from freertos.rs.
Sure, you can do that. No changes are necessary within this Rust library, you can easily implement that as a trivial typed Rust struct that only holds a single usize pointer. But support for this won't be added to this project.
from freertos.rs.
Related Issues (17)
- I'm not able to compile HOT 1
- Support for high tick rates in the units API
- Update for FreeRTOS 9.0 and 10.0
- Linking errors when some features are disabled in FreeRTOS (at least stack high water mark) HOT 1
- freertos_rs_delete_semaphore takes UBaseType_t in C wrapper HOT 1
- Build broken HOT 2
- Latest Rust nightly build broken HOT 1
- error[E0432]: unresolved import `alloc::arc` [stm32l475] HOT 9
- Release 0.3.0 HOT 1
- Run a simple program in stm32
- How to start the scheduler? HOT 3
- Compilation using rustc 1.17.0-nightly HOT 1
- libfreertos-sys implementation created HOT 1
- Doesn't compile on Cortex-M0
- Collections has been merged into alloc HOT 1
- How about to release new version? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freertos.rs.