fixes for windows

This commit is contained in:
Robin Müller 2021-12-08 17:22:53 +01:00
parent ceb87b5abb
commit e4999fe01c

View File

@ -16,8 +16,8 @@ enum Levels: uint8_t {
}; };
enum Direction: uint8_t { enum Direction: uint8_t {
IN = 0, DIR_IN = 0,
OUT = 1 DIR_OUT = 1
}; };
enum GpioOperation { enum GpioOperation {
@ -30,7 +30,7 @@ enum class GpioTypes {
GPIO_REGULAR_BY_CHIP, GPIO_REGULAR_BY_CHIP,
GPIO_REGULAR_BY_LABEL, GPIO_REGULAR_BY_LABEL,
GPIO_REGULAR_BY_LINE_NAME, GPIO_REGULAR_BY_LINE_NAME,
CALLBACK TYPE_CALLBACK
}; };
static constexpr gpioId_t NO_GPIO = -1; static constexpr gpioId_t NO_GPIO = -1;
@ -68,7 +68,7 @@ public:
// Can be used to cast GpioBase to a concrete child implementation // Can be used to cast GpioBase to a concrete child implementation
gpio::GpioTypes gpioType = gpio::GpioTypes::NONE; gpio::GpioTypes gpioType = gpio::GpioTypes::NONE;
std::string consumer; std::string consumer;
gpio::Direction direction = gpio::Direction::IN; gpio::Direction direction = gpio::Direction::DIR_IN;
gpio::Levels initValue = gpio::Levels::NONE; gpio::Levels initValue = gpio::Levels::NONE;
}; };
@ -92,7 +92,7 @@ class GpiodRegularByChip: public GpiodRegularBase {
public: public:
GpiodRegularByChip() : GpiodRegularByChip() :
GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_CHIP, GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_CHIP,
std::string(), gpio::Direction::IN, gpio::LOW, 0) { std::string(), gpio::Direction::DIR_IN, gpio::LOW, 0) {
} }
GpiodRegularByChip(std::string chipname_, int lineNum_, std::string consumer_, GpiodRegularByChip(std::string chipname_, int lineNum_, std::string consumer_,
@ -104,7 +104,7 @@ public:
GpiodRegularByChip(std::string chipname_, int lineNum_, std::string consumer_) : GpiodRegularByChip(std::string chipname_, int lineNum_, std::string consumer_) :
GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_CHIP, consumer_, GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_CHIP, consumer_,
gpio::Direction::IN, gpio::LOW, lineNum_), gpio::Direction::DIR_IN, gpio::LOW, lineNum_),
chipname(chipname_) { chipname(chipname_) {
} }
@ -122,7 +122,7 @@ public:
GpiodRegularByLabel(std::string label_, int lineNum_, std::string consumer_) : GpiodRegularByLabel(std::string label_, int lineNum_, std::string consumer_) :
GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_LABEL, consumer_, GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_LABEL, consumer_,
gpio::Direction::IN, gpio::LOW, lineNum_), gpio::Direction::DIR_IN, gpio::LOW, lineNum_),
label(label_) { label(label_) {
} }
@ -144,7 +144,7 @@ public:
GpiodRegularByLineName(std::string lineName_, std::string consumer_) : GpiodRegularByLineName(std::string lineName_, std::string consumer_) :
GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_LINE_NAME, consumer_, GpiodRegularBase(gpio::GpioTypes::GPIO_REGULAR_BY_LINE_NAME, consumer_,
gpio::Direction::IN, gpio::LOW), lineName(lineName_) { gpio::Direction::DIR_IN, gpio::LOW), lineName(lineName_) {
} }
std::string lineName; std::string lineName;
@ -154,7 +154,7 @@ class GpioCallback: public GpioBase {
public: public:
GpioCallback(std::string consumer, gpio::Direction direction_, gpio::Levels initValue_, GpioCallback(std::string consumer, gpio::Direction direction_, gpio::Levels initValue_,
gpio::gpio_cb_t callback, void* callbackArgs): gpio::gpio_cb_t callback, void* callbackArgs):
GpioBase(gpio::GpioTypes::CALLBACK, consumer, direction_, initValue_), GpioBase(gpio::GpioTypes::TYPE_CALLBACK, consumer, direction_, initValue_),
callback(callback), callbackArgs(callbackArgs) {} callback(callback), callbackArgs(callbackArgs) {}
gpio::gpio_cb_t callback = nullptr; gpio::gpio_cb_t callback = nullptr;