Wykres commitów

1183 Commity (904eb2d9f35791da75156fe1ddacbe1c05b4b001)

Autor SHA1 Wiadomość Data
Damien George 613510bce8 drivers/memory/spiflash: Change from hard-coded soft SPI to generic SPI.
The SPI flash driver now supports using an arbitrary SPI object to
communicate with the flash chip, and in particular can use a hardware SPI
peripheral.
2017-08-29 11:37:18 +10:00
Damien George 7e6881cf7d stmhal/boards/pllvalues.py: Make script work with both Python 2 and 3. 2017-08-24 22:43:36 +10:00
Damien George 3e1412a1fb stmhal/Makefile: Use GEN_PINS_HDR var instead of writing it explicitly. 2017-08-24 13:09:35 +10:00
Damien George a8052d343c stmhal/modmachine: For F7 MCU, save power by reducing internal volt reg. 2017-08-24 12:20:26 +10:00
Damien George 41b4686dd7 stmhal: Compute PLL freq table during build instead of at run time.
Allows for simpler, smaller and faster code at run time when selecting the
boards frequency, and allows more customisation opportunities for the PLL
values depending on the target MCU.
2017-08-24 11:38:39 +10:00
Damien George fc483706d3 stmhal/modmachine: Improve support for sleep/deepsleep on F7 MCUs.
Changes for F7 are:
- machine.reset_cause() now reports DEEPSLEEP_RESET correctly;
- machine.sleep() is further optimised to reduce power consumption;
- machine.deepsleep() is now implemented and working.
2017-08-23 17:00:02 +10:00
Damien George 49316b864b stmhal/modmachine: Make machine.bootloader() work when MPU is enabled. 2017-08-23 16:58:48 +10:00
Damien George 4ec803a42a all: Make static dicts use mp_rom_map_elem_t type and MP_ROM_xxx macros. 2017-08-21 21:34:23 +10:00
Javier Candeira 35a1fea90b all: Raise exceptions via mp_raise_XXX
- Changed: ValueError, TypeError, NotImplementedError
  - OSError invocations unchanged, because the corresponding utility
    function takes ints, not strings like the long form invocation.
  - OverflowError, IndexError and RuntimeError etc. not changed for now
    until we decide whether to add new utility functions.
2017-08-13 22:52:33 +10:00
Damien George 7d4a2f773c all: Make use of $(TOP) variable in Makefiles, instead of "..".
$(TOP) is defined in py/mkenv.mk and should be used to refer to the top
level of this repository.
2017-08-11 12:22:19 +10:00
Damien George 0f12082f5b py,extmod,stmhal: Use "static inline" for funcs that should be inline.
"STATIC inline" can expand to "inline" if STATIC is defined to nothing, and
this case can lead to link errors.
2017-08-02 13:42:34 +10:00
Alexander Steffen 55f33240f3 all: Use the name MicroPython consistently in comments
There were several different spellings of MicroPython present in comments,
when there should be only one.
2017-07-31 18:35:40 +10:00
Damien George 761e4c7ff6 all: Remove trailing spaces, per coding conventions. 2017-07-19 13:12:10 +10:00
Damien George c972c60dbe stmhal: Clean up USB CDC/MSC files and remove commented-out code. 2017-07-19 13:01:22 +10:00
Alexander Steffen 299bc62586 all: Unify header guard usage.
The code conventions suggest using header guards, but do not define how
those should look like and instead point to existing files. However, not
all existing files follow the same scheme, sometimes omitting header guards
altogether, sometimes using non-standard names, making it easy to
accidentally pick a "wrong" example.

This commit ensures that all header files of the MicroPython project (that
were not simply copied from somewhere else) follow the same pattern, that
was already present in the majority of files, especially in the py folder.

The rules are as follows.

Naming convention:
* start with the words MICROPY_INCLUDED
* contain the full path to the file
* replace special characters with _

In addition, there are no empty lines before #ifndef, between #ifndef and
one empty line before #endif. #endif is followed by a comment containing
the name of the guard macro.

py/grammar.h cannot use header guards by design, since it has to be
included multiple times in a single C file. Several other files also do not
need header guards as they are only used internally and guaranteed to be
included only once:
* MICROPY_MPHALPORT_H
* mpconfigboard.h
* mpconfigport.h
* mpthreadport.h
* pin_defs_*.h
* qstrdefs*.h
2017-07-18 11:57:39 +10:00
Damien George 4fa9d97e4d stmhal/servo: Don't compile servo code when it's not enabled. 2017-07-14 17:41:43 +10:00
Damien George 9cca14a5dc stmhal/pin_named_pins: Remove unreachable print function.
There are never any instances of these objects so there is no need to have
a print function.
2017-07-14 17:03:24 +10:00
Damien George 2b70757411 stmhal/servo: Make pyb.Servo(n) map to Pin('Xn') on all MCUs.
Prior to this patch Servo numbers 1, 2, 3, 4 mapped to pins X3, X4, X1, X2
on PYBLITE which doesn't match the standard PYB mapping.  This patch fixes
the mapping.
2017-07-14 17:02:37 +10:00
Damien George f1d260d878 stmhal: Reduce size of ESPRUINO_PICO build so it fits in flash.
The default frozen modules are no longer included (but users can still
specify their own via FROZEN_MPY_DIR), complex numbers are disabled and so
are the native, viper and asm_thumb emitters.  Users needing these features
can tune the build to disable other things.
2017-07-12 12:51:37 +10:00
Damien George d5ec46ace4 stmhal/boards/NUCLEO_F429ZI: Change USB config from HS to FS peripheral.
This dev board only has a single USB connector, connected to the FS
peripheral.
2017-07-04 22:49:04 +10:00
Damien George 80b31dc097 stmhal: Clean up some header includes. 2017-07-03 17:37:22 +10:00
Alberto Petrucci 5b509dbc7b stmhal/boards: Add configuration files for NUCLEO_F429ZI. 2017-07-03 15:39:28 +10:00
Damien George 346f5d4cce stmhal/mpconfigport.h: Allow MICROPY_PY_THREAD to be overridden. 2017-06-28 15:45:04 +10:00
Damien George 05a08506ae stmhal/Makefile: Add CFLAGS_EXTRA to CFLAGS so cmdline can add options. 2017-06-28 15:44:29 +10:00
Damien George 703370ebc5 stmhal/Makefile: Rename FLOAT_IMPL to MICROPY_FLOAT_IMPL to match C name
The name used in py/mpconfig.h is MICROPY_FLOAT_IMPL so rename this
Makefile variable to mirror that.
2017-06-28 15:42:40 +10:00
Damien George 535804a0ed stmhal/Makefile: Use hardware double-prec FP for MCUs that support it. 2017-06-28 15:12:05 +10:00
Damien George d20f8fb893 stmhal/boards: Enable double-prec FP on F76x boards. 2017-06-28 15:12:04 +10:00
Damien George ebfdd96cb2 stmhal: Add possibility to build with double-precision floating point.
By default the firmware is built with single-precision floating point.
To build a particular board using double precision instead, put the
following line in the mpconfigboard.mk file:

    FLOAT_IMPL = double
2017-06-28 15:12:04 +10:00
Benjamin Weps 3e82bedf46 stmhal/sdcard: Allow a board to customise the SDIO pins. 2017-06-27 12:42:46 +10:00
Damien George 118173013f stmhal/boards/stm32f405.ld: Increase FLASH_TEXT to end of 1MiB flash.
And and FLASH_FS, and use "K" values instead of hex numbers for lengths.

The increase of FLASH_TEXT is to allow more frozen bytecode for a
particular user's project.  It's not used for anything else.
2017-06-26 17:00:06 +10:00
Damien George 6e80f0ee90 stmhal/modules: Provide sym-link to onewire.py driver. 2017-06-22 16:36:04 +10:00
Damien George b19138e82e stmhal: Make available the _onewire module, for low-level bus control. 2017-06-22 16:20:22 +10:00
Damien George 8ed7155828 stmhal: Add "quiet timing" enter/exit functions.
They disable all interrupts except for SysTick and are useful for doing
certain low-level timing operations.
2017-06-22 16:18:42 +10:00
Damien George 4f9858e86d stmhal: Move pybstdio.c to lib/utils/sys_stdio_mphal.c for common use.
It provides sys.stdin, sys.stdout, sys.stderr for bare-metal targets based
on mp_hal functions.
2017-06-15 18:55:34 +10:00
Damien George fd860dc552 stmhal: Add .value() method to Switch object, to mirror Pin and Signal. 2017-06-15 17:34:51 +10:00
Damien George 4abe3731e3 stmhal: Add initial implementation of Pin.irq() method.
This method follows the new HW API and allows to set a hard or soft IRQ
callback when a Pin has a level change.  It still remains to make this
method return a IRQ object.
2017-06-15 17:17:36 +10:00
Damien George 2bf5a947b2 stmhal: Make error messages more consistent across peripherals. 2017-06-15 12:02:14 +10:00
Damien George 48d867b4a6 all: Make more use of mp_raise_{msg,TypeError,ValueError} helpers. 2017-06-15 11:54:41 +10:00
Damien George c064f0a36a stmhal/mpconfigport.h: Remove config of PY_THREAD_GIL to use default.
The default for the GIL is to enable it if threading is enabled, and this
is the recommended way to use threading with the stmhal port.
2017-06-14 14:47:53 +10:00
Damien George 22cedef95f stmhal/usbdev: For MSC implement SCSI SYNCHRONIZE_CACHE command.
Currently just a dummy command that returns "success", but it's needed for
some O/S's to correctly talk with the SCSI layer.
2017-06-08 12:29:10 +10:00
Damien George f86c57fedf stmhal/usb: Make state for USB device private to top-level USB driver. 2017-06-07 16:03:45 +10:00
Sylvain Pelissier 3bb69f645a stmhal/usb: Use local USB handler variable in Start-of-Frame handler. 2017-06-07 16:03:19 +10:00
Sylvain Pelissier 6adcf7bb82 stmhal: Pass USB handler as parameter to allow more than one USB handler 2017-06-07 15:50:26 +10:00
Dave Hylands 551a731755 stmhal: Add support for NUCLEO_F446RE board. 2017-06-07 13:14:40 +10:00
Damien George 6ff0ecfffc ports: Convert from using stmhal's input() to core provided version. 2017-06-01 16:02:49 +10:00
Damien George 821dc27eec stmhal/boards: Enable DAC for NUCLEO_F767ZI board. 2017-05-30 18:31:55 +10:00
Paul Sokolovsky bcf31a3908 esp8266, stmhal, zephyr: Rename machine.Pin high/low methods to on/off.
For consistent Pin/Signal class hierarchy. With it, Signal is a proper
(while still ducktyped) subclass of a Pin, and any (direct) usage of Pin
can be replace with Signal.

As stmhal's class is reused both as machine.Pin and legacy pyb.Pin,
high/low methods actually retained there.
2017-05-21 17:44:58 +03:00
Damien George a004554dc1 stmhal/modmachine: Remove TODO comment that is now implemented. 2017-05-16 17:44:14 +10:00
Damien George 37bd3b4f4c stmhal/modmachine: Add machine.UART class, linking to pyb.UART.
pyb.UART has a superset of machine.UART functionality so can be used to
provide compatibility with other ports that also implement machine.UART.
2017-05-16 17:40:22 +10:00
Damien George f1609bc843 ports: Add ilistdir in uos module. 2017-05-10 12:13:53 +10:00