-
Notifications
You must be signed in to change notification settings - Fork 16
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
Proper deepsleep as proposed upstream #4
Conversation
Very rough support, just enough to get machine.deepsleep() to work properly
esp32/modmachine.c Added RTC object esp32/modmachine.h Added RTC object Just enough code for this to work on ESP32: import machine rtc = machine.RTC() # Need to implement this first! rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP) # syntactic sugar to match, probably a NOP rtc.alarm(rtc.ALARM0, 10000) # calls esp_deep_sleep_enable_timer_wakeup() in IDF machine.deepsleep() # calls esp_deep_sleep_start() in IDF
esp32/machine_pin.h: Exposes machine_pin_get_pin_object_ptr New function so that the RTC wake mode configurations can return the current Pin(s) that they're configured for.
esp32/machine_pin.h removed
These didn't seem to add much value, expecially since returning Pin objects is nearly useless.
exp32/machine_rtc.h exp32/modmachine.c Removed the legacy compatibility 8266 code.
esp32/modmachine.c: format fixes
Conflicts: esp32/modmachine.c esp32/modmachine.h
Would appreciate any feedback or bug reports. |
Sure thing! |
Sorry to be so dumb, but how can I merge this pull request into my local version so that I can test it ? |
I used the pretty invasive method of pulling from @MrSurly's repo-branch with the command |
@annejan - Thanks that worked, I know the basics, but struggle to understand github sometimes. Just doing a quick test, this is the output, when the timer expires, I presume I need to check the reset reason, but why the "flash read err, 1000" ??
|
I have not had that happening myself. In our branch I've added a helper for reading the reset reason . .
And exporting the symbols like . .
I use it like this . .
http://esp32.info/docs/esp_idf/html/db/dc1/group__rtc__apis.html#ga826b88529aef76135636c06d408513aa |
Thanks, yes I did erase before I flashed it, also calling machine.reset() results in lots of this:
|
@annejan: That's a good idea (and I'm going to steal it), but I'm going to roll it into |
Sounds like I should move it there as well! Thanks :) |
On the 8266 it's done like this:
|
I'm working on a full PR for ESP32 upstream. I'll be done today, if you
can wait.
…On Tue, Jun 13, 2017 at 7:49 AM, Anne Jan Brouwer ***@***.***> wrote:
Sounds like I should move it there as well!
Thanks :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAYHCLa8oWY7Auut6ffGRv9GNjxnZ7DNks5sDqGCgaJpZM4NyfxI>
.
|
Ok, this is working, but I'm seeing the same issue as @pacmac, with the multiple Here: https://github.com/MrSurly/micropython-esp32/tree/dev-reset-cause |
OK, seems this is a known issue, ( espressif/esp-idf#113) seems to be caused by a slow wakeup of the flash device on the esp32-wroom, there is a work-around built into the IDF:
Although this config setting appears in sdconfig.h, there does not appear to be any code that is looking for this config setting. As I know next to nothing about the C language, how can I add this check to the code as per the example given in the IDF examples:
|
It's used in Simply setting the value should do it. |
Do I set the value directly in sdkconfig.h ? |
Here's what I would do: Use |
Want to be ahead of the curve micropython#85