Skip to content
Snippets Groups Projects
Commit 6cf22d97 authored by sui77's avatar sui77
Browse files

Merge pull request #17 from fingolfin/tweaks

Various minor improvements and cleanups
parents 59883d4d 147b9577
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#if defined(ARDUINO) && ARDUINO >= 100 #if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h" #include "Arduino.h"
#elif defined(ENERGIA) // LaunchPad, FraunchPad and StellarPad specific #elif defined(ENERGIA) // LaunchPad, FraunchPad and StellarPad specific
#include "Energia.h" #include "Energia.h"
#else #else
#include "WProgram.h" #include "WProgram.h"
#endif #endif
...@@ -47,12 +47,6 @@ ...@@ -47,12 +47,6 @@
// We can handle up to (unsigned long) => 32 bit * 2 H/L changes per bit + 2 for sync // We can handle up to (unsigned long) => 32 bit * 2 H/L changes per bit + 2 for sync
#define RCSWITCH_MAX_CHANGES 67 #define RCSWITCH_MAX_CHANGES 67
#define PROTOCOL3_SYNC_FACTOR 71
#define PROTOCOL3_0_HIGH_CYCLES 4
#define PROTOCOL3_0_LOW_CYCLES 11
#define PROTOCOL3_1_HIGH_CYCLES 9
#define PROTOCOL3_1_LOW_CYCLES 6
class RCSwitch { class RCSwitch {
public: public:
...@@ -60,18 +54,18 @@ class RCSwitch { ...@@ -60,18 +54,18 @@ class RCSwitch {
void switchOn(int nGroupNumber, int nSwitchNumber); void switchOn(int nGroupNumber, int nSwitchNumber);
void switchOff(int nGroupNumber, int nSwitchNumber); void switchOff(int nGroupNumber, int nSwitchNumber);
void switchOn(char* sGroup, int nSwitchNumber); void switchOn(const char* sGroup, int nSwitchNumber);
void switchOff(char* sGroup, int nSwitchNumber); void switchOff(const char* sGroup, int nSwitchNumber);
void switchOn(char sFamily, int nGroup, int nDevice); void switchOn(char sFamily, int nGroup, int nDevice);
void switchOff(char sFamily, int nGroup, int nDevice); void switchOff(char sFamily, int nGroup, int nDevice);
void switchOn(char* sGroup, char* sDevice); void switchOn(const char* sGroup, const char* sDevice);
void switchOff(char* sGroup, char* sDevice); void switchOff(const char* sGroup, const char* sDevice);
void switchOn(char sGroup, int nDevice); void switchOn(char sGroup, int nDevice);
void switchOff(char sGroup, int nDevice); void switchOff(char sGroup, int nDevice);
void sendTriState(char* Code); void sendTriState(const char* Code);
void send(unsigned long Code, unsigned int length); void send(unsigned long Code, unsigned int length);
void send(char* Code); void send(const char* Code);
#if not defined( RCSwitchDisableReceiving ) #if not defined( RCSwitchDisableReceiving )
void enableReceive(int interrupt); void enableReceive(int interrupt);
...@@ -99,8 +93,8 @@ class RCSwitch { ...@@ -99,8 +93,8 @@ class RCSwitch {
private: private:
char* getCodeWordB(int nGroupNumber, int nSwitchNumber, boolean bStatus); char* getCodeWordB(int nGroupNumber, int nSwitchNumber, boolean bStatus);
char* getCodeWordA(char* sGroup, int nSwitchNumber, boolean bStatus); char* getCodeWordA(const char* sGroup, int nSwitchNumber, boolean bStatus);
char* getCodeWordA(char* sGroup, char* sDevice, boolean bStatus); char* getCodeWordA(const char* sGroup, const char* sDevice, boolean bStatus);
char* getCodeWordC(char sFamily, int nGroup, int nDevice, boolean bStatus); char* getCodeWordC(char sFamily, int nGroup, int nDevice, boolean bStatus);
char* getCodeWordD(char group, int nDevice, boolean bStatus); char* getCodeWordD(char group, int nDevice, boolean bStatus);
void sendT0(); void sendT0();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment