platform: remove Peripherals param from board trait

This commit is contained in:
2024-12-01 21:21:50 +01:00
parent 59c3307c27
commit 0884c704b0
3 changed files with 12 additions and 17 deletions

View File

@@ -41,8 +41,15 @@ impl<'a> Board for Esp32Board<'a> {
type Output = StrideOutput<[Rgb<u8>; 310], FastWs2812Esp32Rmt<'a>>;
type Surfaces = SurfacePool<SurfaceType>;
fn new(peripherals: Peripherals) -> Self {
fn take() -> Self {
// It is necessary to call this function once. Otherwise some patches to the runtime
// implemented by esp-idf-sys might not link properly. See https://github.com/esp-rs/esp-idf-template/issues/71
esp_idf_svc::sys::link_patches();
// Bind the log crate to the ESP Logging facilities
esp_idf_svc::log::EspLogger::initialize_default();
let peripherals = Peripherals::take().unwrap();
let sys_loop = EspSystemEventLoop::take().unwrap();
let nvs = EspDefaultNvsPartition::take().unwrap();