mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
Удаление сканера one wire
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "Bus/BusScanner.h"
|
||||
#include "Bus/I2CScanner.h"
|
||||
#include "Bus/OneWireScanner.h"
|
||||
#include "Consts.h"
|
||||
#include "Utils/JsonUtils.h"
|
||||
|
||||
@@ -12,10 +11,6 @@ class BusScannerFactory {
|
||||
switch (type) {
|
||||
case BS_I2C:
|
||||
return new I2CScanner(str);
|
||||
case BS_ONE_WIRE: {
|
||||
uint8_t pin = jsonReadInt(config, TAG_ONE_WIRE_PIN);
|
||||
return new OneWireScanner(str, pin);
|
||||
}
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <OneWire.h>
|
||||
|
||||
struct OneWireBus_t {
|
||||
OneWire *bus;
|
||||
uint8_t pin;
|
||||
};
|
||||
|
||||
class OneWireBus {
|
||||
public:
|
||||
OneWireBus();
|
||||
OneWire *get(uint8_t pin);
|
||||
size_t count();
|
||||
|
||||
private:
|
||||
std::vector<OneWireBus_t> _items;
|
||||
};
|
||||
|
||||
extern OneWireBus oneWireBus;
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "BusScanner.h"
|
||||
#include "OneWireBus.h"
|
||||
|
||||
class OneWireScanner : public BusScanner {
|
||||
public:
|
||||
OneWireScanner(String& out, uint8_t pin);
|
||||
|
||||
protected:
|
||||
virtual boolean syncScan() override;
|
||||
|
||||
private:
|
||||
OneWire* _bus;
|
||||
};
|
||||
@@ -57,6 +57,8 @@ extern AsyncWebServer server;
|
||||
|
||||
extern DallasTemperature sensors;
|
||||
|
||||
extern OneWire *oneWire;
|
||||
|
||||
extern boolean but[NUM_BUTTONS];
|
||||
|
||||
extern Bounce* buttons;
|
||||
|
||||
Reference in New Issue
Block a user