gpioctl.c (19602a38693a95ebf8995520b6b6f9c9131bfd83) | gpioctl.c (ff3468ac94597efdcbc56f372528dfc98b114dac) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2009, Oleksandr Tymoshenko <gonzo@FreeBSD.org> 5 * Copyright (c) 2014, Rui Paulo <rpaulo@FreeBSD.org> 6 * Copyright (c) 2015, Emmanuel Vadot <manu@bidouilliste.com> 7 * All rights reserved. 8 * --- 318 unchanged lines hidden (view full) --- 327 } 328 329 if (config) { 330 flags = 0; 331 for (i = 1; i < argc; i++) { 332 flag = str2cap(argv[i]); 333 if (flag < 0) 334 fail("Invalid flag: %s\n", argv[i]); | 1/*- 2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3 * 4 * Copyright (c) 2009, Oleksandr Tymoshenko <gonzo@FreeBSD.org> 5 * Copyright (c) 2014, Rui Paulo <rpaulo@FreeBSD.org> 6 * Copyright (c) 2015, Emmanuel Vadot <manu@bidouilliste.com> 7 * All rights reserved. 8 * --- 318 unchanged lines hidden (view full) --- 327 } 328 329 if (config) { 330 flags = 0; 331 for (i = 1; i < argc; i++) { 332 flag = str2cap(argv[i]); 333 if (flag < 0) 334 fail("Invalid flag: %s\n", argv[i]); |
335 else if ((flag & GPIO_INTR_MASK) != 0) 336 fail("Interrupt capability %s cannot be set as configuration flag\n", argv[i]); |
|
335 flags |= flag; 336 } 337 pin.g_pin = pinn; 338 pin.g_flags = flags; 339 if (gpio_pin_set_flags(handle, &pin) < 0) { 340 perror("gpio_pin_set_flags"); 341 exit(1); 342 } --- 38 unchanged lines hidden --- | 337 flags |= flag; 338 } 339 pin.g_pin = pinn; 340 pin.g_flags = flags; 341 if (gpio_pin_set_flags(handle, &pin) < 0) { 342 perror("gpio_pin_set_flags"); 343 exit(1); 344 } --- 38 unchanged lines hidden --- |