<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/esp8266/modpybrtc.c, branch esp-extra-scripts</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=esp-extra-scripts</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=esp-extra-scripts'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2016-06-06T09:51:12+00:00</updated>
<entry>
<title>esp8266: Let RTC work correctly after deepsleep.</title>
<updated>2016-06-06T09:51:12+00:00</updated>
<author>
<name>puuu</name>
<email>puuu@users.noreply.github.com</email>
</author>
<published>2016-06-03T15:21:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=ee12581a3545c6e950b4a2b5322167eb73326928'/>
<id>urn:sha1:ee12581a3545c6e950b4a2b5322167eb73326928</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>esp8266/modpybrtc: Handle RTC overflow.</title>
<updated>2016-06-03T13:37:49+00:00</updated>
<author>
<name>puuu</name>
<email>puuu@users.noreply.github.com</email>
</author>
<published>2016-05-24T13:31:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=cafdfb7af3628aac5110770097b6cb4fdd70b9d5'/>
<id>urn:sha1:cafdfb7af3628aac5110770097b6cb4fdd70b9d5</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>esp8266/rtc: Set RTC user memory length to 0 on first boot.</title>
<updated>2016-06-01T10:33:04+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-06-01T10:33:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=752e952096815adc2e418967e4b056680924a584'/>
<id>urn:sha1:752e952096815adc2e418967e4b056680924a584</id>
<content type='text'>
So that RTC.memory() returns b'' on power up if it was never set.

Fixes issue #2138.
</content>
</entry>
<entry>
<title>esp8266: Implement basic deep-sleep capabilities.</title>
<updated>2016-04-21T10:43:37+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-04-21T10:43:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=32d7cf6e441660caed00620309d1faa4b7df5dd4'/>
<id>urn:sha1:32d7cf6e441660caed00620309d1faa4b7df5dd4</id>
<content type='text'>
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')
</content>
</entry>
<entry>
<title>esp8266: Reset "virtual RTC" on power on.</title>
<updated>2016-03-04T14:49:01+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-02-08T19:43:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a4c8ef9d16d45c58bbfc0aba451e4c197c552f0f'/>
<id>urn:sha1:a4c8ef9d16d45c58bbfc0aba451e4c197c552f0f</id>
<content type='text'>
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).
</content>
</entry>
<entry>
<title>esp8266/modpybrtc: Simplify multiplication by fixed-point value.</title>
<updated>2016-02-12T21:20:52+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-02-12T21:20:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=a2e39a756c45b388f61fae02b20602f8cc0e5f1d'/>
<id>urn:sha1:a2e39a756c45b388f61fae02b20602f8cc0e5f1d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>esp8266/modpybrtc: pyb_rtc_memory(): Fix copy-paste error.</title>
<updated>2016-02-08T19:39:33+00:00</updated>
<author>
<name>Paul Sokolovsky</name>
<email>pfalcon@users.sourceforge.net</email>
</author>
<published>2016-02-08T19:35:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=814b1ae3a9fbe5779ad24f481331e3567dce86bb'/>
<id>urn:sha1:814b1ae3a9fbe5779ad24f481331e3567dce86bb</id>
<content type='text'>
</content>
</entry>
<entry>
<title>py: Change first arg of type.make_new from mp_obj_t to mp_obj_type_t*.</title>
<updated>2016-01-11T00:49:27+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2016-01-03T15:55:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5b3f0b7f39bd67cc9182993c288f09f67a0890df'/>
<id>urn:sha1:5b3f0b7f39bd67cc9182993c288f09f67a0890df</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>all: Add py/mphal.h and use it in all ports.</title>
<updated>2015-10-31T16:14:30+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-10-30T23:03:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=731f359292c0e2630873df1a19c5baac7287024f'/>
<id>urn:sha1:731f359292c0e2630873df1a19c5baac7287024f</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>esp8266: Make pyb.RTC a type, and pyb.RTC() constructs an RTC object.</title>
<updated>2015-06-22T22:03:17+00:00</updated>
<author>
<name>Damien George</name>
<email>damien.p.george@gmail.com</email>
</author>
<published>2015-06-22T22:03:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=de8b585ab7436db3acac3a6a32b50a594729fea9'/>
<id>urn:sha1:de8b585ab7436db3acac3a6a32b50a594729fea9</id>
<content type='text'>
This is the standard way of doing things, one should construct a
peripheral object (even if it's a singleton).

See issue #1330.
</content>
</entry>
</feed>
