You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* - Renamed `getChannel` to `getChannelState` because `getChannel` is a stupid name for this function.
- Fixed a stupid bug where I mixed up GPIOs and channels
- Reading channels, enabling channels and disabling channels now works as expected.
- Fixed help text
- Channel arguments now no longer have optional flags
- Fixed small logic error in the output text.
* Added new `all` switch
* Added basic toolchain files for CMake
* Bumped up version to next minor
auto line = gpioChip.prepare_request().add_line_settings(gpioChip.get_line_offset_from_name(fmt::format("GPIO{0:d}", channel)), lineSettings).do_request();
@@ -221,7 +227,7 @@ void listChannels() {
221
227
size_t channelCounter = 1;
222
228
223
229
for (constauto channel : CHANNELS) {
224
-
fmt::println("Channel {0:d} (GPIO pin {1:d}) set to {2:s}", channelCounter++, channel, getChannel(channel) ? "OFF" : "ON");
230
+
fmt::println("Channel {0:d} (GPIO pin {1:d}) set to {2:s}", channelCounter++, channel, getChannelState(channel) ? "OFF" : "ON");
225
231
}
226
232
}
227
233
@@ -232,7 +238,7 @@ void printHelp() {
232
238
Usage:
233
239
{0:s} -h
234
240
{0:s} -e -123 # enable channels 1, 2, and 3
235
-
{0:s} -d -528 -7=r # disable channels 5, 2, and 8 and read the state of channel 7
241
+
{0:s} -d -528 # disable channels 5, 2, and 8 and read the state of channel 7
236
242
{0:s} -L # read the states of all channels
237
243
238
244
Troubleshooting:
@@ -241,21 +247,22 @@ void printHelp() {
241
247
242
248
Options:
243
249
Channel selection:
244
-
--channel1, -1[=edr] Channel 1
245
-
--channel2, -2[=edr] Look, it's the same up until -8
250
+
--channel1, -1 Channel 1
251
+
--channel2, -2 Look, it's the same up until -8
246
252
...
247
-
--channel8, -8[=edr] I'm sure it's self-explanatory at this point
253
+
--channel8, -8 I'm sure it's self-explanatory at this point
254
+
--all, -a All channels
248
255
249
256
Channel options:
250
-
--enable, -e Enable channel(s)
251
-
--disable, -d Disable channel(s)
252
-
--read, -r Read the channel state
257
+
--enable, -e Enable channel(s)
258
+
--disable, -d Disable channel(s)
259
+
--read, -r Read the channel state
253
260
254
261
General options:
255
-
--list-all, -L List all channels and their current state
262
+
--list-all, -L List all channels and their current state
256
263
257
-
--help, -h Displays this text and exits
258
-
--version, -v Displays the version information and exits
264
+
--help, -h Displays this text and exits
265
+
--version, -v Displays the version information and exits
0 commit comments