Fix compiler warnings about PROGMEM use

This commit is contained in:
ToniA
2015-09-30 08:30:37 +03:00
parent 207ed687e1
commit f58fc601a4
4 changed files with 8 additions and 9 deletions
+2 -2
View File
@@ -145,7 +145,7 @@ void CarrierHeatpumpIR::sendCarrier(IRSender& IR, byte operatingMode, byte fanSp
IR.space(CARRIER_AIRCON1_HDR_SPACE);
// 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);
}
@@ -157,7 +157,7 @@ void CarrierHeatpumpIR::sendCarrier(IRSender& IR, byte operatingMode, byte fanSp
IR.space(CARRIER_AIRCON1_HDR_SPACE);
// 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);
}
+2 -2
View File
@@ -57,8 +57,8 @@ class HeatpumpIR
{
protected:
HeatpumpIR(); // Cannot create generic heatpump instances
const char PROGMEM* _model;
const char PROGMEM* _info;
const char * _model;
const char * _info;
public:
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);
// 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);
}
@@ -89,8 +89,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) {
@@ -161,10 +160,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++))
{