mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-18 07:44:21 +01:00
Rename SyncLazy to LazyLock
This commit is contained in:
@@ -8,7 +8,7 @@ use librumqttd::{
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
use std::time::Duration;
|
||||
use std::{lazy::SyncLazy, sync::Mutex};
|
||||
use std::sync::{LazyLock, Mutex};
|
||||
use tokio::sync::mpsc;
|
||||
use tokio::time::timeout;
|
||||
|
||||
@@ -19,7 +19,7 @@ const PASSWORD: &str = "sphinx-key-pass";
|
||||
// must get a reply within this time, or disconnects
|
||||
const REPLY_TIMEOUT_MS: u64 = 10000;
|
||||
|
||||
static CONNECTED: SyncLazy<Mutex<bool>> = SyncLazy::new(|| Mutex::new(false));
|
||||
static CONNECTED: LazyLock<Mutex<bool>> = LazyLock::new(|| Mutex::new(false));
|
||||
fn set_connected(b: bool) {
|
||||
*CONNECTED.lock().unwrap() = b;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,9 @@ use esp_idf_hal::peripherals::Peripherals;
|
||||
use esp_idf_hal::rmt::config::TransmitConfig;
|
||||
use esp_idf_hal::rmt::{FixedLengthSignal, PinState, Pulse, Transmit};
|
||||
|
||||
use std::lazy::SyncLazy;
|
||||
use std::sync::Mutex;
|
||||
use std::sync::{LazyLock, Mutex};
|
||||
|
||||
static TX: SyncLazy<Mutex<Transmit<Gpio8<esp_idf_hal::gpio::Output>, esp_idf_hal::rmt::CHANNEL0>>> = SyncLazy::new(|| {
|
||||
static TX: LazyLock<Mutex<Transmit<Gpio8<esp_idf_hal::gpio::Output>, esp_idf_hal::rmt::CHANNEL0>>> = LazyLock::new(|| {
|
||||
let peripherals = Peripherals::take().unwrap();
|
||||
let led = peripherals.pins.gpio8.into_output().unwrap();
|
||||
let channel = peripherals.rmt.channel0;
|
||||
|
||||
Reference in New Issue
Block a user