mirror of
https://github.com/esphome/esphome.git
synced 2024-11-27 09:18:00 +01:00
remove unused variable and update struct types
This commit is contained in:
parent
bfe16ed3d2
commit
77c314f930
2 changed files with 3 additions and 4 deletions
|
@ -74,7 +74,6 @@ void ModemComponent::setup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModemComponent::loop() {
|
void ModemComponent::loop() {
|
||||||
const int now = millis();
|
|
||||||
if (!ModemComponent::check_modem_component_state_timings_()) {
|
if (!ModemComponent::check_modem_component_state_timings_()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -212,7 +211,7 @@ void ModemComponent::dce_init_() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ModemComponent::check_modem_component_state_timings_() {
|
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_];
|
ModemComponentStateTiming timing = this->modem_component_state_timing_map_[this->state_];
|
||||||
if (timing.time_limit && ((this->change_state_ + timing.time_limit) < now)) {
|
if (timing.time_limit && ((this->change_state_ + timing.time_limit) < now)) {
|
||||||
ESP_LOGE(TAG, "State time limit %s", this->state_to_string_(this->state_));
|
ESP_LOGE(TAG, "State time limit %s", this->state_to_string_(this->state_));
|
||||||
|
|
|
@ -39,8 +39,8 @@ enum class ModemComponentState {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ModemComponentStateTiming {
|
struct ModemComponentStateTiming {
|
||||||
int poll_period;
|
uint poll_period;
|
||||||
int time_limit;
|
uint time_limit;
|
||||||
ModemComponentStateTiming() : poll_period(0), time_limit(0) {}
|
ModemComponentStateTiming() : poll_period(0), time_limit(0) {}
|
||||||
ModemComponentStateTiming(int poll_period, int time_limit) : poll_period(poll_period), time_limit(time_limit) {}
|
ModemComponentStateTiming(int poll_period, int time_limit) : poll_period(poll_period), time_limit(time_limit) {}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue