- 21 Apr, 2016 1 commit
-
-
Damien George authored
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')
-
- 04 Mar, 2016 1 commit
-
-
Paul Sokolovsky authored
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).
-
- 12 Feb, 2016 1 commit
-
-
Paul Sokolovsky authored
-
- 08 Feb, 2016 1 commit
-
-
Paul Sokolovsky authored
-
- 11 Jan, 2016 1 commit
-
-
Damien George authored
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.
-
- 31 Oct, 2015 1 commit
-
-
Damien George authored
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.
-
- 22 Jun, 2015 1 commit
-
-
Damien George authored
This is the standard way of doing things, one should construct a peripheral object (even if it's a singleton). See issue #1330.
-
- 13 May, 2015 1 commit
-
-
Josef Gajdusek authored
-
- 12 May, 2015 1 commit
-
-
Josef Gajdusek authored
-