Skip to content

Commit 360243a

Browse files
committed
Merge branch 'master' into nrf5_no_sdk
2 parents 5d06aa3 + b87432b commit 360243a

216 files changed

Lines changed: 2753 additions & 1985 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.

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
[![Build Status][travis-img]][travis-repo] [![Coverage Status][coveralls-img]][coveralls-repo]
2-
[travis-img]: https://travis-ci.org/micropython/micropython.png?branch=master
3-
[travis-repo]: https://travis-ci.org/micropython/micropython
4-
[coveralls-img]: https://coveralls.io/repos/micropython/micropython/badge.png?branch=master
5-
[coveralls-repo]: https://coveralls.io/r/micropython/micropython?branch=master
1+
[![Build Status](https://travis-ci.org/micropython/micropython.png?branch=master)](https://travis-ci.org/micropython/micropython) [![Coverage Status](https://coveralls.io/repos/micropython/micropython/badge.png?branch=master)](https://coveralls.io/r/micropython/micropython?branch=master)
62

73
The MicroPython project
84
=======================
@@ -38,7 +34,9 @@ Major components in this repository:
3834
- minimal/ -- a minimal MicroPython port. Start with this if you want
3935
to port MicroPython to another microcontroller.
4036
- tests/ -- test framework and test scripts.
41-
- docs/ -- user documentation in Sphinx reStructuredText format.
37+
- docs/ -- user documentation in Sphinx reStructuredText format. Rendered
38+
HTML documentation is available at http://docs.micropython.org (be sure
39+
to select needed board/port at the bottom left corner).
4240

4341
Additional components:
4442
- bare-arm/ -- a bare minimum version of MicroPython for ARM MCUs. Used
@@ -48,6 +46,7 @@ Additional components:
4846
- pic16bit/ -- a version of MicroPython for 16-bit PIC microcontrollers.
4947
- cc3200/ -- a version of MicroPython that runs on the CC3200 from TI.
5048
- esp8266/ -- an experimental port for ESP8266 WiFi modules.
49+
- extmod/ -- additional (non-core) modules implemented in C.
5150
- tools/ -- various tools, including the pyboard.py module.
5251
- examples/ -- a few example Python scripts.
5352

bare-arm/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ INC += -I..
1313
INC += -I$(BUILD)
1414

1515
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion
16-
CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT)
16+
CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT)
1717

1818
#Debugging/Optimization
1919
ifeq ($(DEBUG), 1)

bare-arm/mpconfigport.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646

4747
// type definitions for the specific machine
4848

49-
#define BYTES_PER_WORD (4)
50-
5149
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void*)((mp_uint_t)(p) | 1))
5250

5351
#define UINT_FMT "%lu"

cc3200/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ include ../py/mkenv.mk
2020
CROSS_COMPILE ?= arm-none-eabi-
2121

2222
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -march=armv7e-m -mabi=aapcs -mcpu=cortex-m4 -msoft-float -mfloat-abi=soft -fsingle-precision-constant -Wdouble-promotion
23-
CFLAGS = -Wall -Wpointer-arith -Werror -ansi -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4) -Os
23+
CFLAGS = -Wall -Wpointer-arith -Werror -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4) -Os
2424
CFLAGS += -g -ffunction-sections -fdata-sections -fno-common -fsigned-char -mno-unaligned-access
2525
CFLAGS += -Iboards/$(BOARD)
2626
CFLAGS += $(CFLAGS_MOD)

cc3200/application.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ APP_INC += -Iutil
1818
APP_INC += -Ibootmgr
1919
APP_INC += -I$(BUILD)
2020
APP_INC += -I$(BUILD)/genhdr
21-
APP_INC += -I../lib/mp-readline
22-
APP_INC += -I../lib/netutils
23-
APP_INC += -I../lib/timeutils
2421
APP_INC += -I../stmhal
2522

2623
APP_CPPDEFINES = -Dgcc -DTARGET_IS_CC3200 -DSL_FULL -DUSE_FREERTOS

cc3200/ftp/ftp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#include "py/mpstate.h"
3131
#include "py/obj.h"
32+
#include "lib/timeutils/timeutils.h"
3233
#include "lib/oofatfs/ff.h"
3334
#include "extmod/vfs.h"
3435
#include "extmod/vfs_fat.h"
@@ -48,7 +49,6 @@
4849
#include "fifo.h"
4950
#include "socketfifo.h"
5051
#include "updater.h"
51-
#include "timeutils.h"
5252
#include "moduos.h"
5353

5454
/******************************************************************************

cc3200/mods/modmachine.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(machine_info_obj, 0, 1, machine_info)
111111
#endif
112112

113113
STATIC mp_obj_t machine_freq(void) {
114-
mp_obj_t tuple[1] = {
115-
mp_obj_new_int(HAL_FCPU_HZ),
116-
};
117-
return mp_obj_new_tuple(1, tuple);
114+
return mp_obj_new_int(HAL_FCPU_HZ);
118115
}
119116
STATIC MP_DEFINE_CONST_FUN_OBJ_0(machine_freq_obj, machine_freq);
120117

cc3200/mods/moduos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "py/objtuple.h"
3434
#include "py/objstr.h"
3535
#include "py/runtime.h"
36+
#include "lib/timeutils/timeutils.h"
3637
#include "lib/oofatfs/ff.h"
3738
#include "lib/oofatfs/diskio.h"
3839
#include "genhdr/mpversion.h"
@@ -43,7 +44,6 @@
4344
#include "random.h"
4445
#include "mpexception.h"
4546
#include "version.h"
46-
#include "timeutils.h"
4747
#include "pybsd.h"
4848
#include "pybuart.h"
4949

cc3200/mods/modusocket.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#include "py/objstr.h"
3535
#include "py/runtime.h"
3636
#include "py/stream.h"
37-
#include "netutils.h"
37+
#include "lib/netutils/netutils.h"
3838
#include "modnetwork.h"
3939
#include "modusocket.h"
4040
#include "mpexception.h"
@@ -737,7 +737,7 @@ STATIC const mp_obj_type_t socket_type = {
737737
// function usocket.getaddrinfo(host, port)
738738
/// \function getaddrinfo(host, port)
739739
STATIC mp_obj_t mod_usocket_getaddrinfo(mp_obj_t host_in, mp_obj_t port_in) {
740-
mp_uint_t hlen;
740+
size_t hlen;
741741
const char *host = mp_obj_str_get_data(host_in, &hlen);
742742
mp_int_t port = mp_obj_get_int(port_in);
743743

cc3200/mods/modutime.c

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
#include "py/obj.h"
3434
#include "py/smallint.h"
3535
#include "py/mphal.h"
36+
#include "lib/timeutils/timeutils.h"
3637
#include "extmod/utime_mphal.h"
37-
#include "timeutils.h"
3838
#include "inc/hw_types.h"
3939
#include "inc/hw_ints.h"
4040
#include "inc/hw_memmap.h"
@@ -102,7 +102,7 @@ STATIC mp_obj_t time_localtime(mp_uint_t n_args, const mp_obj_t *args) {
102102
MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(time_localtime_obj, 0, 1, time_localtime);
103103

104104
STATIC mp_obj_t time_mktime(mp_obj_t tuple) {
105-
mp_uint_t len;
105+
size_t len;
106106
mp_obj_t *elem;
107107

108108
mp_obj_get_array(tuple, &len, &elem);
@@ -131,24 +131,6 @@ STATIC mp_obj_t time_sleep(mp_obj_t seconds_o) {
131131
}
132132
MP_DEFINE_CONST_FUN_OBJ_1(time_sleep_obj, time_sleep);
133133

134-
STATIC mp_obj_t time_sleep_ms (mp_obj_t ms_in) {
135-
mp_int_t ms = mp_obj_get_int(ms_in);
136-
if (ms > 0) {
137-
mp_hal_delay_ms(ms);
138-
}
139-
return mp_const_none;
140-
}
141-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(time_sleep_ms_obj, time_sleep_ms);
142-
143-
STATIC mp_obj_t time_sleep_us (mp_obj_t usec_in) {
144-
mp_int_t usec = mp_obj_get_int(usec_in);
145-
if (usec > 0) {
146-
mp_hal_delay_us(usec);
147-
}
148-
return mp_const_none;
149-
}
150-
STATIC MP_DEFINE_CONST_FUN_OBJ_1(time_sleep_us_obj, time_sleep_us);
151-
152134
STATIC const mp_map_elem_t time_module_globals_table[] = {
153135
{ MP_OBJ_NEW_QSTR(MP_QSTR___name__), MP_OBJ_NEW_QSTR(MP_QSTR_utime) },
154136

@@ -158,8 +140,8 @@ STATIC const mp_map_elem_t time_module_globals_table[] = {
158140
{ MP_OBJ_NEW_QSTR(MP_QSTR_sleep), (mp_obj_t)&time_sleep_obj },
159141

160142
// MicroPython additions
161-
{ MP_OBJ_NEW_QSTR(MP_QSTR_sleep_ms), (mp_obj_t)&time_sleep_ms_obj },
162-
{ MP_OBJ_NEW_QSTR(MP_QSTR_sleep_us), (mp_obj_t)&time_sleep_us_obj },
143+
{ MP_OBJ_NEW_QSTR(MP_QSTR_sleep_ms), (mp_obj_t)&mp_utime_sleep_ms_obj },
144+
{ MP_OBJ_NEW_QSTR(MP_QSTR_sleep_us), (mp_obj_t)&mp_utime_sleep_us_obj },
163145
{ MP_OBJ_NEW_QSTR(MP_QSTR_ticks_ms), (mp_obj_t)&mp_utime_ticks_ms_obj },
164146
{ MP_OBJ_NEW_QSTR(MP_QSTR_ticks_us), (mp_obj_t)&mp_utime_ticks_us_obj },
165147
{ MP_OBJ_NEW_QSTR(MP_QSTR_ticks_cpu), (mp_obj_t)&mp_utime_ticks_cpu_obj },

0 commit comments

Comments
 (0)