Skip to content

Commit

Permalink
Make read() return value
Browse files Browse the repository at this point in the history
  • Loading branch information
TMRh20 committed Feb 17, 2024
1 parent 619b5fe commit f5c61a5
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions utility/SPIDEV/gpio.cpp
Original file line number Diff line number Diff line change
@@ -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 ([email protected])
*
* Patched for filedescriptor catching and error control by L Diaz 2018
*
*/
#include <linux/gpio.h>
#include "gpio.h"
Expand Down Expand Up @@ -72,7 +68,7 @@ int GPIO::Gread(int port)
return ret;
}
close(rq.fd);
return ret;
return data.values[0];
}
return -1;
}
Expand Down

0 comments on commit f5c61a5

Please sign in to comment.