warnings to zero :)

This commit is contained in:
2025-02-27 20:35:44 +01:00
parent 2ae363b6d2
commit b2d5cf6416
6 changed files with 62 additions and 336 deletions

View File

@@ -15,7 +15,7 @@ const BUFFER_SIZE:usize = 210;
#[link_section = ".rtc.data"]
static mut BUFFER:ConstGenericRingBuffer::<LogEntry, BUFFER_SIZE> = ConstGenericRingBuffer::<LogEntry, BUFFER_SIZE>::new();
#[allow(static_mut_refs)]
static BUFFER_ACCESS: Lazy<Mutex<&mut ConstGenericRingBuffer::<LogEntry, BUFFER_SIZE>>> = Lazy::new(|| unsafe { Mutex::new(&mut BUFFER) });
@@ -133,53 +133,53 @@ mod tests {
#[derive(IntoStaticStr, EnumIter, Serialize, PartialEq, Eq, PartialOrd, Ord, Clone)]
pub enum LogMessage {
#[strum(serialize = "Reset due to {{txt_long}} requires rtc clear {{a}} and force config mode {{b}}")]
reset_reason,
ResetReason,
#[strum(serialize = "Current restart to conf mode {{a}}")]
restart_to_config,
RestartToConfig,
#[strum(serialize = "Current low voltage detection is {{a}}")]
low_voltage,
LowVoltage,
#[strum(serialize = "Error communicating with battery!! {{txt_long}}")]
battery_communication_error,
BatteryCommunicationError,
#[strum(serialize = "Tank sensor raw {{a}} percent {{b}}")]
sensor_tank_raw,
SensorTankRaw,
#[strum(serialize = "raw measure unscaled {{a}} hz {{b}}, plant {{txt_short}} sensor {{txt_long}}")]
raw_measure,
RawMeasure,
#[strum(serialize = "IP info: {{txt_long}}")]
wifi_info,
WifiInfo,
#[strum(serialize = "Plant:{{txt_short}} a:{{a}} b:{{b}}")]
test_sensor,
TestSensor,
#[strum(serialize = "Stay alive topic is {{txt_long}}")]
stay_alive,
StayAlive,
#[strum(serialize = "Connecting mqtt {{txt_short}} with id {{txt_long}}")]
mqtt_info,
MqttInfo,
#[strum(serialize = "Received stay alive with value {{txt_short}}")]
mqtt_stay_alive_rec,
MqttStayAliveRec,
#[strum(serialize = "Unknown topic recieved {{txt_long}}")]
unknown_topic,
UnknownTopic,
#[strum(serialize = "Partition state is {{txt_long}}")]
partition_state,
PartitionState,
#[strum(serialize = "Mounted Filesystem free {{a}} total {{b}} use {{txt_short}}")]
filesystem_mount,
FilesystemMount,
#[strum(serialize = "Mounting Filesystem, this will format the first time and needs quite some time!")]
mounting_filesystem,
MountingFilesystem,
#[strum(serialize = "Year inplausible, force config mode")]
year_inplausible_force_config,
YearInplausibleForceConfig,
#[strum(serialize = "Going to config mode, due to request from prior run")]
config_mode_software_override,
ConfigModeSoftwareOverride,
#[strum(serialize = "Going to config mode, due to request via config mode button")]
config_mode_button_override,
ConfigModeButtonOverride,
#[strum(serialize = "Going to normal mode")]
normal_run,
NormalRun,
#[strum(serialize = "Missing normal config, entering config mode {{txt_long}}")]
config_mode_missing_config,
ConfigModeMissingConfig,
#[strum(serialize = "startup state wifi {{a}} sntp {{b}} mqtt {{txt_short}}")]
startup_info,
StartupInfo,
#[strum(serialize = "Trying to pump for {{b}}s with pump {{a}} now dryrun: {{txt_short}}")]
pump_plant,
PumpPlant,
#[strum(serialize = "Enable main power dryrun: {{a}}")]
enable_main,
EnableMain,
#[strum(serialize = "Pumped multiple times, but plant is still to try attempt: {{a}} limit :: {{b}} plant: {{txt_short}}")]
consecutive_pump_count_limit
ConsecutivePumpCountLimit
}
impl LogMessage {