Skip to content

Commit

Permalink
Merge pull request adafruit#1906 from adafruit/4.0.x
Browse files Browse the repository at this point in the history
Merge in all bug fixes from 4.0.1 into master
  • Loading branch information
tannewt authored May 22, 2019
2 parents a888fe4 + 32b0f1c commit 63b253c
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ git:
# that SDK is shortest and add it there. In the case of major re-organizations,
# just try to make the builds "about equal in run time"
env:
- TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="circuitplayground_express mini_sam_m4 grandcentral_m4_express capablerobot_usbhub pca10056 pca10059 feather_nrf52840_express makerdiary_nrf52840_mdk makerdiary_nrf52840_mdk_usb_dongle particle_boron particle_argon particle_xenon sparkfun_nrf52840_mini electronut_labs_papyr" TRAVIS_SDK=arm:nrf
- TRAVIS_TESTS="unix docs translations website" TRAVIS_BOARDS="circuitplayground_express mini_sam_m4 grandcentral_m4_express capablerobot_usbhub pygamer pca10056 pca10059 feather_nrf52840_express makerdiary_nrf52840_mdk makerdiary_nrf52840_mdk_usb_dongle particle_boron particle_argon particle_xenon sparkfun_nrf52840_mini electronut_labs_papyr" TRAVIS_SDK=arm:nrf
- TRAVIS_BOARDS="metro_m0_express metro_m4_express metro_m4_airlift_lite pirkey_m0 trellis_m4_express trinket_m0 sparkfun_lumidrive sparkfun_redboard_turbo bast_pro_mini_m0" TRAVIS_SDK=arm
- TRAVIS_BOARDS="feather_radiofruit_zigbee gemma_m0 hallowing_m0_express itsybitsy_m0_express itsybitsy_m4_express meowmeow sam32 uchip escornabot_makech" TRAVIS_SDK=arm
- TRAVIS_BOARDS="feather_m0_express_crickit feather_m0_rfm69 feather_m0_rfm9x feather_m4_express arduino_zero arduino_mkr1300 arduino_mkrzero pewpew10 kicksat-sprite ugame10 robohatmm1" TRAVIS_SDK=arm
Expand Down
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ Behavior
output is written to ``boot_out.txt``.
- ``code.py`` (or ``main.py``) is run after every reload until it
finishes or is interrupted. After it is done running, the vm and
hardware is reinitialized. **This means you cannot read state from
``code.py`` in the REPL anymore.** CircuitPython's goal for this
hardware is reinitialized. **This means you cannot read state from**
``code.py`` **in the REPL anymore.** CircuitPython's goal for this
change includes reduce confusion about pins and memory being used.
- After ``code.py`` the REPL can be entered by pressing any key. It no
longer shares state with ``code.py`` so it is a fresh vm.
Expand All @@ -131,9 +131,9 @@ Behavior
``samd.disable_autoreload()``)
- Entering the REPL after the main code is finished requires a key press which enters the REPL and
disables autoreload.
- Main is one of these: ``code.txt``, **``code.py``**, ``main.py``,
- Main is one of these: ``code.txt``, ``code.py``, ``main.py``,
``main.txt``
- Boot is one of these: ``settings.txt``, ``settings.py``, **``boot.py``**,
- Boot is one of these: ``settings.txt``, ``settings.py``, ``boot.py``,
``boot.txt``

API
Expand Down
2 changes: 1 addition & 1 deletion frozen/circuitpython-stage
Submodule circuitpython-stage updated 1 files
+1 −1 stage.py
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
LD_FILE = boards/samd21x18-bootloader.ld
USB_VID = 0x239A
USB_PID = 0x8035
USB_PID = 0x8050
USB_PRODUCT = "Arduino MKRZero"
USB_MANUFACTURER = "Arduino"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_Thermistor

# Tweak inlining depending on language.
ifeq ($(TRANSLATION), zh_Latn_pinyin)
CFLAGS_INLINE_LIMIT = 35
CFLAGS_INLINE_LIMIT = 25
else
CFLAGS_INLINE_LIMIT = 55
endif
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/pybadge/mpconfigboard.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
LD_FILE = boards/samd51x19-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x802C
USB_PID = 0x8034
USB_PRODUCT = "PyBadge"
USB_MANUFACTURER = "Adafruit Industries LLC"

Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/pygamer/mpconfigboard.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
LD_FILE = boards/samd51x19-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x802E
USB_PID = 0x803E
USB_PRODUCT = "PyGamer"
USB_MANUFACTURER = "Adafruit Industries LLC"

Expand Down
2 changes: 1 addition & 1 deletion ports/atmel-samd/boards/pyportal/mpconfigboard.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
LD_FILE = boards/samd51x20-bootloader-external-flash.ld
USB_VID = 0x239A
USB_PID = 0x8032
USB_PID = 0x8036
USB_PRODUCT = "PyPortal"
USB_MANUFACTURER = "Adafruit Industries LLC"

Expand Down
1 change: 1 addition & 0 deletions py/circuitpy_mpconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
#define MICROPY_PY_BUILTINS_MIN_MAX (1)
#define MICROPY_PY_BUILTINS_PROPERTY (1)
#define MICROPY_PY_BUILTINS_REVERSED (1)
#define MICROPY_PY_BUILTINS_ROUND_INT (1)
#define MICROPY_PY_BUILTINS_SET (1)
#define MICROPY_PY_BUILTINS_SLICE (1)
#define MICROPY_PY_BUILTINS_SLICE_ATTRS (1)
Expand Down
6 changes: 3 additions & 3 deletions py/modbuiltins.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,13 @@ STATIC mp_obj_t mp_builtin_round(size_t n_args, const mp_obj_t *args) {
return o_in;
}

#if !MICROPY_PY_BUILTINS_ROUND_INT
mp_raise_NotImplementedError(NULL);
#else
mp_int_t num_dig = mp_obj_get_int(args[1]);
if (num_dig >= 0) {
return o_in;
}
#if !MICROPY_PY_BUILTINS_ROUND_INT
mp_raise_NotImplementedError(NULL);
#else

mp_obj_t mult = mp_binary_op(MP_BINARY_OP_POWER, MP_OBJ_NEW_SMALL_INT(10), MP_OBJ_NEW_SMALL_INT(-num_dig));
mp_obj_t half_mult = mp_binary_op(MP_BINARY_OP_FLOOR_DIVIDE, mult, MP_OBJ_NEW_SMALL_INT(2));
Expand Down

0 comments on commit 63b253c

Please sign in to comment.