summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/modpybrtc.c
Commit message (Collapse)AuthorAge
* esp8266: Rename "machine" module implementation to use contemporary naming.Paul Sokolovsky2016-11-06
| | | | | | | Previously they used historical "pyb" affix causing confusion and inconsistency (there's no "pyb" module in modern ports; but people took esp8266 port as an example, and "pyb" naming kept proliferating, while other people complained that source structure is not clear).
* esp8266/modpybrtc.c: Implement machine.RTC.alarm_left()puuu2016-10-05
| | | | | Implementation of machine.RTC.alarm_left(), like described in the documentation.
* esp8266/modpybrtc: Use 64-bit arithmetic when computing alarm expiry.Damien George2016-08-25
|
* esp8266: Let RTC work correctly after deepsleep.puuu2016-06-06
| | | | | | | | | By design, at wake up from deepsleep, the RTC timer will be reset, but the data stored in RTC memory will not [1]. Therefore, we have to adjust delta in RTC memory before going into deepsleep to get almost correct time after waking up. [1] http://bbs.espressif.com/viewtopic.php?t=1184#p4082
* esp8266/modpybrtc: Handle RTC overflow.puuu2016-06-03
| | | | | | | | ESP-SDK system_get_rtc_time() returns uint32 and therefore overflow about every 7:45h. Let's write the last state of system_get_rtc_time() in RTC mem and use it to check for overflow. This commit require running pyb_rtc_get_us_since_2000() at least once within 7 hours to avoid overflow.
* esp8266/rtc: Set RTC user memory length to 0 on first boot.Damien George2016-06-01
| | | | | | So that RTC.memory() returns b'' on power up if it was never set. Fixes issue #2138.
* esp8266: Implement basic deep-sleep capabilities.Damien George2016-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use the machine.deepsleep() function to enter the sleep mode. Use the RTC to configure the alarm to wake the device. Basic use is the following: import machine # configure RTC's ALARM0 to wake device from deep sleep rtc = machine.RTC() rtc.irq(trigger=rtc.ALARM0, wake=machine.DEEPSLEEP) # do other things # ... # set ALARM0's alarm to wake after 10 seconds rtc.alarm(rtc.ALARM0, 10000) # enter deep-sleep state (system is reset upon waking) machine.deepsleep() To detect if the system woke from a deep sleep use: if machine.reset_cause() == machine.DEEPSLEEP_RESET: print('woke from deep sleep')
* esp8266: Reset "virtual RTC" on power on.Paul Sokolovsky2016-03-04
| | | | | | | | | Initialize RTC period coefficients, etc. if RTC RAM doesn't contain valid values. time.time() then will return number of seconds since power-on, unless set to different timebase. This reuses MEM_MAGIC for the purpose beyond its initial purpose (but the whole modpybrtc.c need to be eventually reworked completely anyway).
* esp8266/modpybrtc: Simplify multiplication by fixed-point value.Paul Sokolovsky2016-02-12
|
* esp8266/modpybrtc: pyb_rtc_memory(): Fix copy-paste error.Paul Sokolovsky2016-02-08
|
* py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.Damien George2016-01-11
| | | | | | | | The first argument to the type.make_new method is naturally a uPy type, and all uses of this argument cast it directly to a pointer to a type structure. So it makes sense to just have it a pointer to a type from the very beginning (and a const pointer at that). This patch makes such a change, and removes all unnecessary casting to/from mp_obj_t.
* all: Add py/mphal.h and use it in all ports.Damien George2015-10-31
| | | | | | py/mphal.h contains declarations for generic mp_hal_XXX functions, such as stdio and delay/ticks, which ports should provide definitions for. A port will also provide mphalport.h with further HAL declarations.
* esp8266: Make pyb.RTC a type, and pyb.RTC() constructs an RTC object.Damien George2015-06-22
| | | | | | | This is the standard way of doing things, one should construct a peripheral object (even if it's a singleton). See issue #1330.
* esp8266: Actually use the decimal part of system_rtc_clock_cali_proc()Josef Gajdusek2015-05-13
|
* esp8266: Add utime and pyb.RTCJosef Gajdusek2015-05-13