AP_HAL_Linux: fixed LinuxGPIO_RPI::read()

This commit is contained in:
Staroselskii Georgii 2014-11-06 17:01:03 +03:00 committed by Andrew Tridgell
parent 49d3035ee5
commit a55db1c25d

View File

@ -62,7 +62,8 @@ int8_t LinuxGPIO_RPI::analogPinToDigitalPin(uint8_t pin)
uint8_t LinuxGPIO_RPI::read(uint8_t pin) uint8_t LinuxGPIO_RPI::read(uint8_t pin)
{ {
return GPIO_GET(pin); uint32_t value = GPIO_GET(pin);
return value ? 1: 0;
} }
void LinuxGPIO_RPI::write(uint8_t pin, uint8_t value) void LinuxGPIO_RPI::write(uint8_t pin, uint8_t value)