Commit Graph

15 Commits (master)

Author SHA1 Message Date
Meano 6feca90589 Unify the __CORTEX_A macro in the files containing cmsis.h 2021-06-23 13:36:52 +08:00
Jaeden Amero 5d20374bc3 Add v8.1-M architecture awareness
Add v8.1-M architecture awareness to Mbed CRC, HAL, and Mbed Atomic.

Fixes #14433
2021-04-23 15:01:16 +01:00
Kevin Bracey 904d4e4d2b Make ticker computation use shift-by-0
Runtime code that analysed clock frequency to determine numerator and
denominator for conversion to standard 1MHz failed to handle the case
of either being 1 correctly.

Although it would spot other values that could be performed as shifts,
it failed to spot that 1 is "shift by 0", so would end up doing runtime
multiply and/or divide by 1. The runtime divide by 1 could be slow on a
Cortex-M0 device, increasing interrupt latency.

UART character loss on STM32F0 devices has been traced to this incorrect
code.

Correct the `exact_log2` routine so that `exact_log2(1)` returns 0 to
fix this.

Original code had a single special no-multiply-or-divide case for
hardware clock frequency being exactly 1MHz, as USTICKER is on STM32F0 -
this code lacks that but has a more general special case that covers all
shift-convertible frequencies like 500kHz or 8MHz, which should be
similar speed as shifts are cheap.
2021-04-12 09:46:42 +03:00
George Psimenos 21194f5b95 New lines 2021-03-18 17:01:54 +00:00
George Psimenos d239ef98cd Rename USBTX/RX to CONSOLE_TX/RX 2021-03-18 17:01:54 +00:00
George Psimenos 3af96247a6 Update PinNames markers 2021-03-18 17:01:54 +00:00
George Psimenos 885cdef5f7 Add standard pin-names validation script & tests 2021-03-18 17:01:53 +00:00
jeromecoutant 9d453cce68 [STD-PIN] ARDUINO_UNO pins
- hal/include/hal/ArduinoUnoAliases.h creation
- doc update
2021-03-18 17:01:50 +00:00
jeromecoutant a6c213bb10 [STD-PIN] Replace STDIO_UART_TX by USBTX 2021-03-18 17:01:50 +00:00
Martin Kojtal 4e0d07d50f
Merge pull request #12897 from kjbracey-arm/tickeropt
Optimise mbed_ticker_api.c
2020-11-30 16:15:37 +00:00
pea-pod 507181d262 Change MBED_STATIC_ASSERTs version for built-in 2020-10-27 08:30:40 -05:00
rogeryou 48524f25ae add opsi driver 2020-09-16 11:27:23 +08:00
Kevin Bracey 65bc41a96b Optimise mbed_ticker_api.c
The generic code in mbed_ticker_api.c uses run-time polymorphism to
handle different tickers, and has generic run-time calculations for
different ticker widths and frequencies, with a single special-case for
1MHz.

Extend the run-time special casing to handle any conversion cases where
either the multiply or divide can be done as a shift. This is a speed
optimisation for certain platforms.

Add a new option `target.custom-tickers`. If turned off, it promises
that only USTICKER and LPTICKER devices will be used. This then permits
elimination and/or simplification of runtime calculations, saving size
and speed. If either both USTICKER and LPTICKER have the same width, or
same period numerator or denominator, or only one of them exists, then
operations can be hard-coded. This is a significant ROM space saving,
and a minor speed and RAM saving.

We get to optimise all the calculations, but the run-time polymorphism
is retained even if there is only one ticker, as it doesn't
significantly affect code size versus direct calls, and the existence of
lp_ticker_wrapper and various us_ticker optimisations requires it, even
if only LPTICKER is available.
2020-09-14 13:25:10 +03:00
Antti Kauppila c1dd8b9acd redundant code combined 2020-09-14 13:25:06 +03:00
Rajkumar Kanagaraj 993ed3b975 Refactor hal directory 2020-08-25 14:57:07 +01:00