1. 21 Apr, 2016 1 commit
    • Damien George's avatar
      esp8266: Implement basic deep-sleep capabilities. · 32d7cf6e
      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)
      To detect if the system woke from a deep sleep use:
          if machine.reset_cause() == machine.DEEPSLEEP_RESET:
              print('woke from deep sleep')
  2. 04 Mar, 2016 1 commit
    • Paul Sokolovsky's avatar
      esp8266: Reset "virtual RTC" on power on. · a4c8ef9d
      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).
  3. 12 Feb, 2016 1 commit
  4. 08 Feb, 2016 1 commit
  5. 11 Jan, 2016 1 commit
    • Damien George's avatar
      py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*. · 5b3f0b7f
      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.
  6. 31 Oct, 2015 1 commit
    • Damien George's avatar
      all: Add py/mphal.h and use it in all ports. · 731f3592
      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.
  7. 22 Jun, 2015 1 commit
  8. 13 May, 2015 1 commit
  9. 12 May, 2015 1 commit