Skip to content

Commit 5ac9eac

Browse files
committed
deflaked
1 parent 597767d commit 5ac9eac

File tree

3 files changed

+87
-87
lines changed

3 files changed

+87
-87
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name="trio-gpio",
9-
version=__version__,
9+
version=__version__, # noqa: F821
1010
description="GPIO access via Trio and libgpiod",
1111
url="https://github.com/M-o-a-T/trio-gpio",
1212
long_description=open("README.rst").read(),

trio_gpio/gpio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def open(self, direction=gpio.DIRECTION_INPUT, default=False, flags=0):
8383
Arguments:
8484
direction: input or output. Default: gpio.DIRECTION_INPUT.
8585
flags: to request pull-up/down resistors or open-collector outputs.
86-
86+
8787
Example::
8888
with gpio.Chip(0) as chip:
8989
line = chip.line(16)
@@ -222,7 +222,7 @@ def monitor(self, type=gpio.REQUEST_EVENT_RISING_EDGE, flags=0):
222222
flags: REQUEST_FLAG_* values (ORed)
223223
224224
Usage::
225-
225+
226226
with gpio.Chip(0) as chip:
227227
line = chip.line(13)
228228
with line.monitor():

trio_gpio/libgpiod.py

Lines changed: 84 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -36,97 +36,97 @@
3636
ffi.cdef(
3737
"""
3838
enum {
39-
GPIOD_CTXLESS_EVENT_CB_TIMEOUT,
40-
GPIOD_CTXLESS_EVENT_CB_RISING_EDGE,
41-
GPIOD_CTXLESS_EVENT_CB_FALLING_EDGE,
39+
GPIOD_CTXLESS_EVENT_CB_TIMEOUT,
40+
GPIOD_CTXLESS_EVENT_CB_RISING_EDGE,
41+
GPIOD_CTXLESS_EVENT_CB_FALLING_EDGE,
4242
};
4343
4444
enum {
45-
GPIOD_CTXLESS_EVENT_CB_RET_ERR = -1,
46-
GPIOD_CTXLESS_EVENT_CB_RET_OK = 0,
47-
GPIOD_CTXLESS_EVENT_CB_RET_STOP = 1,
45+
GPIOD_CTXLESS_EVENT_CB_RET_ERR = -1,
46+
GPIOD_CTXLESS_EVENT_CB_RET_OK = 0,
47+
GPIOD_CTXLESS_EVENT_CB_RET_STOP = 1,
4848
};
4949
5050
enum {
51-
GPIOD_CTXLESS_EVENT_POLL_RET_STOP = -2,
52-
GPIOD_CTXLESS_EVENT_POLL_RET_ERR = -1,
53-
GPIOD_CTXLESS_EVENT_POLL_RET_TIMEOUT = 0,
51+
GPIOD_CTXLESS_EVENT_POLL_RET_STOP = -2,
52+
GPIOD_CTXLESS_EVENT_POLL_RET_ERR = -1,
53+
GPIOD_CTXLESS_EVENT_POLL_RET_TIMEOUT = 0,
5454
};
5555
5656
enum {
57-
GPIOD_LINE_DIRECTION_INPUT,
58-
GPIOD_LINE_DIRECTION_OUTPUT,
57+
GPIOD_LINE_DIRECTION_INPUT,
58+
GPIOD_LINE_DIRECTION_OUTPUT,
5959
};
6060
6161
enum {
62-
GPIOD_LINE_ACTIVE_STATE_HIGH,
63-
GPIOD_LINE_ACTIVE_STATE_LOW,
62+
GPIOD_LINE_ACTIVE_STATE_HIGH,
63+
GPIOD_LINE_ACTIVE_STATE_LOW,
6464
};
6565
6666
enum {
67-
GPIOD_LINE_REQUEST_DIRECTION_AS_IS,
68-
GPIOD_LINE_REQUEST_DIRECTION_INPUT,
69-
GPIOD_LINE_REQUEST_DIRECTION_OUTPUT,
70-
GPIOD_LINE_REQUEST_EVENT_FALLING_EDGE,
71-
GPIOD_LINE_REQUEST_EVENT_RISING_EDGE,
72-
GPIOD_LINE_REQUEST_EVENT_BOTH_EDGES,
67+
GPIOD_LINE_REQUEST_DIRECTION_AS_IS,
68+
GPIOD_LINE_REQUEST_DIRECTION_INPUT,
69+
GPIOD_LINE_REQUEST_DIRECTION_OUTPUT,
70+
GPIOD_LINE_REQUEST_EVENT_FALLING_EDGE,
71+
GPIOD_LINE_REQUEST_EVENT_RISING_EDGE,
72+
GPIOD_LINE_REQUEST_EVENT_BOTH_EDGES,
7373
};
7474
7575
enum {
76-
GPIOD_LINE_REQUEST_FLAG_OPEN_DRAIN = 1,
77-
GPIOD_LINE_REQUEST_FLAG_OPEN_SOURCE = 2,
78-
GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW = 4,
76+
GPIOD_LINE_REQUEST_FLAG_OPEN_DRAIN = 1,
77+
GPIOD_LINE_REQUEST_FLAG_OPEN_SOURCE = 2,
78+
GPIOD_LINE_REQUEST_FLAG_ACTIVE_LOW = 4,
7979
};
8080
8181
enum {
82-
GPIOD_LINE_EVENT_RISING_EDGE,
83-
GPIOD_LINE_EVENT_FALLING_EDGE,
82+
GPIOD_LINE_EVENT_RISING_EDGE,
83+
GPIOD_LINE_EVENT_FALLING_EDGE,
8484
};
8585
8686
struct timespec {
87-
long tv_sec;
88-
long tv_nsec;
87+
long tv_sec;
88+
long tv_nsec;
8989
};
9090
9191
struct gpiod_line {
92-
unsigned int offset;
93-
int direction;
94-
int active_state;
95-
bool used;
96-
bool open_source;
97-
bool open_drain;
98-
int state;
99-
bool up_to_date;
100-
struct gpiod_chip *chip;
101-
int fd;
102-
char name[32];
103-
char consumer[32];
92+
unsigned int offset;
93+
int direction;
94+
int active_state;
95+
bool used;
96+
bool open_source;
97+
bool open_drain;
98+
int state;
99+
bool up_to_date;
100+
struct gpiod_chip *chip;
101+
int fd;
102+
char name[32];
103+
char consumer[32];
104104
};
105105
106106
struct gpiod_chip {
107-
struct gpiod_line **lines;
108-
unsigned int num_lines;
109-
int fd;
110-
char name[32];
111-
char label[32];
107+
struct gpiod_line **lines;
108+
unsigned int num_lines;
109+
int fd;
110+
char name[32];
111+
char label[32];
112112
};
113113
114114
struct gpiod_ctxless_event_poll_fd {
115-
int fd;
116-
/**< File descriptor number. */
117-
bool event;
118-
/**< Indicates whether an event occurred on this file descriptor. */
115+
int fd;
116+
/**< File descriptor number. */
117+
bool event;
118+
/**< Indicates whether an event occurred on this file descriptor. */
119119
};
120120
121121
struct gpiod_line_request_config {
122-
const char *consumer;
123-
int request_type;
124-
int flags;
122+
const char *consumer;
123+
int request_type;
124+
int flags;
125125
};
126126
127127
struct gpiod_line_event {
128-
struct timespec ts;
129-
int event_type;
128+
struct timespec ts;
129+
int event_type;
130130
};
131131
132132
struct gpiod_chip;
@@ -140,27 +140,27 @@
140140
typedef void (*gpiod_ctxless_set_value_cb)(void *);
141141
142142
typedef int (*gpiod_ctxless_event_handle_cb)(int, unsigned int,
143-
const struct timespec *, void *);
143+
const struct timespec *, void *);
144144
145145
typedef int (*gpiod_ctxless_event_poll_cb)(unsigned int,
146-
struct gpiod_ctxless_event_poll_fd *,
147-
const struct timespec *, void *);
146+
struct gpiod_ctxless_event_poll_fd *,
147+
const struct timespec *, void *);
148148
149149
int gpiod_ctxless_set_value(const char *device, unsigned int offset, int value,
150-
bool active_low, const char *consumer,
151-
gpiod_ctxless_set_value_cb cb,
152-
void *data);
150+
bool active_low, const char *consumer,
151+
gpiod_ctxless_set_value_cb cb,
152+
void *data);
153153
154154
int gpiod_ctxless_set_value_multiple(const char *device,
155-
const unsigned int *offsets,
156-
const int *values, unsigned int num_lines,
157-
bool active_low, const char *consumer,
158-
gpiod_ctxless_set_value_cb cb,
159-
void *data);
160-
155+
const unsigned int *offsets,
156+
const int *values, unsigned int num_lines,
157+
bool active_low, const char *consumer,
158+
gpiod_ctxless_set_value_cb cb,
159+
void *data);
160+
161161
int gpiod_ctxless_find_line(const char *name, char *chipname,
162-
size_t chipname_size,
163-
unsigned int *offset);
162+
size_t chipname_size,
163+
unsigned int *offset);
164164
165165
struct gpiod_chip *gpiod_chip_open(const char *path);
166166
@@ -207,42 +207,42 @@
207207
bool gpiod_line_needs_update(struct gpiod_line *line);
208208
209209
int gpiod_line_request(struct gpiod_line *line,
210-
const struct gpiod_line_request_config *config,
211-
int default_val);
210+
const struct gpiod_line_request_config *config,
211+
int default_val);
212212
213213
int gpiod_line_request_input(struct gpiod_line *line,
214-
const char *consumer);
214+
const char *consumer);
215215
216216
int gpiod_line_request_output(struct gpiod_line *line,
217-
const char *consumer, int default_val);
217+
const char *consumer, int default_val);
218218
219219
int gpiod_line_request_rising_edge_events(struct gpiod_line *line,
220-
const char *consumer);
220+
const char *consumer);
221221
222222
int gpiod_line_request_falling_edge_events(struct gpiod_line *line,
223-
const char *consumer);
223+
const char *consumer);
224224
225225
int gpiod_line_request_both_edges_events(struct gpiod_line *line,
226-
const char *consumer);
226+
const char *consumer);
227227
228228
int gpiod_line_request_input_flags(struct gpiod_line *line,
229-
const char *consumer, int flags);
229+
const char *consumer, int flags);
230230
231231
int gpiod_line_request_output_flags(struct gpiod_line *line,
232-
const char *consumer, int flags,
233-
int default_val);
232+
const char *consumer, int flags,
233+
int default_val);
234234
235235
int gpiod_line_request_rising_edge_events_flags(struct gpiod_line *line,
236-
const char *consumer,
237-
int flags);
236+
const char *consumer,
237+
int flags);
238238
239239
int gpiod_line_request_falling_edge_events_flags(struct gpiod_line *line,
240-
const char *consumer,
241-
int flags);
240+
const char *consumer,
241+
int flags);
242242
243243
int gpiod_line_request_both_edges_events_flags(struct gpiod_line *line,
244-
const char *consumer,
245-
int flags);
244+
const char *consumer,
245+
int flags);
246246
247247
void gpiod_line_release(struct gpiod_line *line);
248248
@@ -255,10 +255,10 @@
255255
int gpiod_line_set_value(struct gpiod_line *line, int value);
256256
257257
int gpiod_line_event_wait(struct gpiod_line *line,
258-
const struct timespec *timeout);
258+
const struct timespec *timeout);
259259
260260
int gpiod_line_event_read(struct gpiod_line *line,
261-
struct gpiod_line_event *event);
261+
struct gpiod_line_event *event);
262262
263263
int gpiod_line_event_get_fd(struct gpiod_line *line);
264264

0 commit comments

Comments
 (0)