Commit Graph

1293 Commits (b6ebfeea2c82c4c7f6b22ced1228ea0932f63d44)

Author SHA1 Message Date
Martin Kojtal ba7b4799f9
Merge pull request #11439 from hugueskamba/hk-remove-unreachable-statement-warnings
Remove unreachable statements warnings
2019-09-26 14:35:44 +02:00
Hugues Kamba 5724c4cf39 Remove unreachable statements warnings
The warnings are observed when building with the IAR toolchain.
2019-09-23 11:58:49 +01:00
Martin Kojtal 99c19b5288
Merge pull request #10940 from mjm2017/master
Deinitialize the pin definition
2019-09-20 14:18:37 +02:00
Mariwan 358df27c30
Remove Note as requested 2019-09-16 21:46:12 +02:00
Hugues Kamba de231b8664 Move USB Templates to `mbed-os/hal/usb` 2019-08-16 15:42:43 +01:00
Martin Kojtal 69bfc3460b
Merge pull request #11157 from mprse/us_ticker_freq_fix
Relax us ticker frequency requirement + test update
2019-08-13 11:02:16 +02:00
Hugues Kamba c6b0a1488b Fix Ethernet driver build (#11096)
Include the missing header file inclusion to find the added
MBED_DEPRECATED macro.
2019-08-02 12:23:47 +01:00
George Psimenos df5baf6031 USB public APIs cleanup (#11034)
The contents of the usb directory were moved to appropriate locations and the usb directory removed.

* Public USB headers moved under drivers/
* Internal USB headers moved under drivers/internal/
* USB Source code moved under drivers/source/usb/
* Moved usb/device/hal/ under hal/usb/
* Moved usb/device/USBPhy/ under hal/usb/
* Merged usb/device/targets/ into targets/
* Separated public and private USB API documentation under Doxygen groups drivers-public-api and drivers-internal-api.
2019-08-02 12:23:47 +01:00
Hugues Kamba bfa1b4dd84 Drivers/Events/RTOS Public and internal APIs cleanup (#10955)
Separate drivers, events, and rtos internal APIs from public APIs.

* Move source files to source subdirs
* Move internal headers to internal subdirs
* Add Doxygen comments for documenting internal and public APIs
* Remove source code from header files in order to remove include pre-processor directives
that included header files not directly used by said header files
* Explicitly include header files instead of implicit inclusions via third-party header files.

Release Notes

This will break user code that was using an internal API as the internal header files have been moved.
This will only break if the user was including the header file using a namespace (i.e #include "foo/bar.h" instead of #include "bar.h"
2019-08-02 12:23:47 +01:00
Przemyslaw Stekiel 13dff4ae3d Relax us ticker frequency requirement.
This change is required by the Samsung S111(S5JS100). On this board timer clock used for us ticker operates at 26MHz.
According to current requirements, 8 MHz is the top limit for us ticker timer.

This change relaxes top limit to 100 MHz, but only for 32-bit timers.

Ticker common layer schedules one interrupt per timer rollover to trace elapsed time. We need to ensure that this operation is not performed too frequently. I.e. in case of 16-bit timer at 32 MHz, the timer rollover will happen after ~2 ms. This may cause that there will be no time for other tasks. That is why we increase the top limit, but only for 32-bit timers.
2019-08-02 13:13:38 +02:00
Filip Jagodzinski bd5ecaadcd Add HAL API for GPIO-IRQ pinmap 2019-07-25 10:56:04 +02:00
Seppo Takalo 3d5489a6f8
Merge pull request #10644 from fkjagodzinski/hal-gpio_pinmap
Add a gpio pinmap
2019-07-17 14:39:40 +03:00
Seppo Takalo 0425ffda9b
Merge pull request #11026 from c1728p9/skip_peripherals
Add a restricted peripheral list
2019-07-17 14:32:08 +03:00
Russ Butler 57d75538da Add a restricted peripheral list
Allow peripherals to be excluded from testing.
2019-07-11 16:08:33 +01:00
Filip Jagodzinski 07baf079b9 HAL: Serial: Add DEVICE_SERIAL_FC guards
Functions related to serial flow control should not be exposed
if DEVICE_SERIAL_FC is not defined
* serial_set_flow_control,
* serial_cts_pinmap,
* serial_rts_pinmap.
2019-07-09 10:53:08 +02:00
Martin Kojtal ccb63d771e
Merge pull request #10857 from ARMmbed/feature-watchdog
Add Watchdog and ResetReason
2019-07-03 11:43:52 +01:00
Martin Kojtal 85c477c1dc
Merge pull request #10609 from kjbracey-arm/us_ticker_optimise
wait_us optimization
2019-06-28 14:29:00 +01:00
Amanda Butler 9d5757eb52 Edit watchdog_api.h
Edit file, mostly for active voice, consistent tense and international spelling.
2019-06-27 09:26:42 +01:00
Amanda Butler bd5de8d769 Edit reset_reason_api.h
Edit file, mostly for correct grammar.
2019-06-27 09:23:45 +01:00
Martin Kojtal fa76620afd watchdog hal: remove space 2019-06-26 14:03:11 +01:00
Martin Kojtal 9cf7a9a327 watchdog: fix astyle issue
Missing a space after group and before license
2019-06-26 11:32:18 +01:00
Filip Jagodzinski 9935bdcb72 HAL: Watchdog: Update the header file
Minor doxygen fixes.
2019-06-26 09:58:31 +01:00
Filip Jagodzinski f084bd5a9d HAL: ResetReason: Update the header file
Add defined & undefined behavior.
Minor doxygen fixes.
2019-06-26 09:58:18 +01:00
Martin Kojtal e40a76575f watchdog: fix copyright 2019-06-26 09:43:21 +01:00
Filip Jagodzinski a33536e78e HAL: Watchdog: Update the header file
Add a SPDX license identifier.
Add defined & undefined behavior.
2019-06-26 09:09:59 +01:00
Martin Kojtal 6229322c64
Merge pull request #10846 from bulislaw/crc_doxy
MbedCRC doxygen fixes
2019-06-25 11:09:43 +01:00
Bartek Szatkowski 9e2b516bca Fix doxygen for MbedCRC 2019-06-17 10:21:33 +01:00
Kevin Bracey 57310729d4 wait_us optimization
As the timer code became more generic, coping with initialization on
demand, and variable width and speed us_ticker_api implementations,
wait_us has gradually gotten slower and slower.

Some platforms have reportedly seen overhead of wait_us() increase from
10µs to 30µs. These changes should fully reverse that drop, and even
make it better than ever.

Add fast paths for platforms that provide compile-time information about
us_ticker. Speed and code size is improved further if:

* Timer has >= 2^32 microsecond range, or better still is 32-bit 1MHz.
* Platform implements us_ticker_read() as a macro
* Timer is initialised at boot, rather than first use

The latter initialisation option is the default for STM, as this has
always been the case.
2019-06-14 10:22:08 +03:00
Przemyslaw Stekiel 869585a196 Ticker common layer: run interrupt reschedule if the inserted event has already expired.
On some platforms, if low power ticker interrupt is set to very close value (e.g. timestamp < current tick + 3), then interrupt may not fire. This is one use case of lp ticker wrapper, but not all platforms use the wrapper. Some platforms cheat a bit and in this case, simply schedules interrupt a bit later. The problem has been found while working on the low-level lp ticker wrapper for ST boards which run lp ticker using LPTIM. These platforms have such limitation.

Failing test: tests-mbed_drivers-lp_timeout (Test Case: Zero delay)

In the test scenarion, the lp ticker callback is attached with 0.0 s delay in the loop. The new events are put in the front of the lp ticker event list and interrupt reschedule is performed. Usually, the new event is already expired, interrupt fires immediately and next event from the list is then scheduled (e.g. system tick). When the next event (e.g. system tick) is very close to the current time it might be scheduled a bit later (because of lp ticker limitation). Let's assume that system tick has been delayed by 3 ticks and while inserting new zero delay event, absolute system tick time on the event list has already expired. In this case, zero delay event may be added after the expired system tick event and no reschedule is performed (because the head of the list has not changed). Interrupt also didn't fire yet since it has been delayed, so after return from attach_callback(0) we are still waiting for the delayed interrupt and zero delay callback has not been called instantly.

This may also affect other platforms which use such delays (Cypress, NORDIC, etc.).

The proposition is to add extra condition while adding an event to the event list. If the inserted event is already expired, then perform reschedule immediately.
2019-06-04 08:50:22 +02:00
Filip Jagodzinski 63fd9f9488 Provide a default gpio_pinmap() for arduino_ff 2019-05-24 16:36:56 +02:00
Donatien Garnier 91ef36809f Apply new astyle config style 2019-05-24 12:23:36 +02:00
Steven Cartmell bafe99ced3 Add text to watchdog documentation indicating that it will continue to run in sleep modes 2019-05-24 11:35:35 +02:00
Bartek Szatkowski f3c6c569d1 Document reset reason enum 2019-05-24 11:35:31 +02:00
Bartek Szatkowski 808ccaf12e Add definition of reset reason and watchdog doxy groups 2019-05-24 11:35:25 +02:00
Steven Cartmell 7c392a16d4 Remove window and sleep mode options for watchdog API 2019-05-24 11:35:13 +02:00
Steven Cartmell 8fa38bb25b Add Watchdog driver API 2019-05-24 11:20:26 +02:00
Steven Cartmell 3c18dcb882 Amend reset reason driver API
- Change API to match C++ API throughout drivers
- Amend HAL API documentation to be more specific
2019-05-24 11:20:26 +02:00
Steven Cartmell 6b3d790fc1 Add function to fetch platform specific reset reason register values 2019-05-24 11:20:24 +02:00
Steven Cartmell 41878bc3de Add Reset Reason platform API 2019-05-24 11:20:23 +02:00
Steven Cartmell 8a97101988 Fix watchdog API issues
- Fix typo in module comment
- Redefine the default system behaviour in sleep mode
- Guard K64F enableWait flag
- Remove bit shifts from reset reason enum
2019-05-24 11:20:22 +02:00
Steven Cartmell c258acc222 Add simple watchdog reference implementation for K64F
- Add preprocessor guard to watchdog api that errors if the reset reason api is not also implemented
- Add RESET_REASON and WATCHDOG to K64F targets.json
- Add watchdog reference implementation
2019-05-24 11:20:21 +02:00
Steven Cartmell 7fe3a387e3 Add Watchdog HAL API specification headers
HAL watchdog functionality will be implemented as two separate APIs. The reset
reason API allows a user to detect the last system reset reason to identify if
a Watchdog was triggered. The Watchdog API allows configuring and updating
Watchdog timers on all boards. This commit defines the headers.
2019-05-24 11:20:20 +02:00
Filip Jagodzinski a6eb48c2de Add HAL API for GPIO pinmap 2019-05-23 14:29:26 +02:00
Kevin Bracey 66f446b9a9 Add GPIO NC test
Check two items of defined behaviour - that you can initialise a
gpio_t with NC, and you can detect that state with gpio_is_connected().
2019-05-02 16:12:21 +03:00
Kevin Bracey ad1acf9af7 gpio_api.h: Clarify desired behaviour for NC
It would probably be worth adding tests for the ability to initialise NC
pins and check `is_connected`. Some platforms are assert failing the
init, and can't be 100% sure `is_connected` is working on those
platforms either.
2019-05-02 12:16:34 +03:00
Cruz Monrreal ab22ab8ce3
Merge pull request #10150 from kjbracey-arm/timer_sleepcheck
Timer: remove hard-coded lp_ticker knowledge
2019-03-28 17:09:36 -05:00
Michael Schwarcz 568feaf7da Remove dependency on us_ticker HAL apis for non USTICKER targets
- Surround mbed_us_ticker_api.c with if DEVICE_USTICKER
- get_us_ticker_data() returns NULL for non-usticker targets.
2019-03-26 09:52:17 +02:00
Kevin Bracey 534a3d2333 Timer: remove hard-coded lp_ticker knowledge
The knowledge that lp_ticker runs in deep sleep was hard-coded with a
comparison check of a ticker_data_t pointer against get_lp_ticker_data.

Remove this hard-coded check, which adds a linker dependency against
the low power ticker even if not being used - put a flag into the
ticker_interface_t.

A future extension might be to move this flag into the ticker_info_t
provided by the HAL, but for the moment keep the assumption that
lp_ticker does run, us_ticker doesn't.
2019-03-20 10:18:49 +02:00
Kevin Bracey b12be6bb80 Rename SPI_COUNT to DEVICE_SPI_COUNT
Avoid collision with some HALs that already define SPI_COUNT.
2019-03-01 14:37:04 +02:00
Kevin Bracey df7e3367f7 Cope with HALs not defining SPIName 2019-03-01 14:33:34 +02:00