Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
log: cleanup and address potential UB
This was spawned by the following error message, introduced in 1.77.0: warning: creating a shared reference to mutable static is discouraged --> src/log/mod.rs:36:27 | 36 | let logger = unsafe { &LOGGER }; | ^^^^^^^ shared reference to mutable static | = note: for more information, see issue #114447 <rust-lang/rust#114447> This changes the implementation slightly so that it no longer returns a reference to the logger itself; instead returning a marker type that is called in the same way as the original. It also removes the use of `cortex_m::singleton!`, since the singleton value wasn't actually being used. Before this implementation, I tried removing the builder pattern entirely and just taking the ITM and RTT loggers in the init function. That ended up being fine, but it prevented any logging (RTT or otherwise) before the GPIOs were configured.
- Loading branch information