Commit Graph

404 Commits (dc5b9fba09222ed3343b76d0d9ee412870cd8a4f)

Author SHA1 Message Date
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
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
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
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