Comments (3)
(UPDATED)
- Split out the RawMutex traits into a separate crate (
embassy-sync-mutex
, or something?), to allow for bothembassy-sync
andmaitake-sync
to rely on this
Splitting out RawMutex
into its own micro-crate (ala embassy-time-driver
and embassy-net-driver
) - that is - if you decide against forking a subset of maintake-sync
into embassy-sync
- might have use-cases beyond your idea of re-using it in maintake-sync
so that embassy-sync
can depend on maintake-sync
rather than fork it.
For example, that would give "easier time" to RawMutex
implementor code that lives outside the embassy-sync
crate. esp-idf-hal
is currently such one, by providing two separate mutex implementations - one - based on "disable all interrupts (+ spinlocks for multi-core)" and another - based on regular FreeRTOS mutexes.
The thing is, the "one size fits all" approach of critical-section
just does not work for traditional RTOSes, where you might need different types of blocking mutexes, depending on the context where you would like to use those. Abstracting by using RawMutex
instead (and sure - by introducing generics that way) is one way to solve that in driver crates.
Currently, esp-idf-hal
depends directly on embassy-sync
, which is a bit painful. For example, our next release would be a breaking one, because embassy-sync
currently went from 0.5 to 0.6. That's definitely not the only reason but could've been the only reason to issue a breaking release, which is not ideal.
from embassy.
Splitting out RawMutex into its own micro-crate (ala embassy-time-driver and embassy-net-driver) - that is - if you decide against forking a subset of maintake-sync into embassy-sync - might have use-cases beyond your idea of re-using it in maintake-sync so that embassy-sync can depend on maintake-sync rather than fork it.
Just confirming that I agree 100%! I didn't spell this out, but I definitely think this is a positive.
from embassy.
Regarding abstracting over raw mutex types, I would encourage investigating whether the lock_api
crate can be used for that purpose --- it's pretty widespread in the non-embedded world, as parking-lot
uses lock-api
, but it also claims to have no-std
support. I would look into whether its traits are suitable for our purpose. If they are, it's probably better to use the commonly-used trait rather than inventing a new version of it.
from embassy.
Related Issues (20)
- Suddenly getting panic_handler errors with no changes HOT 2
- Saadc usage help on 52840 HOT 4
- `embedded_io_async::ReadReady` returns incorrect value for a `TcpSocket` HOT 2
- `embedded_io_async::ReadReady` incorrect for `TcpReader`, `embedded_io_async::WriteReady` may be incorrect for `TcpWriter` and `TcpSocket`
- shared i2c bus help HOT 6
- [embassy-stm32] Help enabling OCTOSPI1 memory mapped mode HOT 1
- STM32 dual core HAL init design
- Linker Issue 'cc' failed - Ubuntu 24 [duplicate symbol: _embassy_time_schedule_wake] HOT 2
- NRF missing peripheral pins HOT 2
- RP2040 timer interrupt for application use? HOT 8
- Reading Information Elements (IE) with CYW43 HOT 1
- STM32: F1 ADC does not enforce bound IRQ HOT 2
- embassy-boot can't compile with defmt feature HOT 1
- [STM32L0] TIM3 Channel 2 to PB5 remapping missing
- how to find ip by host name
- PWM set_period issue HOT 2
- Embassy-RP and RP2040-hal Compatibility??? - Embedded_Hal::PWM:SetDutyCycle Assistance HOT 1
- Build failures after new `usbd-hid` release HOT 1
- Opamp output lifetimes slightly wrong
- Build failing due to issue in usb-hid-macros HOT 2
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 embassy.