You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Petro Karashchenko <pe...@gmail.com> on 2022/02/21 09:17:14 UTC

echo "X" > /dev/gpio lead to 3 writes instead of 1

Hello team,

Recently I've been working with a dev gpio interface (IO expander
case) and noticed that in NSH use case use echo to change the state of
GPIO output pin the actual GPIO write is executed 3 times. The first
one when the data are actually written, then when flush happens and
the third time when close happens. This seems to be no problem to me
in MCU GPIO case, but in case of IO expander that seems to be too
excessive because there is a bus transaction following each write. I
appreciate any comments on this. For now I'm thinking of adding a GPIO
output state cache for IO expander pins because I do not want to touch
anything related to VFS integration (simply do not have time to deep
dive into this now).

Best regards,
Petro