embed-rs / embedded-rs Goto Github PK
View Code? Open in Web Editor NEWRust embed crate
Rust embed crate
As mentioned by @oli-obk , a convenient register macro may be a good thing to spare users from having to write inline-assembly:
reg!(r0) = 42;
*(reg!(r0) + 3 as *const i32) = 42;
x = reg!(r0);
We definitely want to start using interrupts at some point. It's trivial to simply put a function into the interrupt table, but that function then has neither state nor a way to communicate with anything. I say we first figure out the way we want to use interrupts, and then solve how that can be done. So this issue is just here for the API.
Obviously closures come into mind when thinking about code that should be run when an interrupt triggers. There's several ways we could use them:
let a = some_owned_register;
interrupt_table.insert(id, move || a.update(|a| a.set_some_flag()));
// can never get `some_owned_register` back
// but could overwrite interrupt `id` with a new handler
let a = &mut some_owned_register;
interrupt_table.with_interrupt(
id,
|| a.update(|a| a.set_some_flag()),
|interrupt_table| {
// code that needs that interrupt to be set
}
);
// interrupt is not set anymore, `some_owned_register` is available again
interrupt_table.insert(id, some_owned_register, some_function_that_takes_a_ref_mut_register);
// code that needs that interrupt to be set
let some_owned_register = interrupt_table.remove(id).unwrap();
// got `some_owned_register` back
I don't think we need to decide on either of the three, they can work simultaneously.
Anything else in the possible design space?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.