Satic vector, new epprom routines, new wireless relay storage method
This commit is contained in:
20
main.cpp
20
main.cpp
@ -10,18 +10,30 @@
|
||||
#include "eeprom.h"
|
||||
#include "bitrep.h"
|
||||
|
||||
#define MAX_RELAYS 32
|
||||
#define COMMAND_BUFFER_SIZE 32
|
||||
#define SNPRINTF_BUFFER_SIZE 64
|
||||
|
||||
char buffer[SNPRINTF_BUFFER_SIZE];
|
||||
|
||||
struct WirelessRelayStore
|
||||
class WirelessRelayStore
|
||||
{
|
||||
public:
|
||||
static const MAX_RELAYS = 16;
|
||||
|
||||
private:
|
||||
|
||||
WirelessRelay array[MAX_RELAYS];
|
||||
uint8_t count;
|
||||
bool states[MAX_RELAYS]={};
|
||||
bool printState = true;
|
||||
uint8_t count;
|
||||
uint16_t baseNameAddr_;
|
||||
|
||||
public:
|
||||
|
||||
WirelessRelayStore(uint16_t baseNameAddr = 0)
|
||||
bool add( uint16_t id, char* name );
|
||||
bool remove();
|
||||
WirelessRelay* getRelay(uint8_t id);
|
||||
};
|
||||
|
||||
WirelessRelayStore relays;
|
||||
@ -357,7 +369,7 @@ int main()
|
||||
|
||||
restore_relays(&relays);
|
||||
|
||||
serial.write_p(PSTR("RGBController v0.6 starting\n"));
|
||||
serial.write_p(PSTR("RGBController v0.7 starting\n"));
|
||||
while(true)
|
||||
{
|
||||
serialDispatch(&serial, &relays, &rgbled, &pwmTc1);
|
||||
|
Reference in New Issue
Block a user