The z-uno compiler give me error when i create the "changeValue" function on the Switch class.
Error: object_sdcpp_.cpp:747:1control reaches end of non-void functionUnknown error:'class Channel' uCxx returned error code:-1
If i comment the function "changeValue" in the object.cpp the code compile without errors.
The same code dont give any error with the arduino compiler.
Code:
object.h
Code: Select all
#ifndef Object_h
#define Object_h
#include "Arduino.h"
class Channel {
public:
Channel(uint8_t channel, int min ,int max);
protected:
uint8_t reportChannel; // Position of channel in the Z-UNO channels
int minValue; // Min valid value
int maxValue; // Max valid value
};
class Switch : public Channel {
public:
Switch(uint8_t channel, int min, int max) : Channel(channel, min, max) { }
uint8_t changeValue(int v);
protected:
int value;
};
class BinarySwitch : public Switch {
public:
BinarySwitch(uint8_t channel) : Switch(channel, 0, 1) { }
};
class MultiSwitch : public Switch {
public:
MultiSwitch(uint8_t channel) : Switch(channel, 0, 99) { }
};
#endif
Code: Select all
#include "object.h"
// CHANNEL
Channel::Channel(uint8_t channel, int min ,int max) {
reportChannel = channel;
minValue = min;
maxValue = max;
}
// SWITCH
uint8_t Switch::changeValue(int v) {
value = v;
}
Thanks