Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

Commit ad420d6

Browse files
committed
Merge branch 'master' into m5stack-dev
2 parents 8644388 + d9ee0a6 commit ad420d6

193 files changed

Lines changed: 5874 additions & 1355 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

MicroPython_BUILD/.cproject

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/app_update/include&quot;"/>
5050
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/mdns/include&quot;"/>
5151
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/ethernet/include&quot;"/>
52+
<listOptionValue builtIn="false" value="&quot;${IDF_PATH}/components/esp_adc_cal/include&quot;"/>
5253
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/MicroPython_BUILD}&quot;"/>
5354
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/MicroPython_BUILD/build/include}&quot;"/>
5455
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/MicroPython_BUILD/components/micropython/genhdr}&quot;"/>
@@ -117,44 +118,44 @@
117118
<buildTargets>
118119
<target name="BUILD" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
119120
<buildCommand>${PWD}/BUILD.sh</buildCommand>
120-
<buildArguments/>
121121
<buildTarget>-j8 all</buildTarget>
122122
<stopOnError>true</stopOnError>
123123
<useDefaultCommand>false</useDefaultCommand>
124124
<runAllBuilders>true</runAllBuilders>
125125
</target>
126126
<target name="FLASH" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
127127
<buildCommand>${PWD}/BUILD.sh</buildCommand>
128-
<buildArguments/>
129128
<buildTarget>flash</buildTarget>
130129
<stopOnError>true</stopOnError>
131130
<useDefaultCommand>false</useDefaultCommand>
132131
<runAllBuilders>true</runAllBuilders>
133132
</target>
134133
<target name="CLEAN" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
135134
<buildCommand>${PWD}/BUILD.sh</buildCommand>
136-
<buildArguments/>
137135
<buildTarget>clean</buildTarget>
138136
<stopOnError>true</stopOnError>
139137
<useDefaultCommand>false</useDefaultCommand>
140138
<runAllBuilders>true</runAllBuilders>
141139
</target>
142140
<target name="BUILD (verbose)" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
143141
<buildCommand>${PWD}/BUILD.sh</buildCommand>
142+
<buildArguments/>
144143
<buildTarget>-v all</buildTarget>
145144
<stopOnError>true</stopOnError>
146145
<useDefaultCommand>false</useDefaultCommand>
147146
<runAllBuilders>true</runAllBuilders>
148147
</target>
149148
<target name="FLASH - 8MB" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
150149
<buildCommand>${PWD}/BUILD.sh</buildCommand>
150+
<buildArguments/>
151151
<buildTarget>-f8 flash</buildTarget>
152152
<stopOnError>true</stopOnError>
153153
<useDefaultCommand>false</useDefaultCommand>
154154
<runAllBuilders>true</runAllBuilders>
155155
</target>
156156
<target name="FLASH - 16MB" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
157157
<buildCommand>${PWD}/BUILD.sh</buildCommand>
158+
<buildArguments/>
158159
<buildTarget>-f16 flash</buildTarget>
159160
<stopOnError>true</stopOnError>
160161
<useDefaultCommand>false</useDefaultCommand>
@@ -176,15 +177,13 @@
176177
</target>
177178
<target name="CLEAN &amp; BUILD" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
178179
<buildCommand>${PWD}/BUILD.sh</buildCommand>
179-
<buildArguments/>
180180
<buildTarget>-j8 clean all</buildTarget>
181181
<stopOnError>true</stopOnError>
182182
<useDefaultCommand>false</useDefaultCommand>
183183
<runAllBuilders>true</runAllBuilders>
184184
</target>
185185
<target name="CLEAN, BUILD &amp; FLASH" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
186186
<buildCommand>${PWD}/BUILD.sh</buildCommand>
187-
<buildArguments/>
188187
<buildTarget>-j8 clean all flash</buildTarget>
189188
<stopOnError>true</stopOnError>
190189
<useDefaultCommand>false</useDefaultCommand>
@@ -193,7 +192,14 @@
193192
<target name="Menuconfig" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
194193
<buildCommand>mate-terminal</buildCommand>
195194
<buildArguments>--working-directory="${PWD}" -e "./BUILD.sh menuconfig" &amp;</buildArguments>
196-
<buildTarget/>
195+
<stopOnError>true</stopOnError>
196+
<useDefaultCommand>false</useDefaultCommand>
197+
<runAllBuilders>true</runAllBuilders>
198+
</target>
199+
<target name="CLEAN &amp; BUILD (verbose)" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
200+
<buildCommand>${PWD}/BUILD.sh</buildCommand>
201+
<buildArguments/>
202+
<buildTarget>-j8 -v clean all</buildTarget>
197203
<stopOnError>true</stopOnError>
198204
<useDefaultCommand>false</useDefaultCommand>
199205
<runAllBuilders>true</runAllBuilders>

MicroPython_BUILD/BUILD.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
# makefatfs - create FatFS image
2121
# flashfatfs - create and flash FatFS image to ESP32
2222
# copyfatfs - flash prebuilt FatFS image to ESP32
23+
# makelfsfs - create LittleFS image
24+
# flashlfsfs - create and flash LittleFS image to ESP32
25+
# copylfsfs - flash prebuilt LittleFS image to ESP32
2326
# size - display static memory footprint of the firmware
2427
# size-components - display detailed memory footprint of the firmware
2528
# size-files - display detailed memory footprint of the firmware
@@ -45,7 +48,7 @@
4548

4649

4750
#=======================
48-
TOOLS_VER=ver20180321.id
51+
TOOLS_VER=ver20180404.id
4952
#=======================
5053

5154
# -----------------------------
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# MicroPython for ESP32
2+
3+
# with support for 4MB of psRAM
4+
5+
6+
**MicroPython core** is synchronized with [main MicroPython repository](https://github.com/micropython/micropython)
7+
8+
**Commit:** bcfff4fc98a73c5ad9b7d3e338649955e861ada4
9+
10+
<br>
11+
12+
Some source files are changed to be compatible with this port.<br>
13+
All modified files has the copyright notice:<br>
14+
_Copyright (c) 2018 LoBo (https://github.com/loboris)_<br>
15+
16+
## List of the modified files:
17+
18+
### **py** directory
19+
20+
builtinhelp.c<br>
21+
modmath.c<br>
22+
modmicropython.c<br>
23+
modsys.c<br>
24+
modthread.c<br>
25+
mpconfig.h<br>
26+
mphal.h<br>
27+
mpstate.h<br>
28+
mpthread.h<br>
29+
mpz.c<br>
30+
mpz.h<br>
31+
obj.c<br>
32+
obj.h<br>
33+
objint_mpz.c<br>
34+
ringbuf.h<br>
35+
runtime.h<br>
36+
scheduler.c<br>
37+
vm.c<br>
38+
39+
### **extmod** directory
40+
41+
machine_pulse.c<br>
42+
modbtree.c<br>
43+
modframebuf.c<br>
44+
modlwip.c<br>
45+
moduhashlib.c<br>
46+
moduselect.c<br>
47+
modussl_mbedtls.c<br>
48+
modutimeq.c<br>
49+
utime_mphal.c<br>
50+
utime_mphal.h<br>
51+
vfs.c<br>
52+
53+
### **lib** directory
54+
55+
utils/pyexec.c<br>
56+
utils/sys_stdio_mphal.c<br>
57+
mp-readline/readline.c<br>
58+
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
:mod:`array` -- arrays of numeric data
2+
======================================
3+
4+
.. module:: array
5+
:synopsis: efficient arrays of numeric data
6+
7+
|see_cpython_module| :mod:`python:array`.
8+
9+
Supported format codes: ``b``, ``B``, ``h``, ``H``, ``i``, ``I``, ``l``,
10+
``L``, ``q``, ``Q``, ``f``, ``d`` (the latter 2 depending on the
11+
floating-point support).
12+
13+
Classes
14+
-------
15+
16+
.. class:: array.array(typecode, [iterable])
17+
18+
Create array with elements of given type. Initial contents of the
19+
array are given by *iterable*. If it is not provided, an empty
20+
array is created.
21+
22+
.. method:: append(val)
23+
24+
Append new element *val* to the end of array, growing it.
25+
26+
.. method:: extend(iterable)
27+
28+
Append new elements as contained in *iterable* to the end of
29+
array, growing it.
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
:mod:`btree` -- simple BTree database
2+
=====================================
3+
4+
.. module:: btree
5+
:synopsis: simple BTree database
6+
7+
The ``btree`` module implements a simple key-value database using external
8+
storage (disk files, or in general case, a random-access `stream`). Keys are
9+
stored sorted in the database, and besides efficient retrieval by a key
10+
value, a database also supports efficient ordered range scans (retrieval
11+
of values with the keys in a given range). On the application interface
12+
side, BTree database work as close a possible to a way standard `dict`
13+
type works, one notable difference is that both keys and values must
14+
be `bytes` objects (so, if you want to store objects of other types, you
15+
need to serialize them to `bytes` first).
16+
17+
The module is based on the well-known BerkelyDB library, version 1.xx.
18+
19+
Example::
20+
21+
import btree
22+
23+
# First, we need to open a stream which holds a database
24+
# This is usually a file, but can be in-memory database
25+
# using uio.BytesIO, a raw flash partition, etc.
26+
# Oftentimes, you want to create a database file if it doesn't
27+
# exist and open if it exists. Idiom below takes care of this.
28+
# DO NOT open database with "a+b" access mode.
29+
try:
30+
f = open("mydb", "r+b")
31+
except OSError:
32+
f = open("mydb", "w+b")
33+
34+
# Now open a database itself
35+
db = btree.open(f)
36+
37+
# The keys you add will be sorted internally in the database
38+
db[b"3"] = b"three"
39+
db[b"1"] = b"one"
40+
db[b"2"] = b"two"
41+
42+
# Assume that any changes are cached in memory unless
43+
# explicitly flushed (or database closed). Flush database
44+
# at the end of each "transaction".
45+
db.flush()
46+
47+
# Prints b'two'
48+
print(db[b"2"])
49+
50+
# Iterate over sorted keys in the database, starting from b"2"
51+
# until the end of the database, returning only values.
52+
# Mind that arguments passed to values() method are *key* values.
53+
# Prints:
54+
# b'two'
55+
# b'three'
56+
for word in db.values(b"2"):
57+
print(word)
58+
59+
del db[b"2"]
60+
61+
# No longer true, prints False
62+
print(b"2" in db)
63+
64+
# Prints:
65+
# b"1"
66+
# b"3"
67+
for key in db:
68+
print(key)
69+
70+
db.close()
71+
72+
# Don't forget to close the underlying stream!
73+
f.close()
74+
75+
76+
Functions
77+
---------
78+
79+
.. function:: open(stream, \*, flags=0, pagesize=0, cachesize=0, minkeypage=0)
80+
81+
Open a database from a random-access `stream` (like an open file). All
82+
other parameters are optional and keyword-only, and allow to tweak advanced
83+
parameters of the database operation (most users will not need them):
84+
85+
* *flags* - Currently unused.
86+
* *pagesize* - Page size used for the nodes in BTree. Acceptable range
87+
is 512-65536. If 0, a port-specific default will be used, optimized for
88+
port's memory usage and/or performance.
89+
* *cachesize* - Suggested memory cache size in bytes. For a
90+
board with enough memory using larger values may improve performance.
91+
Cache policy is as follows: entire cache is not allocated at once;
92+
instead, accessing a new page in database will allocate a memory buffer
93+
for it, until value specified by *cachesize* is reached. Then, these
94+
buffers will be managed using LRU (least recently used) policy. More
95+
buffers may still be allocated if needed (e.g., if a database contains
96+
big keys and/or values). Allocated cache buffers aren't reclaimed.
97+
* *minkeypage* - Minimum number of keys to store per page. Default value
98+
of 0 equivalent to 2.
99+
100+
Returns a BTree object, which implements a dictionary protocol (set
101+
of methods), and some additional methods described below.
102+
103+
Methods
104+
-------
105+
106+
.. method:: btree.close()
107+
108+
Close the database. It's mandatory to close the database at the end of
109+
processing, as some unwritten data may be still in the cache. Note that
110+
this does not close underlying stream with which the database was opened,
111+
it should be closed separately (which is also mandatory to make sure that
112+
data flushed from buffer to the underlying storage).
113+
114+
.. method:: btree.flush()
115+
116+
Flush any data in cache to the underlying stream.
117+
118+
.. method:: btree.__getitem__(key)
119+
btree.get(key, default=None)
120+
btree.__setitem__(key, val)
121+
btree.__detitem__(key)
122+
btree.__contains__(key)
123+
124+
Standard dictionary methods.
125+
126+
.. method:: btree.__iter__()
127+
128+
A BTree object can be iterated over directly (similar to a dictionary)
129+
to get access to all keys in order.
130+
131+
.. method:: btree.keys([start_key, [end_key, [flags]]])
132+
btree.values([start_key, [end_key, [flags]]])
133+
btree.items([start_key, [end_key, [flags]]])
134+
135+
These methods are similar to standard dictionary methods, but also can
136+
take optional parameters to iterate over a key sub-range, instead of
137+
the entire database. Note that for all 3 methods, *start_key* and
138+
*end_key* arguments represent key values. For example, `values()`
139+
method will iterate over values corresponding to they key range
140+
given. None values for *start_key* means "from the first key", no
141+
*end_key* or its value of None means "until the end of database".
142+
By default, range is inclusive of *start_key* and exclusive of
143+
*end_key*, you can include *end_key* in iteration by passing *flags*
144+
of `btree.INCL`. You can iterate in descending key direction
145+
by passing *flags* of `btree.DESC`. The flags values can be ORed
146+
together.
147+
148+
Constants
149+
---------
150+
151+
.. data:: INCL
152+
153+
A flag for `keys()`, `values()`, `items()` methods to specify that
154+
scanning should be inclusive of the end key.
155+
156+
.. data:: DESC
157+
158+
A flag for `keys()`, `values()`, `items()` methods to specify that
159+
scanning should be in descending direction of keys.

0 commit comments

Comments
 (0)