From f5c61a57a9aa42914804fdec92a065004f91b3f6 Mon Sep 17 00:00:00 2001 From: TMRh20 Date: Sat, 17 Feb 2024 17:51:36 -0600 Subject: [PATCH] Make read() return value --- utility/SPIDEV/gpio.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/utility/SPIDEV/gpio.cpp b/utility/SPIDEV/gpio.cpp index d63c8f2e..802ae3ca 100644 --- a/utility/SPIDEV/gpio.cpp +++ b/utility/SPIDEV/gpio.cpp @@ -1,13 +1,9 @@ /* - * https://github.com/mrshu/GPIOlib - * Copyright (c) 2011, Copyright (c) 2011 mr.Shu + * + * Copyright (c) 2024, Copyright (c) 2024 TMRh20 & 2bndy5 * All rights reserved. * - * Modified on 24 June 2012, 11:06 AM - * File: gpio.cpp - * Author: purinda (purinda@gmail.com) - * - * Patched for filedescriptor catching and error control by L Diaz 2018 + * */ #include #include "gpio.h" @@ -72,7 +68,7 @@ int GPIO::Gread(int port) return ret; } close(rq.fd); - return ret; + return data.values[0]; } return -1; }