From 77c314f930b897aed14e15f0641aeb20acd0cff8 Mon Sep 17 00:00:00 2001 From: Alexandr Pyslar <34306652+CCChelios@users.noreply.github.com> Date: Mon, 21 Oct 2024 13:14:29 +0000 Subject: [PATCH] remove unused variable and update struct types --- esphome/components/modem/modem_component.cpp | 3 +-- esphome/components/modem/modem_component.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/esphome/components/modem/modem_component.cpp b/esphome/components/modem/modem_component.cpp index de9daeea9e..2ac7aea5d0 100644 --- a/esphome/components/modem/modem_component.cpp +++ b/esphome/components/modem/modem_component.cpp @@ -74,7 +74,6 @@ void ModemComponent::setup() { } void ModemComponent::loop() { - const int now = millis(); if (!ModemComponent::check_modem_component_state_timings_()) { return; } @@ -212,7 +211,7 @@ void ModemComponent::dce_init_() { } bool ModemComponent::check_modem_component_state_timings_() { - const int now = millis(); + const uint now = millis(); ModemComponentStateTiming timing = this->modem_component_state_timing_map_[this->state_]; if (timing.time_limit && ((this->change_state_ + timing.time_limit) < now)) { ESP_LOGE(TAG, "State time limit %s", this->state_to_string_(this->state_)); diff --git a/esphome/components/modem/modem_component.h b/esphome/components/modem/modem_component.h index f9646c10e8..7b3cd5f026 100644 --- a/esphome/components/modem/modem_component.h +++ b/esphome/components/modem/modem_component.h @@ -39,8 +39,8 @@ enum class ModemComponentState { }; struct ModemComponentStateTiming { - int poll_period; - int time_limit; + uint poll_period; + uint time_limit; ModemComponentStateTiming() : poll_period(0), time_limit(0) {} ModemComponentStateTiming(int poll_period, int time_limit) : poll_period(poll_period), time_limit(time_limit) {} };