Commit Graph

495 Commits (ec839f0931a69bb22566188f9477cfc3f6adb97e)

Author SHA1 Message Date
Hugues Kamba b8bcc7face PwmOut: Add unit test 2019-11-01 09:35:41 +00:00
Martin Kojtal 2203549b37
Merge pull request #10924 from ghseb/free-serial-resources-2
Free serial resources if not needed anymore
2019-10-30 09:45:22 +01:00
Mike Naberezny 6be96ba4b2 FlashIAP: Get erase value from HAL instead of hardcoding it 2019-10-26 14:11:42 -07:00
Sebastian Stockhammer 1c907e6db9 Update deep sleep locks according to enabled state 2019-10-24 12:53:52 +02:00
Sebastian Stockhammer a3107062d9 Call correct method 2019-10-24 10:24:36 +02:00
Sebastian Stockhammer e72468c037 Handle undefined DEVICE_SERIAL_FC 2019-10-24 10:24:36 +02:00
Sebastian Stockhammer c31a360271 Fix spelling 2019-10-24 10:24:36 +02:00
Sebastian Stockhammer 9e97037316 Fix astyle 2019-10-24 10:24:35 +02:00
Sebastian Stockhammer 31babca1da Retain flow control state 2019-10-24 10:24:35 +02:00
Sebastian Stockhammer aa2969f999 Public SerialBase::enable_input 2019-10-24 10:24:35 +02:00
Sebastian Stockhammer 0a395b6833 Fix astyle 2019-10-24 10:24:35 +02:00
Sebastian Stockhammer e218b5dc19 Free serial resources if not needed anymore 2019-10-24 10:24:35 +02:00
Martin Kojtal 9526dada05
Merge pull request #11691 from kyle-cypress/pr/qspi-no-inst
QSPI: document use of QSPI_NO_INST
2019-10-22 09:45:56 +02:00
Martin Kojtal fe12608226
Merge pull request #11444 from jeromecoutant/PR_QSPI_EXTERNAL
QSPI : Define default pins at drivers level
2019-10-21 15:19:08 +02:00
Martin Kojtal b6266b5c01
Merge pull request #11604 from kyle-cypress/pr/qspi-inst-type
Introduce qspi_inst_t type for QSPI instructions
2019-10-18 15:46:03 +02:00
Hugues Kamba a9496ad9f7 PmwOut: Add methods to suspend and resume PWM
It is now possible to temporarily suspend PWM and safely preserve the duty
cycle set. This functionality is needed to allow a device to enter deep
sleep as a PWM instance prevents deep sleep in order for the timer it
relies on to run so its output can be modified. The duty cycle configuration
can be restored upon resuming from deep sleep.
2019-10-17 09:21:38 +01:00
Martin Kojtal e2578db2f8
Merge pull request #11635 from hugueskamba/hk-fix-deepsleep-usb-components
USBDevice: add documentation on USB suspend/resume to enter deep sleep
2019-10-17 09:21:50 +02:00
Kyle Kearney 555140a1cc Change qspi_inst_t typdef to int
Existing code may a dependency on the old behavior of "-1" to
mean "no instruction". Therefore, update the typedef, and the value
of QSPI_NO_INST, to avoid breaking those uses.
2019-10-16 15:31:12 -07:00
Matthew Macovsky b1916fc498 Introduce qspi_inst_t type for QSPI instructions
Encourage the usage of consistent types (there are currently
 a mix of `int` and `unsigned int` used for qspi instructions)
QSPI commands are limited to 8 bits, to this is a typdef to char
2019-10-16 15:31:11 -07:00
Kyle Kearney 27dc79af08 QSPI: document use of QSPI_NO_INST
Add comments to functions that can take a qspi_inst_t about the value
that will cause the instruction phase to be skipped entirely.
2019-10-15 14:57:49 -07:00
jeromecoutant bec463d520 QSPI : Define default pins at drivers level
Now, these pins can be used everywhere (MBED_CONF_DRIVERS_QSPI_xxx)
and be redefined in local mbed_app.json
(no more need to patch PinNames.h file)
2019-10-15 17:36:49 +02:00
Hugues Kamba a3f20f858b USBDevice: add documentation on USB suspend/resume to enter deep sleep
It is possible to temporarily suspend USB and safely preserve its
configuration. This is needed to allow a device to enter deep
sleep as a USBDevice instance prevents deep sleep. USB operation can be
suspended with `deinit` and restored with `connect`.
2019-10-11 08:41:07 +01:00
Matthew Macovsky baf375f8cb Allow for arbitrary QSPI alt sizes
The QSPI spec allows alt to be any size that is a multiple of the
number of data lines. For example, Micron's N25Q128A uses only a
single alt cycle for all read modes (1, 2, or 4 bits depending on
how many data lines are in use).
2019-09-30 14:45:08 -07:00
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
Martin Kojtal ab857c4963
Merge pull request #11478 from hugueskamba/hk-fix-some-more-warnings
Refactor CRC constructor method to remove warning
2019-09-25 10:11:37 +02:00
Martin Kojtal 07ebd92f7b
Merge pull request #11494 from hugueskamba/hk-fix-coverity-iotcore-1334
Fix Coverity issue: Initialize FlashIAP non-static member in constructor
2019-09-24 14:58:29 +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 e6d9d515e4
Merge pull request #11523 from hugueskamba/hk-correct-force-inline-syntax-for-iar
Correct force inline syntax for IAR compiler
2019-09-20 14:19:05 +02:00
Martin Kojtal 99c19b5288
Merge pull request #10940 from mjm2017/master
Deinitialize the pin definition
2019-09-20 14:18:37 +02:00
Hugues Kamba e2aeb601f1 Correct force inline syntax for IAR compiler
Unlinke other compilers supported, the IAR compiler requires the
pre-processor extension to force inline a method to be placed before
the keyword `template` if the method is declared with one.
2019-09-19 13:20:13 +01:00
Hugues Kamba 5bfb5bf269 Remove `statement is unreachable` warning in MbedCRC.h
The code removed appears unnecessary given that the switch case below
also handles the case where the polynomial is `POLY_32BIT_REV_ANSI`
2019-09-19 10:56:07 +01:00
Martin Kojtal 6fcd29769c
Merge pull request #11470 from hugueskamba/hk-fix-warnings
Prevent unreachable statements and correct variable sizes.
2019-09-19 10:36:39 +02:00
Martin Kojtal eed80f99ee
Merge pull request #11452 from Tharazi97/Coverity_USBMSD
Coverity changes in USBMSD.cpp
2019-09-18 13:34:05 +02:00
Hugues Kamba 8ea9acad8e Fix Coverity issue: Initialize FlashIAP non-static member in constructor 2019-09-17 09:55:37 +01:00
Mariwan 5b951d4ef4
Update AnalogOut.h 2019-09-16 22:06:04 +02:00
Mariwan 47c3083bdd
remove extra space 2019-09-16 21:57:56 +02:00
Hugues Kamba 2163d07401 Prevent unreachable statements and correct variable sizes. 2019-09-12 11:51:26 +01:00
Hugues Kamba e12400932d Fix Coverity issues
Issues fixed are related to:
* Non-static class member initialization in constructors
* Unused function return value
* Always false statements
2019-09-11 11:27:27 +01:00
int_szyk d592b8c08f Coverity changes in USBMSD.cpp 2019-09-11 09:41:23 +02:00
Martin Kojtal 4c3b65dc54
Merge pull request #11449 from Tharazi97/Coverity_USBDevice
Coverity changes in USBDevice.cpp
2019-09-10 19:30:40 +02:00
Martin Kojtal 13c1274293
Merge pull request #11447 from Tharazi97/Coverity_USBHID
Coverity changes in USBHID.cpp
2019-09-10 19:20:51 +02:00
int_szyk 68bbcb1ee6 Coverity changes in USBDevice.cpp 2019-09-10 14:46:49 +02:00
int_szyk 9280392020 Coverity changes in USBHID.cpp 2019-09-10 12:34:47 +02:00
Hugues Kamba 5933dec3b7 Harmonise Doxygen comments in drivers, events, platform and rtos dirs
When a Doxygen group has been defined (created), all its needed to add
documentation to that group is `\addtogroup`. Since all the information
about the group is preserved, it is not necessary to mention the group
hierarchy again with `\ingroup`. This PR removes unnecessary Doxygen lines
across the `drivers`, `events`, `platform` and `rtos` directories.

It also ensures that new groups are created with `\defgroup` once and
referenced with `\addtogroup` whenever documentation needs to be added to
an existing group.
2019-09-09 10:59:51 +01:00
Hugues Kamba 9715587042 Remove extraneous parentheses. 2019-09-03 09:58:08 +01:00
Martin Kojtal 17fd7956ba
Merge pull request #11136 from facchinm/avoid_derive_needed_usbdevice
USBDevice: Avoid forcing end device to be derived from USBDevice class
2019-08-23 15:45:41 +02:00
Martin Kojtal 28daa3f0a3
Merge pull request #11260 from rvasquez6089/master
Typo in USBSerial.h function prevents compilation
2019-08-22 11:08:05 +02:00
Martino Facchin 84e228a48f Allow USB endpoint_add to accept mbed::Callback
In this way we can use the USBDevice infrastructure without deriving directly from USBDevice.
2019-08-21 15:22:06 +02:00
Ryan Vasquez 7267299bd9 corrected the Callback function call in attach, minor type in the USBserial library 2019-08-19 12:23:50 -05:00
Hugues Kamba 7ec84a89d1 Include `mstd_utility` to get in front of the ARMC5's built-in `utility` 2019-08-19 16:13:14 +01:00
Hugues Kamba 9cc816d6a0 Un-templatise interval and forward the reference
Also fix code style to please style checker
2019-08-19 16:13:14 +01:00
Hugues Kamba e06c91c7ae Use Perfect forwading to pass arguments from `attach()` to `attach_us()`
This prevents a possible heavy callback copy.
2019-08-19 16:13:14 +01:00
Hugues Kamba 5635e94af5 Force inline Timer::attach() to get rid of floating-point instruction
Calls to Timer::attach() are inlined in order not to use floating-point
library functions calls given Timer::attach_us() expects an integer
for the callback interval.
2019-08-19 16:13:14 +01:00
Hugues Kamba b0d4b69123 Ensure the new method is called by the deprecated one 2019-08-19 16:13:14 +01:00
Hugues Kamba 59a6b55c64 Fix code indentation to satisfy code style checker 2019-08-19 16:13:14 +01:00
Hugues Kamba 61b1482b12 Add new API method `attach_s` instead of overloading the deprecated `attach` 2019-08-19 16:13:14 +01:00
Hugues Kamba ce5dbda1ba Move time macro conversions to `Ticker.h` 2019-08-19 16:13:14 +01:00
Hugues Kamba 4b1cee3cf3 Deprecate previous Ticker::attach() API
* Restore previous implementation as deprecated
* Ensure method call is unambiguous
2019-08-19 16:13:14 +01:00
Hugues Kamba e1714ec53a Require integer to specify callback interval with Ticker API
* Create new `s_timestamp_t` type to specify timestamp is seconds
* Alter `attach()` API to expect `s_timestamp_t` for interval value
* Create helper macro to convert seconds to milliseconds and help code
  readability
* Modify Greentea tests accordingly
2019-08-19 16:13:14 +01:00
Mariwan 656f4b8adf
Update AnalogOut.h 2019-08-12 20:12:36 +02:00
Martino Facchin 2b226bfdd8 Use unique include for Stream.h 2019-08-08 14:32:09 +02:00
Hugues Kamba df85e8e233 Mark Ethernet.h methods as Deprecated in Doxygen documentation (#11146) 2019-08-02 12:32:40 +01:00
Hugues Kamba f0f408b2d8 Upstream PR #11073 review request changes (#11135)
* Modify Doxygen grouping of `drivers` Public/Internal APIs
* Correct classification of `mbed_events.h`
* Amend name of Doxygen group containing Device Key API
* Classify `CallChain.h` as public API and relocate file
* Remove Doxygen group from `equeue_platform.h` as it has no Doxygen compliant documentation
* Move USB target specific code back to `usb/device/targets`
2019-08-02 12:32:40 +01:00
George Psimenos 3b23edb78c Fix CI for branch feature-public-headers (#11093)
* Fix rtos include path in NRFCordioHCIDriver
* Flatten USB driver directory structure
* Add missing include for us_ticker
* Add more missing includes for us_ticker
* Fix mbed_hal_fpga_ci_test_shield/uart test
* Fix bare-metal build
* Fix Watchdog UNITTEST
* Fix Mbed OS 2 build for Public/Internal headers relocating
2019-08-02 12:32:40 +01:00
Hugues Kamba 20f81e19be Change Doxygen groups structure, splitting first by Public/Internal (#11105)
* Change Doxygen groups structure, splitting first by Public/Internal

This commit also does the following:
* groups the documentation of related API
* moves `events/internal/equeue.h` to `events/equeue.h`
* merges `events/source/README.md` to `events/README.md`
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 83354e46a7 Platform: Separate internal APIs from public APIs
Also includes:
* rename `mbed_sleep_manager.c` to `mbed_power_mgmt.c` to match its
  header file
* create Doxygen groups for public and internal APIs
* use relative path to include header files where inconsistent
* update references to internal APIs throughout libraries
* update the copyright year for all modified files
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
Kevin Bracey 0bb4c050b7 SingletonPtr: API extensions, make constexpr
* Adjust definition to make the default constructor `constexpr`.
  This permits use in classes that want lazy initialization and their
  own `constexpr` constructor, such as `mstd::mutex`.

* Add `get_no_init()` method to allow an explicit optimisation for
  paths that know they won be the first call (such as
  `mstd::mutex::unlock`).

* Add `destroy()` method to permit destruction of the contained object.
  (`SingletonPtr`'s destructor does not call its destructor - a cheat
  to omit destructors of static objects). Needed if using in a class
  that needs proper destruction.
2019-07-18 20:02:04 +03:00
Kevin Bracey fc8e8f67c6 Deprecate wait/wait_ms APIs 2019-07-15 10:13:50 +03:00
Filip Jagodzinski 0f3f38e512 Watchdog: Fix astyle in doxy 2019-07-04 10:49:24 +02:00
Amanda Butler ec53d1d9c8
Edit Watchdog.h
Edit file to address comments and for consistent tense and voice.
2019-07-03 17:43:51 -05:00
Filip Jagodzinski 6f8266c02f Watchdog: Clean up the doxygen comments 2019-07-03 15:28:37 +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
mjm2017 c6fbcb4efe
Update AnalogOut.h 2019-07-03 06:51:04 +02:00
Martin Kojtal e12125bb25 Watchdog: start without arg uses max timeout from a target 2019-07-02 12:46:23 +01:00
Martin Kojtal 25fbd3956b Watchdog: remove VirtualWatchdog
We will provide documentation how to create your own VirtualWatchdog. It's simple,
create timeout and watchdog objects.

This class brought lot of discussion and questions. After our refactor we made this class
just a linked list of objects - something tickers can do as well (they already have linked list) and handling hw should be
done via Watchdog due to the limitations (timeout can be set only once per app!).
2019-07-02 12:46:23 +01:00
Martin Kojtal dc4d4a32f4 VirtualWatchdog: use timeout in ctor to set hw timeout
No config, neither additional parameter - the first instance of the class initalizes the peripheral.
2019-07-02 12:46:23 +01:00
Martin Kojtal fd445a57cb Watchdog: remove config value for timeout, set it dynamically
Use start method to set timeout
2019-07-02 12:46:23 +01:00
Martin Kojtal 6313e530b3 VirtualWatchdog: provide hw timeout via ctor 2019-07-02 12:46:23 +01:00
Martin Kojtal 7b341847c4 VirtualWatchdog: add comment about exclusive access to Watchdog 2019-07-02 12:46:23 +01:00
Martin Kojtal 29842f98a0 VirtualWatchdog: fix doxygen ingroup and ctor 2019-07-02 12:46:23 +01:00
Martin Kojtal dc2e8ab35e Watchdog: add docs update about intention one vs multiple Watchdogs
VirtualWatchdog - multiple timers in the system - most used watchdog
Watchdog - simple driver for one system timer in the app - bootloader or similar
2019-07-02 12:46:23 +01:00
Filip Jagodzinski a810ef807f Watchdog: Fix timeout constraints
Update the start method to check 0 < timeout <= max_timeout.
2019-07-02 12:46:23 +01:00
Filip Jagodzinski cc7a3dd677 Fix more unittest errors 2019-07-02 12:46:23 +01:00
Martin Kojtal ff0652830a Watchdog: fix space in code example 2019-07-02 12:46:23 +01:00
Martin Kojtal 188655f929 Watchdog: example code - add kick() 2019-07-02 12:46:23 +01:00
Martin Kojtal 6b26b23d7b virtualWatchdog: fix alignment for tickers and one space 2019-07-02 12:46:23 +01:00
Martin Kojtal 72582b0622 virtualWatchdog: fix alignment for tickers 2019-07-02 12:46:23 +01:00
Martin Kojtal 2c6357b098 VirtualWatchdog: fix missing kick and init check in process
Also syntax error for ticker definitions.
2019-07-02 12:46:23 +01:00
Martin Kojtal bb473d916e Watchdog: keep it simple - providing simple driver functionality
No callbacks or tickers. User is handling kick() method directly based on timeout set.
VirtualWatchdog manages ticker and callback.
2019-07-02 12:46:23 +01:00
Martin Kojtal 28398e6254 Watchdog: fix include paths - use module name 2019-07-02 12:46:23 +01:00
Martin Kojtal a63a54680c VirtualWatchdog: fix default timeout value (1ms is unreal) 2019-07-02 12:46:23 +01:00
Martin Kojtal 88a9548167 VirtualWatchdog: fix name for member timeout 2019-07-02 12:46:23 +01:00
Martin Kojtal a18ba70c1b VirtualWatchdog: fix is hw init definition 2019-07-02 12:46:23 +01:00
Martin Kojtal 61f859b514 VirtualWatchdog: add config option to ctor to clarify the hw timeout 2019-07-02 12:46:23 +01:00
Martin Kojtal 9f48f26876 Watchdog: fix timeout - use full range for watchdog 2019-07-02 12:46:23 +01:00
Martin Kojtal b822c09b3b Watchdog: fix callback - uses ms 2019-07-02 12:46:23 +01:00
Martin Kojtal 0519caebe1 VirtualWatchdog: fix doxygen docs errors 2019-07-02 12:46:23 +01:00
Martin Kojtal 581bf208ad Watchdog: refactor timeout handling
Enable kicking directly by kick() and handle timeout by using private handler.
2019-07-02 12:46:23 +01:00