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>
The Renesas RA port
This is a port of MicroPython to the Renesas RA family of microcontrollers. Currently supported features are:
- Filesystem on the internal flash using FatFs.
timemodule with sleep, time, and ticks functions.osmodule with VFS support.machinemodule with the following classes:Pin,ADC,PWM,DAC,I2C,SPI,SoftI2C,SoftSPI,UART,RTC,SDCard.sdcardmodule for MCUs without nativemachine.SDCardsupport.
Currently supported board product names are:
- EK-RA6M2
- RA4M1 CLICKER
- EK-RA6M1
- EK-RA4M1
- EK-RA4W1
Please refer to the quick reference of renesas-ra port for more
information about the boards.
Build instructions
-
MicroPython cross-compier The MicroPython cross-compiler must be built first, which will be used to pre-compile (freeze) built-in Python code. THis cross-compiler is built and run on the host machine, using:
$ make -C mpy-crossThis command should be executed from the root directory of this repository. All other commands below should be executed from the ports/renesas-ra/ directory.
-
Arm compiler An
Arm compileris required for the build, along with the associated binary utilities. The default compiler isarm-none-eabi-gcc, which is available for Linux, Mac and Windows hosts via https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads. The compiler can be changed using theCROSS_COMPILEvariable when invokingmake. -
Protocol buffer compiler Building for the
ARDUINO_PORTENTA_C33board will build theesp_hosteddriver, that depends on the Protocol Buffer Compiler being installed. On Debian/Ubuntu, this can be installed withsudo apt-get install protobuf-compiler. -
Obtain submodules First the submodules must be obtained using:
$ make submodules -
Build binary image
.hexThen to build for a given board subdirectory name, run:$ make BOARD=EK_RA6M2 clean $ make BOARD=EK_RA6M2The default board subdirectory name is EK_RA6M2 (which is for EK-RA6M2 board) but any of the names of the subdirectories in the
boards/directory can be passed as the argument toBOARD=; for exampleRA4M1_CLICKER,EK_RA4M1,EK_RA4W1andEK_RA6M1. The above command should produce binary imagesfirmware.hexin the build-EK_RA6M2/` subdirectory (or the equivalent directory for the board specified).
Supported/Unsupported functions
Please refer to the renesas-ra quick reference.
Known issues
all boards
-
machine.lightsleep(time_ms) and machine.deepsleep(time_ms) raise uncaught exceptions.
machine.deepsleep(1000) Uncaught exception in ExtInt interrupt handler line 16 TypeError:
RA4M1-CLICKER
- mpremote: mount command is not available due to limited memory resources.
EK-RA4M1
- mpremote: mount command is not available due to limited memory resources.
EK-RA4W1
- mpremote: "Execution: timeout waiting for remote" error happens when importing a file on /remote.