Fix compiler warnings about PROGMEM use
This commit is contained in:
@@ -145,7 +145,7 @@ void CarrierHeatpumpIR::sendCarrier(IRSender& IR, byte operatingMode, byte fanSp
|
|||||||
IR.space(CARRIER_AIRCON1_HDR_SPACE);
|
IR.space(CARRIER_AIRCON1_HDR_SPACE);
|
||||||
|
|
||||||
// Payload
|
// Payload
|
||||||
for (int i=0; i<sizeof(sendBuffer); i++) {
|
for (size_t i=0; i<sizeof(sendBuffer); i++) {
|
||||||
IR.sendIRByte(sendBuffer[i], CARRIER_AIRCON1_BIT_MARK, CARRIER_AIRCON1_ZERO_SPACE, CARRIER_AIRCON1_ONE_SPACE);
|
IR.sendIRByte(sendBuffer[i], CARRIER_AIRCON1_BIT_MARK, CARRIER_AIRCON1_ZERO_SPACE, CARRIER_AIRCON1_ONE_SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ void CarrierHeatpumpIR::sendCarrier(IRSender& IR, byte operatingMode, byte fanSp
|
|||||||
IR.space(CARRIER_AIRCON1_HDR_SPACE);
|
IR.space(CARRIER_AIRCON1_HDR_SPACE);
|
||||||
|
|
||||||
// Payload again
|
// Payload again
|
||||||
for (int i=0; i<sizeof(sendBuffer); i++) {
|
for (size_t i=0; i<sizeof(sendBuffer); i++) {
|
||||||
IR.sendIRByte(sendBuffer[i], CARRIER_AIRCON1_BIT_MARK, CARRIER_AIRCON1_ZERO_SPACE, CARRIER_AIRCON1_ONE_SPACE);
|
IR.sendIRByte(sendBuffer[i], CARRIER_AIRCON1_BIT_MARK, CARRIER_AIRCON1_ZERO_SPACE, CARRIER_AIRCON1_ONE_SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ class HeatpumpIR
|
|||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
HeatpumpIR(); // Cannot create generic heatpump instances
|
HeatpumpIR(); // Cannot create generic heatpump instances
|
||||||
const char PROGMEM* _model;
|
const char * _model;
|
||||||
const char PROGMEM* _info;
|
const char * _info;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void send(IRSender& IR, byte powerModeCmd, byte operatingModeCmd, byte fanSpeedCmd, byte temperatureCmd, byte swingVCmd, byte swingHCmd);
|
virtual void send(IRSender& IR, byte powerModeCmd, byte operatingModeCmd, byte fanSpeedCmd, byte temperatureCmd, byte swingVCmd, byte swingHCmd);
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ void MitsubishiHeatpumpIR::sendMitsubishi(IRSender& IR, byte powerMode, byte ope
|
|||||||
IR.space(MITSUBISHI_AIRCON1_HDR_SPACE);
|
IR.space(MITSUBISHI_AIRCON1_HDR_SPACE);
|
||||||
|
|
||||||
// Data
|
// Data
|
||||||
for (int i=0; i<sizeof(MitsubishiTemplate); i++) {
|
for (unsigned int i=0; i<sizeof(MitsubishiTemplate); i++) {
|
||||||
IR.sendIRByte(MitsubishiTemplate[i], MITSUBISHI_AIRCON1_BIT_MARK, MITSUBISHI_AIRCON1_ZERO_SPACE, MITSUBISHI_AIRCON1_ONE_SPACE);
|
IR.sendIRByte(MitsubishiTemplate[i], MITSUBISHI_AIRCON1_BIT_MARK, MITSUBISHI_AIRCON1_ZERO_SPACE, MITSUBISHI_AIRCON1_ONE_SPACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,8 +89,7 @@ void loop()
|
|||||||
// Handle incoming messages from the MySensors Gateway
|
// Handle incoming messages from the MySensors Gateway
|
||||||
void incomingMessage(const MyMessage &message) {
|
void incomingMessage(const MyMessage &message) {
|
||||||
|
|
||||||
const char *irData;
|
const char *irData;
|
||||||
long irCommand;
|
|
||||||
|
|
||||||
// V_IR type message
|
// V_IR type message
|
||||||
if (message.type==V_IR_SEND) {
|
if (message.type==V_IR_SEND) {
|
||||||
@@ -161,10 +160,10 @@ libraries\HeatpumpIR\HeatpumpIR.h for the constants
|
|||||||
byte fan = (irCommand & 0x00000F00) >> 8;
|
byte fan = (irCommand & 0x00000F00) >> 8;
|
||||||
byte temp = (irCommand & 0x000000FF);
|
byte temp = (irCommand & 0x000000FF);
|
||||||
|
|
||||||
prog_char* buf;
|
const char* buf;
|
||||||
Serial.print(F("Model: "));
|
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
|
// 'model' is a PROGMEM pointer, so need to write a byte at a time
|
||||||
while (char modelChar = pgm_read_byte(buf++))
|
while (char modelChar = pgm_read_byte(buf++))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user