diff options
| author | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-06-20 10:56:05 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott.shawcroft@gmail.com> | 2017-06-20 10:56:05 -0700 |
| commit | 30ee7019ca651bce1fe966c1089fe977d51dc92b (patch) | |
| tree | 0114b6f744dd175b7722dd8edcbe24f4ee84bb45 /cc3200/misc | |
| parent | 97fcdfbd08c922efd7470d6482d7c7c703ffc0ae (diff) | |
| parent | 869cdcfdfc860b1177baf9b0f8818915ba54f3f5 (diff) | |
Merge tag 'v1.9.1'2.0.0-alpha.0
Fixes for stmhal USB mass storage, lwIP bindings and VFS regressions
This release provides an important fix for the USB mass storage device in
the stmhal port by implementing the SCSI SYNCHRONIZE_CACHE command, which
is now require by some Operating Systems. There are also fixes for the
lwIP bindings to improve non-blocking sockets and error codes. The VFS has
some regressions fixed including the ability to statvfs the root.
All changes are listed below.
py core:
- modbuiltins: add core-provided version of input() function
- objstr: catch case of negative "maxsplit" arg to str.rsplit()
- persistentcode: allow to compile with complex numbers disabled
- objstr: allow to compile with obj-repr D, and unicode disabled
- modsys: allow to compile with obj-repr D and PY_ATTRTUPLE disabled
- provide mp_decode_uint_skip() to help reduce stack usage
- makeqstrdefs.py: make script run correctly with Python 2.6
- objstringio: if created from immutable object, follow copy on write policy
extmod:
- modlwip: connect: for non-blocking mode, return EINPROGRESS
- modlwip: fix error codes for duplicate calls to connect()
- modlwip: accept: fix error code for non-blocking mode
- vfs: allow to statvfs the root directory
- vfs: allow "buffering" and "encoding" args to VFS's open()
- modframebuf: fix signed/unsigned comparison pendantic warning
lib:
- libm: use isfinite instead of finitef, for C99 compatibility
- utils/interrupt_char: remove support for KBD_EXCEPTION disabled
tests:
- basics/string_rsplit: add tests for negative "maxsplit" argument
- float: convert "sys.exit()" to "raise SystemExit"
- float/builtin_float_minmax: PEP8 fixes
- basics: convert "sys.exit()" to "raise SystemExit"
- convert remaining "sys.exit()" to "raise SystemExit"
unix port:
- convert to use core-provided version of built-in import()
- Makefile: replace references to make with $(MAKE)
windows port:
- convert to use core-provided version of built-in import()
qemu-arm port:
- Makefile: adjust object-file lists to get correct dependencies
- enable micropython.mem_*() functions to allow more tests
stmhal port:
- boards: enable DAC for NUCLEO_F767ZI board
- add support for NUCLEO_F446RE board
- pass USB handler as parameter to allow more than one USB handler
- usb: use local USB handler variable in Start-of-Frame handler
- usb: make state for USB device private to top-level USB driver
- usbdev: for MSC implement SCSI SYNCHRONIZE_CACHE command
- convert from using stmhal's input() to core provided version
cc3200 port:
- convert from using stmhal's input() to core provided version
teensy port:
- convert from using stmhal's input() to core provided version
esp8266 port:
- Makefile: replace references to make with $(MAKE)
- Makefile: add clean-modules target
- convert from using stmhal's input() to core provided version
zephyr port:
- modusocket: getaddrinfo: Fix mp_obj_len() usage
- define MICROPY_PY_SYS_PLATFORM (to "zephyr")
- machine_pin: use native Zephyr types for Zephyr API calls
docs:
- machine.Pin: remove out_value() method
- machine.Pin: add on() and off() methods
- esp8266: consistently replace Pin.high/low methods with .on/off
- esp8266/quickref: polish Pin.on()/off() examples
- network: move confusingly-named cc3200 Server class to its reference
- uos: deconditionalize, remove minor port-specific details
- uos: move cc3200 port legacy VFS mounting functions to its ref doc
- machine: sort machine classes in logical order, not alphabetically
- network: first step to describe standard network class interface
examples:
- embedding: use core-provided KeyboardInterrupt object
Diffstat (limited to 'cc3200/misc')
| -rw-r--r-- | cc3200/misc/help.c | 19 | ||||
| -rw-r--r-- | cc3200/misc/mpexception.c | 3 | ||||
| -rw-r--r-- | cc3200/misc/mpexception.h | 3 | ||||
| -rw-r--r-- | cc3200/misc/mpirq.c | 2 | ||||
| -rw-r--r-- | cc3200/misc/mpsystick.c | 71 | ||||
| -rw-r--r-- | cc3200/misc/mpsystick.h | 35 |
6 files changed, 3 insertions, 130 deletions
diff --git a/cc3200/misc/help.c b/cc3200/misc/help.c index 4601818bd..cce515898 100644 --- a/cc3200/misc/help.c +++ b/cc3200/misc/help.c @@ -25,23 +25,8 @@ * THE SOFTWARE. */ -#include <stdio.h> +#include "py/builtin.h" -#include "lib/utils/pyhelp.h" - -STATIC const char help_text[] = "Welcome to MicroPython!\n" +const char *cc3200_help_text = "Welcome to MicroPython!\n" "For online help please visit http://micropython.org/help/.\n" "For further help on a specific object, type help(obj)\n"; - -STATIC mp_obj_t pyb_help(uint n_args, const mp_obj_t *args) { - if (n_args == 0) { - // print a general help message - printf("%s", help_text); - } - else { - // try to print something sensible about the given object - pyhelp_print_obj(args[0]); - } - return mp_const_none; -} -MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mp_builtin_help_obj, 0, 1, pyb_help); diff --git a/cc3200/misc/mpexception.c b/cc3200/misc/mpexception.c index c45f0244b..068adb70b 100644 --- a/cc3200/misc/mpexception.c +++ b/cc3200/misc/mpexception.c @@ -40,9 +40,6 @@ STATIC void mpexception_set_user_interrupt (int chr, void *data); /****************************************************************************** DECLARE EXPORTED DATA ******************************************************************************/ -const char mpexception_os_resource_not_avaliable[] = "resource not available"; -const char mpexception_os_operation_failed[] = "the requested operation failed"; -const char mpexception_os_request_not_possible[] = "the requested operation is not possible"; const char mpexception_value_invalid_arguments[] = "invalid argument(s) value"; const char mpexception_num_type_invalid_arguments[] = "invalid argument(s) num/type"; const char mpexception_uncaught[] = "uncaught exception"; diff --git a/cc3200/misc/mpexception.h b/cc3200/misc/mpexception.h index f55aa739e..2f9d1877c 100644 --- a/cc3200/misc/mpexception.h +++ b/cc3200/misc/mpexception.h @@ -28,9 +28,6 @@ #ifndef MPEXCEPTION_H_ #define MPEXCEPTION_H_ -extern const char mpexception_os_resource_not_avaliable[]; -extern const char mpexception_os_operation_failed[]; -extern const char mpexception_os_request_not_possible[]; extern const char mpexception_value_invalid_arguments[]; extern const char mpexception_num_type_invalid_arguments[]; extern const char mpexception_uncaught[]; diff --git a/cc3200/misc/mpirq.c b/cc3200/misc/mpirq.c index be5746759..37149089f 100644 --- a/cc3200/misc/mpirq.c +++ b/cc3200/misc/mpirq.c @@ -24,7 +24,7 @@ * THE SOFTWARE. */ -#include "std.h" +#include <stdio.h> #include "py/mpconfig.h" #include "py/obj.h" diff --git a/cc3200/misc/mpsystick.c b/cc3200/misc/mpsystick.c deleted file mode 100644 index 7c35354e1..000000000 --- a/cc3200/misc/mpsystick.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013, 2014 Damien P. George - * Copyright (c) 2015 Daniel Campora - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "py/mpconfig.h" -#include "py/obj.h" -#include "py/mphal.h" -#include "mpsystick.h" -#include "systick.h" -#include "inc/hw_types.h" -#include "inc/hw_nvic.h" - -#ifdef USE_FREERTOS -#include "FreeRTOS.h" -#include "task.h" -#endif - - -bool sys_tick_has_passed(uint32_t start_tick, uint32_t delay_ms) { - return mp_hal_ticks_ms() - start_tick >= delay_ms; -} - -// waits until at least delay_ms milliseconds have passed from the sampling of -// startTick. Handles overflow properly. Assumes stc was taken from -// mp_hal_ticks_ms() some time before calling this function. -void sys_tick_wait_at_least(uint32_t start_tick, uint32_t delay_ms) { -#ifdef USE_FREERTOS - vTaskDelay (delay_ms / portTICK_PERIOD_MS); -#else - while (!sys_tick_has_passed(start_tick, delay_ms)) { - __WFI(); // enter sleep mode, waiting for interrupt - } -#endif -} - -// The SysTick timer counts down at HAL_FCPU_HZ, so we can use that knowledge -// to grab a microsecond counter. -// We assume that mp_hal_ticks_ms returns milliseconds. -uint32_t sys_tick_get_microseconds(void) { - mp_uint_t irq_state = disable_irq(); - uint32_t counter = SysTickValueGet(); - uint32_t milliseconds = mp_hal_ticks_ms(); - enable_irq(irq_state); - - uint32_t load = SysTickPeriodGet(); - counter = load - counter; // Convert from decrementing to incrementing - return (milliseconds * 1000) + ((counter * 1000) / load); -} diff --git a/cc3200/misc/mpsystick.h b/cc3200/misc/mpsystick.h deleted file mode 100644 index d7ad59461..000000000 --- a/cc3200/misc/mpsystick.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013, 2014 Damien P. George - * Copyright (c) 2015 Daniel Campora - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef MPSYSTICK_H -#define MPSYSTICK_H - -void sys_tick_wait_at_least(uint32_t stc, uint32_t delay_ms); -bool sys_tick_has_passed(uint32_t stc, uint32_t delay_ms); -uint32_t sys_tick_get_microseconds(void); - -#endif // MPSYSTICK_H |
