mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-23 08:06:13 +01:00
e0c76a9dc4
In prep for Wifi siolution, all output functions changed to expect Print class instead of Stream... Can still pass Serial1 etc because Stream extends Print, but this allows for an output-only class extending Print to collect a response buffer for Wifi sending with AT commands.
33 lines
544 B
C++
33 lines
544 B
C++
#ifndef Outputs_h
|
|
#define Outputs_h
|
|
|
|
#include <Arduino.h>
|
|
|
|
struct OutputData {
|
|
uint8_t oStatus;
|
|
uint8_t id;
|
|
uint8_t pin;
|
|
uint8_t iFlag;
|
|
};
|
|
|
|
class Output{
|
|
public:
|
|
void activate(int s);
|
|
static Output* get(int);
|
|
static bool remove(int);
|
|
static void load();
|
|
static void store();
|
|
static Output *create(int, int, int, int=0);
|
|
static void show(Print & stream);
|
|
static bool showAll(Print & stream);
|
|
|
|
private:
|
|
static Output *firstOutput;
|
|
int num;
|
|
struct OutputData data;
|
|
Output *nextOutput;
|
|
|
|
}; // Output
|
|
|
|
#endif
|