summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-22zephyr: Rename machine I2C and SPI types consistently across ports.iabdalkader
This renames: - machine_hard_i2c_type -> machine_i2c_type - machine_hard_spi_type -> machine_spi_type
2022-10-22renesas-ra: Rename machine SPI type consistently across ports.iabdalkader
This renames: - machine_hard_spi_type -> machine_spi_type
2022-10-22samd: Rename machine I2C type consistently across ports.iabdalkader
This renames: - machine_hw_i2c_type -> machine_i2c_type
2022-10-22rp2: Rename machine I2C type consistently across ports.iabdalkader
This renames: - machine_hw_i2c_type -> machine_i2c_type
2022-10-22esp32: Rename machine I2C and SPI types consistently across ports.iabdalkader
This renames: - machine_hw_i2c_type -> machine_i2c_type - machine_hw_spi_type -> machine_spi_type
2022-10-22stm32: Rename machine I2C and SPI types consistently across ports.iabdalkader
This renames: - machine_hard_i2c_type -> machine_i2c_type - machine_hard_spi_type -> machine_spi_type
2022-10-14tests/extmod: Add test for sleep_ms value that overflows ticks.Damien George
Addresses #9516. Signed-off-by: Damien George <damien@micropython.org>
2022-10-14extmod/utime_mphal: Make ticks_add check for overflow of delta.Damien George
Work done in collaboration with @jimmo. Signed-off-by: Damien George <damien@micropython.org>
2022-10-14unix/modffi: Move header includes inside MICROPY_PY_FFI guard.Damien George
So ffi.h is not needed if this module is disabled. Signed-off-by: Damien George <damien@micropython.org>
2022-10-12py/misc: Remove use of bitfield from vstr_t.David Lechner
Since there is only one flag, we don't need to use a bitfield in vstr_t. Compilers emit extra instructions to access a bitfield, so this should reduce the binary size a small amount. Signed-off-by: David Lechner <david@pybricks.com>
2022-10-12rp2/fatfs_port: Fix the modification date of files.robert-hh
It was off by 2000 % 128 == 80 years. Addresses issue #9535.
2022-10-12samd/Makefile: Split up SRC_C variables.Jim Mussared
This improves clarity a bit, but also ensures that only the required files are added to SRC_QSTR. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-12nrf/Makefile: Split up SRC_C variables.Jim Mussared
This improves clarity a bit, but also ensures that only the required files are added to SRC_QSTR. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-12mimxrt/Makefile: Split up SRC_C variables.Jim Mussared
This improves clarity a bit, but also ensures that only the required files are added to SRC_QSTR. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11extmod: Make extmod.mk self-contained.Jim Mussared
This makes it so that all a port needs to do is set the relevant variables and "include extmod.mk" and doesn't need to worry about adding anything to OBJ, CFLAGS, SRC_QSTR, etc. Make all extmod variables (src, flags, etc) private to extmod.mk. Also move common/shared, extmod-related fragments (e.g. wiznet, cyw43, bluetooth) into extmod.mk. Now that SRC_MOD, CFLAGS_MOD, CXXFLAGS_MOD are unused by both extmod.mk (and user-C-modules in a previous commit), remove all uses of them from port makefiles. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11extmod/extmod.mk: Make extmod.mk handle GIT_SUBMODULES.Jim Mussared
This applies to nimble, btstack, axtls, mbedtls, lwip. Rather than having the ports individually manage GIT_SUBMODULES for these components, make extmod.mk append them when the relevant feature is enabled. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11unix/Makefile: Don't use _MOD variable names.Jim Mussared
This conflicts with the triple-usage of these variables for user-C-modules and extmod source. For CFLAGS_MOD, just use CFLAGS directly. For SRC, use SRC_C directly as the relevant files are all guarded by the preprocessor anyway. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11py/py.mk: Make user-C-module handling self-contained in py.mk.Jim Mussared
Removes the need for the port to add anything to OBJS or SRC_QSTR. Also makes it possible for user-C-modules to differentiate between code that should be processed for QSTR vs other files (e.g. helpers and libraries). Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11ports: Make generated pin.c handling more consistent across ports.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11all: Use += rather than = everywhere for CFLAGS/LDFLAGS/LIBS.Jim Mussared
This avoids a surprise where an = can cancel out an earlier +=. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11unix: Enable sys.executable.Jim Mussared
Gives the absolute path to the unix micropython binary. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com> Signed-off-by: Damien George <damien@micropython.org>
2022-10-11py/modsys: Add support for sys.executable.Jim Mussared
Only intended to be used on Unix and other "OS" ports. Matches CPython. This should give the absolute path to the executing binary. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com> Signed-off-by: Damien George <damien@micropython.org>
2022-10-11py/objstr: Add a helper to set mp_obj_str_t data.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-11CODECONVENTIONS.md: Update pre-commit instructions.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-07tools/verifygitlog.py: Add additional help for subject line issues.Jim Mussared
This check used to just show the regular expression that failed to match, but the rules are pretty subtle and hard to interpret from the regular expression alone. Add some basic checks for the main things that go wrong: - Missing capitalisation. - Missing full-stop. - Missing path. - Single-word subject. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-07tools/verifygitlog.py: Ignore comment lines in commit messages.Jim Mussared
The "signed-off" check assumes that the Signed-off-by: line is the last, but there may me many lines of comments after this. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-10-06samd/machine_pin: Change the printing of Pin and LED objects.robert-hh
It now prints lines like: Pin("D9", mode=IN, pull=PULL_UP, GPIO=PA07) or LED("LED") showing for consistency the names as given in pins.csv. For pins, the GPIO numer is printed as well for a reference.
2022-10-06samd/mcu: Use lf2s for SAMD51 and lfs1 for SAMD21.robert-hh
Using lfs1 gives a smaller code, but lfs2 has more features.
2022-10-06samd/main: Initialize readline on start up.robert-hh
Somehow that was forgotten.
2022-10-06samd/boards: Use the same linker file for all SAMD51x19 variants.robert-hh
2022-10-06samd/boards: Move the flash filesystem definitions to the linker files.robert-hh
They used to be in mpconfigmcu.h, but have to be different for different chip variants, like the SAMD51x20.
2022-10-06samd/mcu: Enable the math module on SAMD51.robert-hh
2022-10-06samd/mcu: Add floating point suport for SAMD21 devices.robert-hh
For consistency it should be there.
2022-10-06samd: Change the symbol names for the peripheral clocks.robert-hh
From APB_FREQ to DFLL48M_FREQ, and from apb_freq to peripheral_freq.
2022-10-06samd/mphalport: Fix USB endpoint handling ignoring Ctrl-C.robert-hh
Porting PR #8040 by @hoihu to SAMD, following the commit 587339022689187a1acbccc1d0e2425a67385ff7. One small addition: before executing keyboard interrupt, the input buffer is cleared.
2022-10-06samd/Makefile: Fix a dependency problem with "make -j".robert-hh
The build directory was not created before attempting to create the generated files in it.
2022-10-06samd/samd_flash: Remove obsolete printf's and return values instead.robert-hh
Returning values is much more useful.
2022-10-06samd/pin_af: Simplify the pin-af-table handling.robert-hh
Changes are: - The pin-af-table-SAMDxx.csv file are moved to the mcu directories with the name as pin-af-table.csv. - The handling in Makefile and pin_af.c is simplified.
2022-10-06samd/clock_config: Add HW_DFLL_USB_SYNC and HW_MCU_OSC32KULP extensions.robert-hh
Two new compile flags are: MICROPY_HW_DFLL_USB_SYNC: Effective only if DFLL48 does not run from the crystal. It will synchronize the DFLL48M clock with the USB's SOF pulse. If no USB is connected, it will fall back to open loop mode. The DFLL48M clock is then pretty precise, but with a higher clock jitter at SAMD51 devices. MICROPY_HW_MCU_OSC32KULP: Effective only if the devics uses a crystal as clock source. Run the MCU clock from the ULP 32kHz oszillator instead of the crystal. This flag was added to cater for a interference problem of the crystal and Neopixel/Debug pins at Adafruit FEATHER Mx boards, which causes the board to crash. Drawback: ticks_ms() and time.time() vs. than ticks_us() and the peripherals like PWM run at not synchronous clocks.
2022-10-06samd/clock_config: Split clock_config.c to separate SAMD21/SAMD51 files.robert-hh
And put the file into the mcu directory. The file got a little bit long and hard to read.
2022-10-06samd/mpconfigport: Restructure to use ROM feature levels.robert-hh
Changes are: - Set the feature level for each MCU: CORE features for SAMD21, and EXTRA features for SAMD51. - Remove all definitions that are included in the core feature level. - Keep the default settings for feature level and float, to make the choice obvious.
2022-10-06samd/machine_bitstream: Add the machine.bitstream() function.robert-hh
The SAMD21 implementation is an adaption of @jimmo's code for STM32Lxx. The only changes are the addresses and names of the port registers and the timing parameters. SAMD21: The precision is about +/-25ns at 48MHz clock frequency. The first two cycles are about 40-60 ns longer than set. But still good enough to drive a neopixel device. SAMD51: The precision is about +/-30ns at 120MHz clock frequency. Good enough to drive a neopixel device.
2022-10-06samd/mphalport: Use CYCCNT for SAMD51's mp_hal_ticks_cpu().robert-hh
And use mp_hal_ticks_us() for SAM21's mp_hal_ticks_cpu(). The SAMD21 has no CYCCNT register, and the SysTick register has only a 1 ms span (== 48000 count range).
2022-10-06samd/boards: Add missing/lost board config and pin definitions.robert-hh
Fixes are: - Pin definitions for ADAFRUIT_FEATHER_Mx_EXPRESS and ADAFRUIT_ITSYBITSY_M4_EXPRESS. - For ADAFRUIT_ITSYBITSY_M0_EXPRESS, change the MISO/MOSI name. - For MINISAM_M4, add the default SPI pins. - For boards with 32k crystal, add the XOSC32K setting.
2022-10-06samd/machine_uart: Support buffered TX for UART.robert-hh
It can be enabled/disabled by a configuration switch. The code size increase is 308 bytes, but it requires RAM space for buffers, the larger UART object and root pointers.
2022-10-06samd/modutime: Enable time.time() based on systick_ms().robert-hh
Allowing to set a time and retrieve the time. It is based on systick_ms() with the precision of the MCU clock. Unless that is based on a crystal, the error seen was about 0.5% at room temperature.
2022-10-06samd/mphalport: Add a mp_hal_ticks_ms_64() function.robert-hh
Returning a 64 bit number. This will be used by the utime module and the machine.UART module for timeout avoiding overflow.
2022-10-06samd/mcu: Factor out MCU policy for SAMD21 and SAMD51.robert-hh
Which contains a mpconfigmcu.h, mpconfigmcu.mk and manifest.py file for each MCU group. That looks better than the previous choice.
2022-10-06samd/modmachine: Add machine.time_pulse_us.robert-hh
Software based. Resolution: - +/-2 microseconds on SAMD51. - +/-4 microseconds on SAMD21.
2022-10-06samd/machine_dac: Add the machine.DAC class.robert-hh
It suuports 1 channel @ 10 bit for SAMD21, 2 channels @ 12 bit for SAMD51. Instantiation by: dac = machine.DAC(ch) # 0 or 1 Method write: dac.write(value) The output voltage range is 0..Vdd.