Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 6901

C/C++ • Re: try to figure out how gpiod works. But it locks pins and can't have access with another app.

$
0
0
as to the Pi:
drop the Pi5, develop a backwards-compatible Pi6, update wiringPi, maintain it for future compatibility.
That would be complete madness. If you want to return to 10 years ago, just buy a Pi1, stick a 10 year old OS on it and enjoy.
Or buy a Pi 5, install Bookworm, and keep enjoying doing it the way you have done for a decade. Though not with Wiring Pi because that hasn't been updated to work with Bookworm yet, and may never be.

But you can do it with 'libgpiod', through language binding libraries or by shelling out to execute 'libgpiod' command line tools, or by using some other GPIO interfacing library. And by using Wiring Pi if someone updates that.
Allowing access by two things to the same GPIO may have been possible before, but who actually did it in anger?
It is still possible now, on Pi 5 and Bookworm, and I have done that. I have a button connected to my Pi and a program which detects short pushes and speaks out status information. I have a second program which detects long pushes of the same button and forces the Pi to shutdown.

That has worked for years, continues to work on a Pi 4 under Bookworm, and should work on a Pi 5 though I haven't actually tested that.
No-one writing good code.
I disagree with the notion that what I have is not good code.
We still like to educate, allowing access by two disparate apps to the same GPIO is not good code, so that is good education.
But Raspberry Pi do allow access to the same GPIO by two or more disparate apps, on a Pi 5 and under Bookworm.

You seem to be defending what Raspberry Pi has done on the grounds they have prevented users from having two disparate apps from accessing the same GPIO. Raspberry Pi hasn't done that.

On a Pi 5 and under Bookworm makers can still have two or more disparate apps accessing the same GPIO. What has changed is makers can choose to prevent that if they want to. It is not mandatory nor compulsory to do so.
Why do people want to promote bad code?
Because they don't agree with your assessment that it is 'bad code'.

One could also ask why Raspberry Pi have encouraged people to create and use such 'bad code' for the last decade ?

And why does Raspberry Pi still allow people to use 'bad code', on a Pi 5 and under Bookworm ?

The bottom line is Raspberry Pi allows people to use 'bad code' if they want, and allows them to do it differently if they don't like that way. That to me is the right decision even if others don't believe it is.

Statistics: Posted by hippy — Tue Jan 09, 2024 1:12 pm



Viewing all articles
Browse latest Browse all 6901

Trending Articles