Re: Elegant way to kill previous gpioset?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 16, 2022 at 09:54:21AM +0100, Leszek Dubiel wrote:
> 
> 
> I was wondering if there is some "one-liner" that
> recofigures pin, something like:
> 
>                 gpioset -b -msignal --autokill /dev/gpiochip2 7=0
> 
> or
>                 gpioset -b -msignal --force /dev/gpiochip2 7=0
> 
> that does these two commands at once:
> 
>               pkill -ef "^gpioset .* /dev/gpiochip2 7=[01]$"
>               gpioset -b -msignal /dev/gpiochip2 7=0
> 
> 

Understand that GPIOs are a managed resource, like files, and what
you are asking for here is equivalent to a function that would kill
whatever process has a file open whenever you write to that file.
So, no there isn't.

It is really unfortunate that killing the process holding the line is the
only viable approach when using the libgpiod tools at the moment, but
better solutions to your problem should be available soon.
Alternatively you can use, say, the Python bindings to write something
that better suits your particular needs.

Cheers.
Kent.



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux