File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change
1
+ trio-gpio (0.2.2-1) unstable; urgency=medium
2
+
3
+ * Access errno
4
+
5
+ -- Matthias Urlichs <
[email protected] > Mon, 11 Jun 2018 08:29:53 +0200
6
+
1
7
trio-gpio (0.2.1-1) unstable; urgency=medium
2
8
3
9
* Allow (and prefer) the GPIO chip label instead of its number.
Original file line number Diff line number Diff line change @@ -137,6 +137,8 @@ def _enter_io(self):
137
137
self .__exit__ ()
138
138
raise RuntimeError ("Unknown direction" , r )
139
139
if r != 0 :
140
+ if r < 0 :
141
+ r = gpio .ffi .errno
140
142
self .__exit__ ()
141
143
raise OSError ("unable to set direction" , r )
142
144
self ._state = _IN_IO
@@ -149,7 +151,7 @@ def _enter_ev(self):
149
151
req .flags = self ._flags
150
152
151
153
if gpio .lib .gpiod_line_request (self ._line , req , 0 ) != 0 :
152
- raise OSError ("unable to request event monitoring" )
154
+ raise OSError ("unable to request event monitoring" , gpio . ffi . errno )
153
155
self ._state = _IN_EV
154
156
155
157
def __exit__ (self , * tb ):
@@ -277,7 +279,9 @@ async def __anext__(self):
277
279
self ._is_open ()
278
280
r = gpio .lib .gpiod_line_event_read_fd (fd , ev )
279
281
if r != 0 :
280
- raise OSError ("unable to read update" )
282
+ if r < 0 :
283
+ r = gpio .ffi .errno
284
+ raise OSError ("unable to read update" , r )
281
285
return Event (ev )
282
286
283
287
async def aclose (self ):
You can’t perform that action at this time.
0 commit comments