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

Request : wish the library support for ArduinoUno, Arduino MEGA. #11

Open
TridentTD opened this issue Oct 26, 2022 · 4 comments
Open

Request : wish the library support for ArduinoUno, Arduino MEGA. #11

TridentTD opened this issue Oct 26, 2022 · 4 comments

Comments

@TridentTD
Copy link

It's a great library.
By the ways, if the library support for Arduino Uno/MEGA,
it's convenient for communication between MCUs by YAML.

Thank now.

@tobozo
Copy link
Owner

tobozo commented Oct 26, 2022

hi, thanks for you feedback 👍

there's a blocking problem with AVR:

  • incomplete sdt lib (prevents some c++ templates from evaluating arg types)
  • Print object is missing the printf() method (e.g. should be inherited by Stream) which is critical for this library

I've pushed some changes on an experimental branch so you can test, but this will require to manually add printf to your existing arduino package.

Files to edit:

~/.arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/Print.h
~/.arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/Print.cpp

@TridentTD
Copy link
Author

hi, thanks for you feedback 👍

there's a blocking problem with AVR:

  • incomplete sdt lib (prevents some c++ templates from evaluating arg types)
  • Print object is missing the printf() method (e.g. should be inherited by Stream) which is critical for this library

I've pushed some changes on an experimental branch so you can test, but this will require to manually add printf to your existing arduino package.

Files to edit:

~/.arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/Print.h
~/.arduino15/packages/arduino/hardware/avr/1.8.5/cores/arduino/Print.cpp

Thank you for the fast reply.
I have already tested, it can be compiled.
However for Arduino UNO, the mcu's space is too small to use.

If the project wish to use YAML on Arduino UNO,
is there any way to parse the YAML data?

Thank you.

@tobozo
Copy link
Owner

tobozo commented Oct 26, 2022

I don't have a Uno, but 2048 bytes of ram sounds a bit too tight to hold both ArduinoJson and YAML library.

ArduinoJson support does compile with some serializeYml() tests though, but deserializeYml() jumps to 300% program space and 250% dynamic memory use, and the former doesn't make sense without the latter.

even mega2560's 8Kb of RAM doesn't sound much given how unoptimized the library is.

  • yaml parsing/emitting is less hungry in memory but requires a big function with a lot of switches (flash space)
  • yaml loading uses less space but requires memory and will create more copies during deconstruction.

I'm trying to apply so basic optimization rules, and will probably get rid of some templates, but I'm very doubtful for deserializeYml() support.

@tobozo
Copy link
Owner

tobozo commented Oct 26, 2022

this printf() implementation is 148 bytes better https://github.com/arduino/ArduinoCore-API/pull/28/files

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

No branches or pull requests

2 participants