Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to print all GPIO values at once #1798

Merged
merged 2 commits into from
Jun 29, 2019

Conversation

Niek
Copy link
Contributor

@Niek Niek commented Jun 27, 2019

No description provided.

@mcspr
Copy link
Collaborator

mcspr commented Jun 27, 2019

Note that PSTR, unlike the normal const char*, is stored twice:
https://github.com/esp8266/Arduino/blob/f9009b8a5e141235d3380cc6c6c06223008a1099/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h#L37
Maybe it can always use a loop and stop / break in needed GPIO or just print all of them otherwise?

BTW. Sort of a nice-to-have, but I have not tried it yet (or maybe it is not even needed info, i think we only want INPUT pins readouts?)
per https://bbs.espressif.com/viewtopic.php?t=1140#p3806, gpio is marked as enabled when it is in output mode. https://github.com/esp8266/Arduino/blob/5a47cab77d396afeb842c9161327f9f4dca7c833/cores/esp8266/esp8266_peri.h#L57 is arduino-style macro that reads that register, conveniently accepting pin number as an argument.

@Niek
Copy link
Contributor Author

Niek commented Jun 27, 2019

Thanks for the pointers, I optimized the code and added input/output mode at each pin. I think we should support writing to both types, as it's useful for both cases.

@mcspr mcspr merged commit 3fb34c1 into xoseperez:dev Jun 29, 2019
@mcspr mcspr added this to the 1.13.6 milestone Jun 29, 2019
@Niek Niek deleted the terminal-gpio-enhancement branch July 15, 2019 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants