Updated HeatpumpIR, to a version which uses the native Arduino IDE 1.6 PROGMEM definitions
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
#include <Arduino.h>
|
||||
|
||||
// HeatpumpIR libraries
|
||||
#include <FujitsuHeatpumpIR.h>
|
||||
#include <PanasonicCKPHeatpumpIR.h>
|
||||
@@ -85,8 +87,7 @@ void loop()
|
||||
// Handle incoming messages from the MySensors Gateway
|
||||
void incomingMessage(const MyMessage &message) {
|
||||
|
||||
const char *irData;
|
||||
long irCommand;
|
||||
const char *irData;
|
||||
|
||||
// V_IR type message
|
||||
if (message.type==V_IR_SEND) {
|
||||
@@ -156,10 +157,10 @@ libraries\HeatpumpIR\HeatpumpIR.h for the constants
|
||||
byte fan = (irCommand & 0x00000F00) >> 8;
|
||||
byte temp = (irCommand & 0x000000FF);
|
||||
|
||||
prog_char* buf;
|
||||
const char* buf;
|
||||
Serial.print(F("Model: "));
|
||||
|
||||
buf = (prog_char*)heatpumpIR[model]->model();
|
||||
buf = heatpumpIR[model]->model();
|
||||
// 'model' is a PROGMEM pointer, so need to write a byte at a time
|
||||
while (char modelChar = pgm_read_byte(buf++))
|
||||
{
|
||||
@@ -188,14 +189,14 @@ libraries\HeatpumpIR\HeatpumpIR.h for the constants
|
||||
|
||||
if (model == 0) {
|
||||
Serial.println(F("Scheduling timer cancellation on Panasonic CKP heatpump..."));
|
||||
panasonicCKPTimer = timer.after(120000, panasonicCancelTimer, (void *)NULL); // Called after 2 minutes
|
||||
panasonicCKPTimer = timer.after(120000, panasonicCancelTimer); // Called after 2 minutes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Cancel the timer on the Panasonic CKP heatpump
|
||||
void panasonicCancelTimer(void *context)
|
||||
void panasonicCancelTimer()
|
||||
{
|
||||
PanasonicCKPHeatpumpIR *panasonicCKPHeatpumpIR = new PanasonicCKPHeatpumpIR();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user