Skip to content

Commit db2b377

Browse files
committed
Merge remote-tracking branch 'upstream/master' into esp32
2 parents 06b89b7 + 9ae0713 commit db2b377

File tree

334 files changed

+1784
-993
lines changed

Some content is hidden

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

334 files changed

+1784
-993
lines changed

CODECONVENTIONS.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,27 @@ require such detailed description.
2626
To get good practical examples of good commits and their messages, browse
2727
the `git log` of the project.
2828

29+
MicroPython doesn't require explicit sign-off for patches ("Signed-off-by"
30+
lines and similar). Instead, the commit message, and your name and email
31+
address on it construes your sign-off of the following:
32+
33+
* That you wrote the change yourself, or took it from a project with
34+
a compatible license (in the latter case the commit message, and possibly
35+
source code should provide reference where the implementation was taken
36+
from and give credit to the original author, as required by the license).
37+
* That you are allowed to release these changes to an open-source project
38+
(for example, changes done during paid work for a third party may require
39+
explicit approval from that third party).
40+
* That you (or your employer) agree to release the changes under
41+
MicroPython's license, which is the MIT license. Note that you retain
42+
copyright for your changes (for smaller changes, the commit message
43+
conveys your copyright; if you make significant changes to a particular
44+
source module, you're welcome to add your name to the file header).
45+
* Your signature for all of the above, which is the 'Author' line in
46+
the commit message, and which should include your full real name and
47+
a valid and active email address by which you can be contacted in the
48+
foreseeable future.
49+
2950
Python code conventions
3051
=======================
3152

cc3200/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ If `WIPY_IP`, `WIPY_USER` or `WIPY_PWD` are omitted the default values (the ones
138138
## Regarding old revisions of the CC3200-LAUNCHXL
139139

140140
First silicon (pre-release) revisions of the CC3200 had issues with the ram blocks, and MicroPython cannot run
141-
there. Make sure to use a **v4.1 (or higer) LAUNCHXL board** when trying this port, otherwise it won't work.
141+
there. Make sure to use a **v4.1 (or higher) LAUNCHXL board** when trying this port, otherwise it won't work.
142142

143143
### Note regarding FileZilla
144144

cc3200/application.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,12 @@ APP_LIB_SRC_C = $(addprefix lib/,\
147147
netutils/netutils.c \
148148
timeutils/timeutils.c \
149149
utils/pyexec.c \
150+
utils/sys_stdio_mphal.c \
150151
)
151152

152153
APP_STM_SRC_C = $(addprefix stmhal/,\
153154
bufhelper.c \
154-
input.c \
155155
irq.c \
156-
pybstdio.c \
157156
)
158157

159158
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(APP_FATFS_SRC_C:.c=.o) $(APP_RTOS_SRC_C:.c=.o) $(APP_FTP_SRC_C:.c=.o) $(APP_HAL_SRC_C:.c=.o) $(APP_MISC_SRC_C:.c=.o))

cc3200/mods/modusocket.c

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -643,17 +643,8 @@ STATIC mp_obj_t socket_setblocking(mp_obj_t self_in, mp_obj_t blocking) {
643643
STATIC MP_DEFINE_CONST_FUN_OBJ_2(socket_setblocking_obj, socket_setblocking);
644644

645645
STATIC mp_obj_t socket_makefile(mp_uint_t n_args, const mp_obj_t *args) {
646-
// TODO: CPython explicitly says that closing the returned object doesn't
647-
// close the original socket (Python2 at all says that fd is dup()ed). But
648-
// we save on the bloat.
649-
mod_network_socket_obj_t *self = args[0];
650-
if (n_args > 1) {
651-
const char *mode = mp_obj_str_get_str(args[1]);
652-
if (strcmp(mode, "rb") && strcmp(mode, "wb")) {
653-
mp_raise_ValueError(mpexception_value_invalid_arguments);
654-
}
655-
}
656-
return self;
646+
(void)n_args;
647+
return args[0];
657648
}
658649
STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(socket_makefile_obj, 1, 6, socket_makefile);
659650

cc3200/mpconfigport.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
#define MICROPY_VFS_FAT (1)
8181
#define MICROPY_PY_ASYNC_AWAIT (0)
8282
#define MICROPY_PY_ALL_SPECIAL_METHODS (1)
83+
#define MICROPY_PY_BUILTINS_INPUT (1)
8384
#define MICROPY_PY_BUILTINS_HELP (1)
8485
#define MICROPY_PY_BUILTINS_HELP_TEXT cc3200_help_text
8586
#ifndef DEBUG
@@ -142,7 +143,6 @@
142143

143144
// extra built in names to add to the global namespace
144145
#define MICROPY_PORT_BUILTINS \
145-
{ MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \
146146
{ MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, \
147147

148148
// extra built in modules to add to the list of known ones

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,9 @@
9797
# built documents.
9898
#
9999
# The short X.Y version.
100-
version = '1.8'
100+
version = '1.9'
101101
# The full version, including alpha/beta/rc tags.
102-
release = '1.8.7'
102+
release = '1.9.1'
103103

104104
# The language for content autogenerated by Sphinx. Refer to documentation
105105
# for a list of supported languages.

docs/esp8266/quickref.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ Use the :ref:`machine.Pin <machine.Pin>` class::
107107
from machine import Pin
108108

109109
p0 = Pin(0, Pin.OUT) # create output pin on GPIO0
110-
p0.high() # set pin to high
111-
p0.low() # set pin to low
112-
p0.value(1) # set pin to high
110+
p0.on() # set pin to "on" (high) level
111+
p0.off() # set pin to "off" (low) level
112+
p0.value(1) # set pin to on/high
113113

114114
p2 = Pin(2, Pin.IN) # create input pin on GPIO2
115115
print(p2.value()) # get value, 0 or 1

docs/esp8266/tutorial/pins.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Then set its value using::
3535

3636
Or::
3737

38-
>>> pin.low()
39-
>>> pin.high()
38+
>>> pin.off()
39+
>>> pin.on()
4040

4141
External interrupts
4242
-------------------

docs/esp8266/tutorial/repl.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ turn it on and off using the following code::
101101

102102
>>> import machine
103103
>>> pin = machine.Pin(2, machine.Pin.OUT)
104-
>>> pin.high()
105-
>>> pin.low()
104+
>>> pin.on()
105+
>>> pin.off()
106106

107-
Note that ``high`` might turn the LED off and ``low`` might turn it on (or vice
108-
versa), depending on how the LED is wired on your board.
107+
Note that ``on`` method of a Pin might turn the LED off and ``off`` might
108+
turn it on (or vice versa), depending on how the LED is wired on your board.
109+
To resolve this, machine.Signal class is provided.
109110

110111
Line editing
111112
~~~~~~~~~~~~

docs/library/btree.rst

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@ Example::
2222

2323
# First, we need to open a stream which holds a database
2424
# This is usually a file, but can be in-memory database
25-
# using uio.BytesIO, a raw flash section, etc.
26-
f = open("mydb", "w+b")
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")
2733

2834
# Now open a database itself
2935
db = btree.open(f)
@@ -33,6 +39,11 @@ Example::
3339
db[b"1"] = b"one"
3440
db[b"2"] = b"two"
3541

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+
3647
# Prints b'two'
3748
print(db[b"2"])
3849

@@ -69,7 +80,7 @@ Functions
6980

7081
Open a database from a random-access `stream` (like an open file). All
7182
other parameters are optional and keyword-only, and allow to tweak advanced
72-
paramters of the database operation (most users will not need them):
83+
parameters of the database operation (most users will not need them):
7384

7485
* `flags` - Currently unused.
7586
* `cachesize` - Suggested maximum memory cache size in bytes. For a
@@ -92,7 +103,7 @@ Methods
92103

93104
Close the database. It's mandatory to close the database at the end of
94105
processing, as some unwritten data may be still in the cache. Note that
95-
this does not close underlying streamw with which the database was opened,
106+
this does not close underlying stream with which the database was opened,
96107
it should be closed separately (which is also mandatory to make sure that
97108
data flushed from buffer to the underlying storage).
98109

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy