Skip to content

Add chip_model method #2

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

Merged
merged 3 commits into from
Jun 29, 2023
Merged

Add chip_model method #2

merged 3 commits into from
Jun 29, 2023

Conversation

vickash
Copy link
Contributor

@vickash vickash commented Jun 28, 2023

I'm working on ESP32-S2 and ESP32-S3 support for mruby-esp32-gpio (PR soon). This method allows the mruby script to identify which chip it's running on.

@pandax381
Copy link
Member

Thanks!

We will merge them, but there is one thing we would like you to change.
I would like the system type to be a constant value instead of a string.

@vickash
Copy link
Contributor Author

vickash commented Jun 29, 2023

Do you mean store the string in something like ESP32::Constants::CHIP_MODEL instead of a method? Or do you want to use the raw integers from the enum instead of a readable string?

@pandax381
Copy link
Member

The later. I want the raw integers in enum to be defined as mruby constants and used as such.

@vickash
Copy link
Contributor Author

vickash commented Jun 29, 2023

Done. I'm working on the ESP-IDF 5.1 release btw. Lower versions won't have values for the newer chips available in the enum.

@pandax381
Copy link
Member

Perfect!

I'll merge it once here.
Please submit another pull request for ESP-IDF 5.1 support.

@pandax381 pandax381 merged commit 1a02da1 into mruby-esp32:master Jun 29, 2023
@vickash
Copy link
Contributor Author

vickash commented Jun 29, 2023

5.1 generally works like 5.0 with no changes.

I meant that defining constants for new chips (introduced in 5.1) breaks backward compatibility with 5.0.

I changed it to be conditional based on IDF version in da5abb7. That should restore compatibility with 5.0.

@pandax381
Copy link
Member

Thanks to this, I understand it.

@vickash vickash deleted the chip_model branch July 1, 2023 05:36
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.

2 participants