-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
ESP32: Add AM2320 support #3202
ESP32: Add AM2320 support #3202
Conversation
Ported raw from 8266 implementation, still using busy-wait for read function fix whitespace
No problems, this can definitely wait.
…On Thu, 9 Jul 2020 at 8:24 pm, Marcel Stör ***@***.***> wrote:
I'd like to land #3135
<#3135> from @nwf
<https://github.com/nwf> first and then for you to rebase.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3202 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKXTGWELLQJ7O2A7LSRD2LR2WLEJANCNFSM4OUUS2UA>
.
|
Giving the C a quick once-over, there doesn't seem to be any reason that this should be a C module (or ESP32 specific) and not just some Lua code: the sensor communicates over I2C, there appear to be no timing requirements, and all math is on small integers. Maybe see #3197 or the similar Lua modules (e.g., bh1750 or ds2321 or mcp23008)? ETA: if that's true, then there's no reason to stay blocked behind #3135. |
@nwf, good point. I was just trying to reuse/migrate what was already there, however if there is a better way I am happy to rewrite it. There are a couple of microsecond timing delays in the read negotiation, but they are likely not strict. To be honest, I am not aware if these can be transitioned to lua efficiently, and I was also not sure if the methodology I used was even correct when migrating (os_delay_us -> ets_delay_us). I'll take a look at the sample modules in detail and disband the PR if I manage to rewrite it as a lua module. |
Have you come to a conclusion yet? |
@@ -54,6 +54,12 @@ config LUA_MODULE_ADC | |||
Includes the adc module. This module provides access to the | |||
adc1 hardware. | |||
|
|||
config LUA_MODULE_AM2320 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case you rebase this will have to become NODEMCU_CMODULE_AM2320
.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
dev-esp32
branch rather than formaster
.docs/*
.Ported almost raw from ESP8266 implementation (https://github.com/nodemcu/nodemcu-firmware/blob/release/app/modules/am2320.c).