Wykres commitów

9 Commity (master)

Autor SHA1 Wiadomość Data
Angus Gratton decf8e6a8b all: Remove the "STATIC" macro and just use "static" instead.
The STATIC macro was introduced a very long time ago in commit
d5df6cd44a.  The original reason for this was
to have the option to define it to nothing so that all static functions
become global functions and therefore visible to certain debug tools, so
one could do function size comparison and other things.

This STATIC feature is rarely (if ever) used.  And with the use of LTO and
heavy inline optimisation, analysing the size of individual functions when
they are not static is not a good representation of the size of code when
fully optimised.

So the macro does not have much use and it's simpler to just remove it.
Then you know exactly what it's doing.  For example, newcomers don't have
to learn what the STATIC macro is and why it exists.  Reading the code is
also less "loud" with a lowercase static.

One other minor point in favour of removing it, is that it stops bugs with
`STATIC inline`, which should always be `static inline`.

Methodology for this commit was:

1) git ls-files | egrep '\.[ch]$' | \
   xargs sed -Ei "s/(^| )STATIC($| )/\1static\2/"

2) Do some manual cleanup in the diff by searching for the word STATIC in
   comments and changing those back.

3) "git-grep STATIC docs/", manually fixed those cases.

4) "rg -t python STATIC", manually fixed codegen lines that used STATIC.

This work was funded through GitHub Sponsors.

Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-03-07 14:20:42 +11:00
robert-hh 69cb5e8f2a samd: Adapt existing samd.Flash and integrate with (Q)SPI flash in boot.
Checks are added to ensure, that only one of the flash drivers is selected.

Signed-off-by: robert-hh <robert@hammelrath.com>
2023-06-06 00:49:36 +10:00
robert-hh 4598b89ce9 samd: Add Pin.board and Pin.cpu classes to Pin.
For compatibility with other ports.  Code increase up to ~1250 bytes for
SAMD21.  The feature is configurable via MICROPY_PY_MACHINE_PIN_BOARD_CPU
in case flash memory is tight.
2023-02-17 17:27:21 +11:00
robert-hh a6760bd4ef samd/modmachine: Replace the LED class by the Signal class.
It simplifies and improves the code.  The LED_Pxxx lines of the board.csv
lines can still be used, but will be taken as Pin definitions.
2022-10-25 23:39:41 +11:00
robert-hh e5cf3fab95 samd/machine_pin: Change the pin handling and naming/numbering.
Pin numbers are now the MCU port numbers in the range:

    PA0..PA31:  0..31
    PB0..PB31: 32..63
    PC0..PC31: 64..95
    PD0..PD31: 96..127

Pins can be denoted by the GPIO port number, the name as defined in
pins.csv or a string in the form Pxnn, like "PA16" or "PD03".

The pins.c and pins.h files are now obsolete.  The pin objects are part of
the AF table.

As result of a simplification, the code now supports using pin names or
numbers instead of pin objects for modules like UART, SPI, PWM, I2C, ADC,
pininfo.
2022-10-25 23:34:07 +11:00
robert-hh 6e2dff6bae samd/modsamd: Add pininfo() function to the samd module.
samd.pininfo() returns the data stored in the pin af table for a pin.
Using a small script, a nice representation of the table can be created.
2022-10-06 22:53:28 +11:00
Damien George efe23aca71 all: Remove third argument to MP_REGISTER_MODULE.
It's no longer needed because this macro is now processed after
preprocessing the source code via cpp (in the qstr extraction stage), which
means unused MP_REGISTER_MODULE's are filtered out by the preprocessor.

Signed-off-by: Damien George <damien@micropython.org>
2022-06-02 16:31:37 +10:00
Jim Mussared c3f7424a57 samd: Make port-specific modules use MP_REGISTER_MODULE.
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-05-18 20:57:09 +10:00
Peter van der Burg 2121353602 samd: Add internal flash block device, filesystem and uos support. 2021-11-19 11:42:58 +11:00