From af71b36eb4348fd7ad1acfc566d6d4e9aaaaee81 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 5 Jun 2023 20:05:19 -0500 Subject: [PATCH] fix --- components/ratgdo/ratgdo.cpp | 12 +++++++----- components/ratgdo/ratgdo.h | 8 +++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/components/ratgdo/ratgdo.cpp b/components/ratgdo/ratgdo.cpp index 9c1d0f2..3ed1913 100644 --- a/components/ratgdo/ratgdo.cpp +++ b/components/ratgdo/ratgdo.cpp @@ -13,8 +13,6 @@ #include "ratgdo.h" #include "esphome/core/log.h" -#include "esphome/components/uart/uart.h" -#include "esphome/core/component.h" namespace esphome { namespace ratgdo { @@ -92,10 +90,14 @@ namespace ratgdo { } } - class RATGDOComponent : public uart::UARTDevice, public Component { + class RATGDOComponent : public Component, public UARTDevice { public: + RATGDOComponent(UARTComponent* parent) + : UARTDevice(parent) + { + } - void setup() override + void setup() { this->pref_ = global_preferences->make_preference(734874333U); if (!this->pref_.load(&this->rollingCodeCounter)) { @@ -142,7 +144,7 @@ namespace ratgdo { // reboot/sync to the opener on startup } - void loop() override + void loop() { ESP_LOGD(TAG, "loop rollingCodeCounter: %d", this->rollingCodeCounter); obstructionLoop(); diff --git a/components/ratgdo/ratgdo.h b/components/ratgdo/ratgdo.h index f56193f..151d2b3 100644 --- a/components/ratgdo/ratgdo.h +++ b/components/ratgdo/ratgdo.h @@ -12,12 +12,11 @@ ************************************/ #pragma once -#include "esphome/core/component.h" -#include "esphome/core/gpio.h" -#include "esphome/core/preferences.h" -#include "esphome/core/log.h" #include "esphome/components/uart/uart.h" #include "esphome/core/component.h" +#include "esphome/core/gpio.h" +#include "esphome/core/log.h" +#include "esphome/core/preferences.h" #include "SoftwareSerial.h" extern "C" { @@ -29,7 +28,6 @@ extern "C" { namespace esphome { namespace ratgdo { - struct RATGDOStore { ISRInternalGPIOPin input_obst;