This is a minor optimisation to the mcr20a-rf-driver code:
Note that function parameter is pointer. The code is more readable when 'NULL' instead of using '0'.
The two types of the CANMessage constructor accepting a data buffer have two issues. First, they limit the input buffer size to the 4 least significant bits of the passed length even though a CAN message cannot have more than 8 bytes of payload. Second, the used data length in the following memcpy() uses the initially passed data length which may exceed the internal data buffer size. Both will lead into hard to find bugs if the passed data buffer size is outside the limits according to the CAN standard. This fix intends to solve this by limiting the input data size to 8 bytes.
In no MISO case, skip SPI read so that no more write/read delay contribute to SPI inter-frame delay when data is written successively.
Update targets:
- NUMAKER_PFM_NANO130
- NUMAKER_PFM_NUC472
- NUMAKER_PFM_M453
- NUMAKER_PFM_M487/NUMAKER_IOT_M487
- NU_PFM_M2351_*
- NUMAKER_IOT_M263A
- NUMAKER_M252KG
Make a Mbed library with Cypress WHD files so it is automatically excluded
when building with the bare metal profile. Create another Mbed library to
group network files that use WHD so they can also be excluded fro the bare
metal profile.
When dealing with EEPROMs without a 16 bit adressing, the current
implementation does not work, as it writes a 16 bit address to the chip.
This may cause undefined behaviour.
This change adds a new constructor argument to enable this new eight-bit
mode. It defaults to false to not break existing code.
This constructor argument should actually never be necessary to manually
set, except when dealing with cheap devices.
This is a workaround for the GCC not using the strong symbols from
C files to override the weak symbols from ASM files. This GCC bug is only
present when building with the link-time optimizer (LTO) enabled. For
more details please see:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83967
This can be fixed by changing the order of object files in the linker
command; objects providing the weak symbols and compiled from assembly
must be listed before the objects providing the strong symbols.
To keep things simple, ALL object files from ASM are listed before
other object files.
Disable the lto for the default develop and release prifiles and move
the flags to tools/profiles/extensions/lto.json profile.
Usage:
mbed compile --profile release --profile tools/profiles/extensions/lto.json
This fixes the undefined reference to 'main' that arose after adding
the "-flto" flag to compilation.
This was the case for combined "-Wl,--wrap,main" and "-flto" flags.
According to GCC man:
To use the link-time optimizer, -flto and optimization options should be
specified at compile time and during the final link. It is recommended
that you compile all the files participating in the same link with the
same options and also specify those options at link time.
Additionally, move the '-g3' flag out of 'common' flags in the debug
profile. Although the '-g' is correctly ignored by the linker, the
'-glevel' is not and causes a build error "ld: unrecognized option
'-g3'".
This is a minor optimisation to the mcr20a-rf-driver code:
1. The function parameter is 'uint8_t *byteArray', (byteArray == NULL) instead of using (byteArray == 0). The code is more readable.