Open oli-obk opened 5 years ago
From a quick look, this seems like a good improvement to me!
The use of [volatile::Volatile<u8>]
might be a bit problematic for use cases where multiple bytes should be accessed at once. But at least it allows the user to use the remaining SDRAM capacity, so it's definitely an improvement.
Instead of taking and returning ownership of the sdram
, we could introduce a SdramMemory
wrapper type and borrow it. But that's just a small cosmetic suggestion.
Instead of taking and returning ownership of the sdram, we could introduce a SdramMemory wrapper type and borrow it. But that's just a small cosmetic suggestion.
I was considering that, but that would give all the users an additional lifetime. Alternatively we can give the memory to an allocator and see how well liballoc
supports custom allocators
Ah, didn't think of that. How about something like this?
see how well
liballoc
supports custom allocators
I think this is not ready yet. AFAIK only raw_vec supports custom allocators right now.
Updated to be less hacky.
@phil-opp what do you think? is this sort of handling ok?