This commit is contained in:
J. Nick Koston 2023-06-05 20:05:19 -05:00
parent 843ea197bb
commit af71b36eb4
No known key found for this signature in database
2 changed files with 10 additions and 10 deletions

View File

@ -13,8 +13,6 @@
#include "ratgdo.h" #include "ratgdo.h"
#include "esphome/core/log.h" #include "esphome/core/log.h"
#include "esphome/components/uart/uart.h"
#include "esphome/core/component.h"
namespace esphome { namespace esphome {
namespace ratgdo { namespace ratgdo {
@ -92,10 +90,14 @@ namespace ratgdo {
} }
} }
class RATGDOComponent : public uart::UARTDevice, public Component { class RATGDOComponent : public Component, public UARTDevice {
public: public:
RATGDOComponent(UARTComponent* parent)
: UARTDevice(parent)
{
}
void setup() override void setup()
{ {
this->pref_ = global_preferences->make_preference<int>(734874333U); this->pref_ = global_preferences->make_preference<int>(734874333U);
if (!this->pref_.load(&this->rollingCodeCounter)) { if (!this->pref_.load(&this->rollingCodeCounter)) {
@ -142,7 +144,7 @@ namespace ratgdo {
// reboot/sync to the opener on startup // reboot/sync to the opener on startup
} }
void loop() override void loop()
{ {
ESP_LOGD(TAG, "loop rollingCodeCounter: %d", this->rollingCodeCounter); ESP_LOGD(TAG, "loop rollingCodeCounter: %d", this->rollingCodeCounter);
obstructionLoop(); obstructionLoop();

View File

@ -12,12 +12,11 @@
************************************/ ************************************/
#pragma once #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/components/uart/uart.h"
#include "esphome/core/component.h" #include "esphome/core/component.h"
#include "esphome/core/gpio.h"
#include "esphome/core/log.h"
#include "esphome/core/preferences.h"
#include "SoftwareSerial.h" #include "SoftwareSerial.h"
extern "C" { extern "C" {
@ -29,7 +28,6 @@ extern "C" {
namespace esphome { namespace esphome {
namespace ratgdo { namespace ratgdo {
struct RATGDOStore { struct RATGDOStore {
ISRInternalGPIOPin input_obst; ISRInternalGPIOPin input_obst;