Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit 45e4115

Browse files
committed
Merge remote-tracking branch 'upstream/master' into esp32
2 parents 3c4e026 + 1ed3356 commit 45e4115

File tree

448 files changed

+7176
-2442
lines changed

Some content is hidden

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

448 files changed

+7176
-2442
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*.dis
1010
*.exe
1111

12-
# Packages
12+
# Packages
1313
############
1414

1515
# Logs and Databases

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ script:
4040
- make -C qemu-arm test
4141
- make -C stmhal
4242
- make -C stmhal BOARD=PYBV11 MICROPY_PY_WIZNET5K=1 MICROPY_PY_CC3K=1
43-
- make -C stmhal BOARD=STM32F7DISC
43+
- make -C stmhal BOARD=STM32F769DISC
4444
- make -C stmhal BOARD=STM32L476DISC
4545
- make -C teensy
4646
- make -C cc3200 BTARGET=application BTYPE=release

CODECONVENTIONS.md

+74-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ White space:
7373
keyword and the opening parenthesis.
7474
- Put 1 space after a comma, and 1 space around operators.
7575

76-
Braces:
76+
Braces:
7777
- Use braces for all blocks, even no-line and single-line pieces of
7878
code.
7979
- Put opening braces on the end of the line it belongs to, not on
@@ -135,3 +135,76 @@ Type declarations:
135135
int member;
136136
void *data;
137137
} my_struct_t;
138+
139+
Documentation conventions
140+
=========================
141+
142+
MicroPython generally follows CPython in documentation process and
143+
conventions. reStructuredText syntax is used for the documention.
144+
145+
Specific conventions/suggestions:
146+
147+
* Use `*` markup to refer to arguments of a function, e.g.:
148+
149+
```
150+
.. method:: poll.unregister(obj)
151+
152+
Unregister *obj* from polling.
153+
```
154+
155+
* Use following syntax for cross-references/cross-links:
156+
157+
```
158+
:func:`foo` - function foo in current module
159+
:func:`module1.foo` - function foo in module "module1"
160+
(similarly for other referent types)
161+
:class:`Foo` - class Foo
162+
:meth:`Class.method1` - method1 in Class
163+
:meth:`~Class.method1` - method1 in Class, but rendered just as "method1()",
164+
not "Class.method1()"
165+
:meth:`title <method1>` - reference method1, but render as "title" (use only
166+
if really needed)
167+
:mod:`module1` - module module1
168+
169+
`symbol` - generic xref syntax which can replace any of the above in case
170+
the xref is unambiguous. If there's ambiguity, there will be a warning
171+
during docs generation, which need to be fixed using one of the syntaxes
172+
above
173+
```
174+
175+
* Cross-referencing arbitrary locations
176+
~~~
177+
.. _xref_target:
178+
179+
Normal non-indented text.
180+
181+
This is :ref:`reference <xref_target>`.
182+
183+
(If xref target is followed by section title, can be just
184+
:ref:`xref_target`).
185+
~~~
186+
187+
* Linking to external URL:
188+
```
189+
`link text <http://foo.com/...>`_
190+
```
191+
192+
* Referencing builtin singleton objects:
193+
```
194+
``None``, ``True``, ``False``
195+
```
196+
197+
* Use following syntax to create common description for more than one element:
198+
~~~
199+
.. function:: foo(x)
200+
bar(y)
201+
202+
Description common to foo() and bar().
203+
~~~
204+
205+
206+
More detailed guides and quickrefs:
207+
208+
* http://www.sphinx-doc.org/en/stable/rest.html
209+
* http://www.sphinx-doc.org/en/stable/markup/inline.html
210+
* http://docutils.sourceforge.net/docs/user/rst/quickref.html

README.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,18 @@ Builtin modules include `sys`, `time`, and `struct`, etc. Select ports have
4747
support for `_thread` module (multithreading). Note that only a subset of
4848
Python 3 functionality is implemented for the data types and modules.
4949

50-
See the repository www.github.com/micropython/pyboard for the MicroPython
50+
MicroPython can execute scripts in textual source form or from precompiled
51+
bytecode, in both cases either from an on-device filesystem or "frozen" into
52+
the MicroPython executable.
53+
54+
See the repository http://github.com/micropython/pyboard for the MicroPython
5155
board (PyBoard), the officially supported reference electronic circuit board.
5256

5357
Major components in this repository:
5458
- py/ -- the core Python implementation, including compiler, runtime, and
5559
core library.
60+
- mpy-cross/ -- the MicroPython cross-compiler which is used to turn scripts
61+
into precompiled bytecode.
5662
- unix/ -- a version of MicroPython that runs on Unix.
5763
- stmhal/ -- a version of MicroPython that runs on the PyBoard and similar
5864
STM32 boards (using ST's Cube HAL drivers).

bare-arm/stm32f405.ld

+5-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ MEMORY
1111
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 0x010000 /* 64 KiB */
1212
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x020000 /* 128 KiB */
1313
}
14-
14+
1515
/* top end of the stack */
1616
_estack = ORIGIN(RAM) + LENGTH(RAM);
1717

@@ -30,7 +30,7 @@ SECTIONS
3030

3131
. = ALIGN(4);
3232
} >FLASH_ISR
33-
33+
3434
/* The program code and other data goes into FLASH */
3535
.text :
3636
{
@@ -46,7 +46,7 @@ SECTIONS
4646
_etext = .; /* define a global symbol at end of code */
4747
_sidata = _etext; /* This is used by the startup in order to initialize the .data secion */
4848
} >FLASH_TEXT
49-
49+
5050
/*
5151
.ARM.extab :
5252
{
@@ -60,7 +60,7 @@ SECTIONS
6060
__exidx_end = .;
6161
} >FLASH
6262
*/
63-
63+
6464
/* This is the initialized data section
6565
The program executes knowing that the data is in the RAM
6666
but the loader puts the initial values in the FLASH (inidata).
@@ -76,7 +76,7 @@ SECTIONS
7676
. = ALIGN(4);
7777
_edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
7878
} >RAM
79-
79+
8080
/* Uninitialized data section */
8181
.bss :
8282
{

cc3200/bootmgr/bootmgr.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26-
27-
#ifndef __BOOTMGR_H__
28-
#define __BOOTMGR_H__
26+
#ifndef MICROPY_INCLUDED_CC3200_BOOTMGR_BOOTMGR_H
27+
#define MICROPY_INCLUDED_CC3200_BOOTMGR_BOOTMGR_H
2928

3029
//****************************************************************************
3130
//
@@ -66,4 +65,4 @@ extern void Run(unsigned long);
6665
}
6766
#endif
6867

69-
#endif //__BOOTMGR_H__
68+
#endif // MICROPY_INCLUDED_CC3200_BOOTMGR_BOOTMGR_H

cc3200/bootmgr/flc.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26-
27-
#ifndef __FLC_H__
28-
#define __FLC_H__
26+
#ifndef MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H
27+
#define MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H
2928

3029
/******************************************************************************
3130
@@ -93,4 +92,4 @@ typedef struct _sBootInfo_t
9392
}
9493
#endif
9594

96-
#endif /* __FLC_H__ */
95+
#endif // MICROPY_INCLUDED_CC3200_BOOTMGR_FLC_H

cc3200/ftp/ftp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ void ftp_run (void) {
335335
ftp_data.loggin.uservalid = false;
336336
ftp_data.loggin.passvalid = false;
337337
strcpy (ftp_path, "/");
338-
ftp_send_reply (220, "Micropython FTP Server");
338+
ftp_send_reply (220, "MicroPython FTP Server");
339339
break;
340340
}
341341
}

cc3200/ftp/ftp.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26-
27-
#ifndef FTP_H_
28-
#define FTP_H_
26+
#ifndef MICROPY_INCLUDED_CC3200_FTP_FTP_H
27+
#define MICROPY_INCLUDED_CC3200_FTP_FTP_H
2928

3029
/******************************************************************************
3130
DECLARE EXPORTED FUNCTIONS
@@ -36,4 +35,4 @@ extern void ftp_enable (void);
3635
extern void ftp_disable (void);
3736
extern void ftp_reset (void);
3837

39-
#endif /* FTP_H_ */
38+
#endif // MICROPY_INCLUDED_CC3200_FTP_FTP_H

cc3200/ftp/updater.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26-
27-
28-
#ifndef UPDATER_H_
29-
#define UPDATER_H_
26+
#ifndef MICROPY_INCLUDED_CC3200_FTP_UPDATER_H
27+
#define MICROPY_INCLUDED_CC3200_FTP_UPDATER_H
3028

3129
extern void updater_pre_init (void);
3230
extern bool updater_check_path (void *path);
@@ -35,4 +33,4 @@ extern bool updater_write (uint8_t *buf, uint32_t len);
3533
extern void updater_finnish (void);
3634
extern bool updater_verify (uint8_t *rbuff, uint8_t *hasbuff);
3735

38-
#endif /* UPDATER_H_ */
36+
#endif // MICROPY_INCLUDED_CC3200_FTP_UPDATER_H

cc3200/hal/cc3200_hal.h

-5
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
* THE SOFTWARE.
2525
*/
2626

27-
#ifndef CC3200_LAUNCHXL_HAL_CC3200_HAL_H_
28-
#define CC3200_LAUNCHXL_HAL_CC3200_HAL_H_
29-
3027
#include <stdint.h>
3128
#include <stdbool.h>
3229

@@ -69,5 +66,3 @@ extern void mp_hal_set_interrupt_char (int c);
6966

7067
#define mp_hal_delay_us(usec) UtilsDelay(UTILS_DELAY_US_TO_COUNT(usec))
7168
#define mp_hal_ticks_cpu() (SysTickPeriodGet() - SysTickValueGet())
72-
73-
#endif /* CC3200_LAUNCHXL_HAL_CC3200_HAL_H_ */

cc3200/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int main (void) {
8989
#ifndef DEBUG
9090
OsiTaskHandle mpTaskHandle;
9191
#endif
92-
mpTaskHandle = xTaskCreateStatic(TASK_Micropython, "MicroPy",
92+
mpTaskHandle = xTaskCreateStatic(TASK_MicroPython, "MicroPy",
9393
MICROPY_TASK_STACK_LEN, NULL, MICROPY_TASK_PRIORITY, mpTaskStack, &mpTaskTCB);
9494
ASSERT(mpTaskHandle != NULL);
9595

cc3200/misc/antenna.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26-
27-
#ifndef _ANTENNA_H_
28-
#define _ANTENNA_H_
26+
#ifndef MICROPY_INCLUDED_CC3200_MISC_ANTENNA_H
27+
#define MICROPY_INCLUDED_CC3200_MISC_ANTENNA_H
2928

3029
typedef enum {
3130
ANTENNA_TYPE_INTERNAL = 0,
@@ -35,4 +34,4 @@ typedef enum {
3534
extern void antenna_init0 (void);
3635
extern void antenna_select (antenna_type_t antenna_type);
3736

38-
#endif /* _ANTENNA_H_ */
37+
#endif // MICROPY_INCLUDED_CC3200_MISC_ANTENNA_H

cc3200/misc/mperror.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2525
* THE SOFTWARE.
2626
*/
27-
28-
#ifndef MPERROR_H_
29-
#define MPERROR_H_
27+
#ifndef MICROPY_INCLUDED_CC3200_MISC_MPERROR_H
28+
#define MICROPY_INCLUDED_CC3200_MISC_MPERROR_H
3029

3130
extern void NORETURN __fatal_error(const char *msg);
3231

@@ -39,4 +38,4 @@ void mperror_heartbeat_signal (void);
3938
void mperror_enable_heartbeat (bool enable);
4039
bool mperror_is_heartbeat_enabled (void);
4140

42-
#endif // MPERROR_H_
41+
#endif // MICROPY_INCLUDED_CC3200_MISC_MPERROR_H

cc3200/misc/mpexception.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2525
* THE SOFTWARE.
2626
*/
27-
28-
#ifndef MPEXCEPTION_H_
29-
#define MPEXCEPTION_H_
27+
#ifndef MICROPY_INCLUDED_CC3200_MISC_MPEXCEPTION_H
28+
#define MICROPY_INCLUDED_CC3200_MISC_MPEXCEPTION_H
3029

3130
extern const char mpexception_value_invalid_arguments[];
3231
extern const char mpexception_num_type_invalid_arguments[];
@@ -40,4 +39,4 @@ extern void mpexception_set_interrupt_char (int c);
4039
extern void mpexception_nlr_jump (void *o);
4140
extern void mpexception_keyboard_nlr_jump (void);
4241

43-
#endif /* MPEXCEPTION_H_ */
42+
#endif // MICROPY_INCLUDED_CC3200_MISC_MPEXCEPTION_H

cc3200/misc/mpirq.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26-
27-
#ifndef MPIRQ_H_
28-
#define MPIRQ_H_
26+
#ifndef MICROPY_INCLUDED_CC3200_MISC_MPIRQ_H
27+
#define MICROPY_INCLUDED_CC3200_MISC_MPIRQ_H
2928

3029
/******************************************************************************
3130
DEFINE CONSTANTS
@@ -72,4 +71,4 @@ void mp_irq_remove (const mp_obj_t parent);
7271
void mp_irq_handler (mp_obj_t self_in);
7372
uint mp_irq_translate_priority (uint priority);
7473

75-
#endif /* MPIRQ_H_ */
74+
#endif // MICROPY_INCLUDED_CC3200_MISC_MPIRQ_H

cc3200/mods/modnetwork.h

+4-5
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@
2424
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2525
* THE SOFTWARE.
2626
*/
27-
28-
#ifndef MODNETWORK_H_
29-
#define MODNETWORK_H_
27+
#ifndef MICROPY_INCLUDED_CC3200_MODS_MODNETWORK_H
28+
#define MICROPY_INCLUDED_CC3200_MODS_MODNETWORK_H
3029

3130
/******************************************************************************
3231
DEFINE CONSTANTS
@@ -52,7 +51,7 @@ typedef struct _mod_network_socket_base_t {
5251
} u_param;
5352
int16_t sd;
5453
};
55-
bool has_timeout;
54+
uint32_t timeout_ms; // 0 for no timeout
5655
bool cert_req;
5756
} mod_network_socket_base_t;
5857

@@ -71,4 +70,4 @@ extern const mod_network_nic_type_t mod_network_nic_type_wlan;
7170
******************************************************************************/
7271
void mod_network_init0(void);
7372

74-
#endif // MODNETWORK_H_
73+
#endif // MICROPY_INCLUDED_CC3200_MODS_MODNETWORK_H

cc3200/mods/modubinascii.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2424
* THE SOFTWARE.
2525
*/
26+
#ifndef MICROPY_INCLUDED_CC3200_MODS_MODUBINASCII_H
27+
#define MICROPY_INCLUDED_CC3200_MODS_MODUBINASCII_H
2628

27-
#ifndef MODUBINASCII_H_
28-
#define MODUBINASCII_H_
2929

30-
31-
#endif /* MODUBINASCII_H_ */
30+
#endif // MICROPY_INCLUDED_CC3200_MODS_MODUBINASCII_H

0 commit comments

Comments
 (0)