Commit Graph

761 Commits (master)

Author SHA1 Message Date
Maciej Bocianski ac105f5a18 update USBMSD::infoTransfer implementation
Fix protects underlaying block device from out-of-bound read/writes
 - prevents the host from setting block device addres larger then block device size
 - prevents the host from setting wrong read/write lenght
2020-03-24 21:28:23 +01:00
Dustin Crossman 1e000bb9ae QSPI driver also acquires ownership upon initialization now. 2020-03-23 12:11:47 -07:00
Anna Bridge 4a5fac34a1
Merge pull request #12528 from VeijoPesonen/sfdp_split_5
SFDP: consolidation of SFDP parsing [5/5]
2020-03-20 16:26:39 +00:00
Anna Bridge 197e1d2daa
Merge pull request #12649 from rajkan01/unbuffered_serial_member_expose
Expose SerialBase IrqType member to UnbufferedSerial class
2020-03-20 15:21:12 +00:00
Anna Bridge d048cd4c83
Merge pull request #12410 from rajkan01/serial_remove_deprecate
Remove the deprecated RawSerial, UARTSerial, Serial
2020-03-20 15:19:32 +00:00
Rajkumar Kanagaraj 3d74a6b167 Expose private SerialBase IrqType member to UnbufferedSerial class 2020-03-18 09:49:20 -07:00
Veijo Pesonen b89e60ba8f SFDP: code readability improvements 2020-03-17 17:48:39 +02:00
Veijo Pesonen eb01afb198 SFDP: fixes a trace print
Indexing runs from highest to lowest, not other way round.
2020-03-17 17:48:39 +02:00
Veijo Pesonen e04a1a4017 SFDP: adds traces to identify known SFDP headers 2020-03-17 17:48:39 +02:00
Veijo Pesonen 43289c74ce SFDP: converts to smart pointers
C++14-ify memory allocation.
2020-03-17 17:43:09 +02:00
Veijo Pesonen e40ce82fee SFDP: Sector Map Parameter Tbl parsing refactored
Making search for common erase type between regions more clear
2020-03-17 17:43:09 +02:00
Veijo Pesonen 19c9735a9f Bugfix: SFDP Sector Map Param Tbl size is variable
Earlier it was assumed that the table has a certain max length but that
isn't true.
2020-03-17 17:43:09 +02:00
Veijo Pesonen a088d30b6d SFDP: whitespace cleanup 2020-03-17 17:43:09 +02:00
Anna Bridge 5aab4c4f11
Merge pull request #12524 from VeijoPesonen/sfdp_split_4
Bugfix: Concurrent SFDP header address init fixed
2020-03-06 13:57:07 +00:00
Martin Kojtal ea3761f38d
Merge pull request #12531 from dustin-crossman/pr/flashiap_fix
Add check so that FlashIAP does not allocate memory on flash_init failure
2020-03-05 15:36:57 +00:00
Rajkumar Kanagaraj df32091c7b Remove the deprecated RawSerial, UARTSerial, Serial class and SerialBase attach API 2020-03-03 05:19:42 -08:00
Martin Kojtal a937d30501
Merge pull request #12511 from paul-szczepanek-arm/patch-1
allow reconfiguring a running watchdog
2020-03-03 13:00:45 +00:00
Veijo Pesonen 98dbebb3ed SFDP: Refactor Sector Map Parameter Table parsing
Doxygen documentation was updated.

Code reorganized to make it more readable.

Moves SFDP specific bits out from Q/SPIFBlockDevices.
2020-03-02 11:07:03 +02:00
Veijo Pesonen c84deff782 SFDP: consolidates check for addressability
Takes implementations found from SPIFBlockDevice and QSPIFBlockDevice
and makes those as part of the SFDP module.
2020-03-02 11:04:05 +02:00
Veijo Pesonen 2ce3bed910 SFDP: consolidates device density detection
Combines implementations found from SPIFBlockDevice and QSPIFBlockDevice
and makes it as part of the SFDP module.
2020-03-02 11:02:09 +02:00
Dustin Crossman 2f97c2d747 Add check so that FlashIAP does not allocate memory on flash_init failure. 2020-02-28 09:58:25 -08:00
Martin Kojtal 0286e3c325
Merge pull request #12525 from rajkan01/ticker_remove_deprecated
Remove the deprecated Ticker APIs
2020-02-28 09:52:22 +00:00
Martin Kojtal 1f36b1cf09
Merge pull request #12450 from VeijoPesonen/sfdp_split_bptbl_2
SFDP: consolidation of SFDP parsing [3/n]
2020-02-27 17:08:14 +00:00
Martin Kojtal c250781de0
Merge pull request #12518 from rajkan01/intin_remove_deprecated
Remove InterruptIn deprecated APIs
2020-02-27 13:23:22 +00:00
Rajkumar Kanagaraj db0bf08e4d Remove the deprecated Ticker APIs 2020-02-27 03:26:12 -08:00
Martin Kojtal 10842f7a57
Merge pull request #12500 from rajkan01/ethernet_remove_deprecate
Remove the deprecated ethernet APIs
2020-02-27 08:46:42 +00:00
Martin Kojtal c966c4242f
Merge pull request #12420 from rajkan01/drivers_remove_deprecate
Remove the deprecated CAN APIs.
2020-02-26 15:09:37 +00:00
Rajkumar Kanagaraj 1002a3ace2 Remove InterruptIn deprecated APIs 2020-02-26 04:22:21 -08:00
Veijo Pesonen c953b656ac SFDP: provides doxygen documentation improvements 2020-02-26 13:44:34 +02:00
paul-szczepanek-arm d19317c64c clarify docs 2020-02-26 11:10:10 +00:00
Martin Kojtal 5969fdf8ef
Merge pull request #12501 from rajkan01/intmgr_remove_deprecated
Remove the deprecated the InterruptManager APIs
2020-02-26 10:49:54 +00:00
Veijo Pesonen ca704a4b3d SFDP: consolidates erase region search
Merges erase region search found from SPIFBlockDevice and
QSPIFBlockDevice. Moves the implementation within the SFDP
component
2020-02-26 12:41:34 +02:00
Paul Szczepanek fdf1c33a1f
allow reconfiguring a running watchdog 2020-02-25 16:12:50 +00:00
Martin Kojtal 32f615e420
Merge pull request #12495 from kjbracey-arm/override_serial
C++11-ify virtualisation in FileHandle + Serials
2020-02-25 16:00:43 +00:00
Martin Kojtal 1c12083949
Merge pull request #12426 from VeijoPesonen/sfdp_split_bptbl
SFDP: consolidation of SFDP parsing [2/n]
2020-02-25 13:57:23 +00:00
Rajkumar Kanagaraj 6eb36f3a8e Remove the deprecated the InterruptManager APIs 2020-02-24 05:32:44 -08:00
Rajkumar Kanagaraj c4a54e38cb The `Ethernet` APIs are no longer supported, so removed header and cpp files and its dependency. 2020-02-24 05:23:21 -08:00
Rajkumar Kanagaraj 692f0a2f24 Removed CAN deprecated APIs 2020-02-24 05:02:15 -08:00
Kevin Bracey c39959ca8b C++11-ify virtualisation in FileHandle + Serials
Use `override` and `final` where appropriate, and eliminate unnecessary
`virtual`.
2020-02-24 10:37:17 +02:00
Anna Bridge 8c17270306
Merge pull request #12480 from 0xc0170/fix_spdx
Fix SPDX identifiers and licenses (excluding features and targets)
2020-02-21 16:34:30 +00:00
Martin Kojtal f1887e875f drivers: fix SDPX identifiers 2020-02-21 07:00:56 +00:00
Veijo Pesonen de22648e76 SFDP: refactoring traces and defines 2020-02-20 09:46:41 +02:00
Veijo Pesonen 107f003af6 SFDP: sanitizes API 2020-02-20 09:46:41 +02:00
Veijo Pesonen 6a60574cf5 SFDP: consolidates sfdp_detect_erase_types_inst_and_size 2020-02-20 09:46:40 +02:00
Veijo Pesonen 2da963b8de Q/SPIFBlockDevice: unifies _sfdp_detect_erase_types_inst_and_size functions 2020-02-20 09:46:40 +02:00
Veijo Pesonen 7d1886ecae SFDP: consolidation of sfdp_detect_page_size 2020-02-20 09:46:40 +02:00
Martin Kojtal 829a3cded3
Merge pull request #12318 from VeijoPesonen/sfdp_split_smptbl
SFDP: Move Sector Map Parameter Table parsing under SFDP module
2020-02-19 15:49:40 +00:00
daniel-starke cb62dcbf83 CAN: fix length calculation in message constructor
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.
2020-02-17 22:00:42 +01:00
Martin Kojtal f8808384d3
Merge pull request #12389 from 1sadiqsa0/1sadiqsa0-patch-1
Update InterruptIn.h
2020-02-10 12:59:12 +00:00
Martin Kojtal 4e70d04a57 Merge pull request #12382 from hugueskamba/hk-fix-bufferedserial-exposed-enums
Fix BufferedSerial visibility of private base class enum enumerators
2020-02-10 10:54:08 +00:00
Shaik Abdul Sadiq 9eb9011861
Update InterruptIn.h
Falling edge doc correction.
2020-02-07 16:51:02 +05:30
Veijo Pesonen e784c15c9e SFDP: doxygen improvements 2020-02-07 09:52:12 +02:00
Veijo Pesonen ba71b09902 astyle fixes 2020-02-07 09:52:12 +02:00
Veijo Pesonen 4f4ef6069e SFDP: Sector Map Parameter Table naming improvements 2020-02-07 09:52:12 +02:00
Veijo Pesonen 57722666a1 SPIFBlockDevice: Consolidates SFDP info data
This far all SFDP Sector Map Table related data has been found in small
pieces inside SPIFBlockDevice. Purpose was to consolidate the data
under one SFDP structure where all the information gathered from
SFDP tables is stored.

More generic version of a function used for parsing a Sector Map Table
was taken into use to avoid duplicate code. The implementation taken
into use is the one which got split from QSPIFBlockDevice and resides
now under the SFDP module.
2020-02-07 09:52:11 +02:00
Veijo Pesonen 83c0fdf19f QSPIFBlockDevice: Sector Map Table parsing moved under SFDP 2020-02-07 09:52:11 +02:00
Veijo Pesonen 7518a35da3 SFDP: data structures got refactored 2020-02-07 09:52:11 +02:00
Veijo Pesonen 6108f384fb QSPIFBlockDevice: Consolidates SFDP info data
This far all SFDP Sector Map Table related data has been found in small
pieces inside QSPIFBlockDevice. Purpose was to consolidate the data
under one SFDP structure where all the information gathered from
SFDP tables is stored.

Parsing a Sector Map Table was made more generic so that later it can be
moved under SFDP module. Once that is done it can be shared with
SPIFBlockDevice to avoid code duplication.
2020-02-07 09:52:11 +02:00
Veijo Pesonen 4e1fb07633 SFDP: reorganizes internal info structure 2020-02-07 09:52:11 +02:00
Hugues Kamba 8910c24fdc Fix BufferedSerial visibility of private base class enum enumerators
Each enum enumerator needs to be exposed to be usable in the sub class.
2020-02-06 15:29:32 +00:00
Martin Kojtal 952799ccc8
Merge pull request #12270 from VeijoPesonen/bugfix_sfdp_parse_sfdp_headers
BUGFIX: SFDP Sector Map Table Parameter ID LSB is 0x81
2020-02-06 08:48:16 +00:00
Veijo Pesonen 399aabad2e USBMSD: Fixes compiler warnings 2020-01-31 10:37:18 +02:00
Veijo Pesonen 2d9cde9493 SFDP: fix mbed-os-example-blinky-baremetal build
Including mbed_trace.h file only doesn't work - the path is also
required.
2020-01-24 13:39:23 +02:00
Anna Bridge cb53825874
Merge pull request #12282 from mprse/fix_for_issue_12268
Fix for issue #12268 (SerialBase.cpp: fix initialization list)
2020-01-23 11:48:58 +00:00
Anna Bridge 80fe861f1d
Merge pull request #12035 from kjbracey-arm/callback_prep
Preparation for Callback changes
2020-01-21 11:50:43 +00:00
Veijo Pesonen 6bd3933652 Q/SPIFBlockDevice: Separates SFDP Header retrieval
Separates SFDP header retrieval and moves it as a part of the earlier
introduced SFDP file.

Purpose is to abstract away differences between SPIF and QSPIF devices
when it comes to fetching the SFDP headers from a device.
2020-01-20 16:36:21 +02:00
Veijo Pesonen aa599412e6 SFDP: replaces statix fx with usage of anon namespace 2020-01-20 12:59:22 +02:00
Veijo Pesonen a7e97ef93f SFDP: Improves code's comment-sections 2020-01-20 12:53:38 +02:00
Przemyslaw Stekiel f4af0516f4 SerialBase.cpp: fix compiler warnings by updating the initialization list 2020-01-20 11:03:51 +01:00
Veijo Pesonen cefae9020e SFDP: splits header parsing to its own file
SFDP logic is the same between SPIF and QSIP.
2020-01-17 14:43:03 +02:00
Martin Kojtal 18c941cc84
Merge pull request #12207 from hugueskamba/hk-add-buffered_serial
Add BufferedSerial class to replace UARTSerial
2020-01-16 10:06:22 +00:00
Hugues Kamba a74ffacf81 Remove usage of UARTSerial in Mbed OS Core diretories
Replace with BufferedSerial as UARTSerial has been deprecated.
2020-01-13 13:20:57 +00:00
Hugues Kamba 5fa76279ef Mark `UARTSerial` as deprecated 2020-01-13 13:20:57 +00:00
Hugues Kamba 18f677e91c Implement the BufferedSerial class to replace UARTSerial
`BufferedSerial` is `UARTSerial` renamed to convey the original purpose
of the class.
2020-01-13 13:20:57 +00:00
Kevin Bracey 8b02c4ed1c Add missing <string.h> includes 2020-01-09 14:52:54 +02:00
Kevin Bracey d6a48b5124 Turn NULLs into nullptr
Avoids overload problems with Callback(nullptr) versus Callback(fnptr).
2020-01-09 14:52:54 +02:00
Kevin Bracey ccd2a32ad1 MbedCRC: improve default constructors
Original default constructor implementation wasn't quite working
properly; it didn't cope with the new "mode_limit" parameter.

Change mechanism so that this now works:

    MbedCRC<POLY32_BIT_ANSI_CRC, 32, CrcMode::TABLE> crc;
2020-01-08 13:36:17 +02:00
Kevin Bracey 094f22901f MbedCRC: handle init values better
Init values often need reflection, and use of `__RBIT` prevents constant
init being done at compile time (unless `__RBIT` uses a compiler
intrinsic, which it doesn't for GCC).

Rather than try to handle constants 0U and -1U with a special case to
avoid the RBIT, which can in turn lead to runtime bloat for nonconstant
inits, use a C++20 style is_constant_evaluated() check to switch between
C and assembly forms.

This reduces code-size for non-constant init, by eliminating a runtime
condition, and allows the bit-reversal of any constant init to happen at
compile time.
2020-01-08 13:36:17 +02:00
Kevin Bracey 04f929e85f MbedCRC.h: declare table specialisations
Clang emits warnings if it can see a declaration when it needs a
templated variable. Add declarations for the specialisations in
MbedCRC.cpp to MbedCRC.h keep it quiet.

Tighten up a little by making all `_crc_table` references conditional
on tables being configured on.
2020-01-08 13:36:17 +02:00
Martin Kojtal fab9e3b6c7
Merge pull request #12176 from OpenNuvoton/nuvoton_usbd
Nuvoton: Support usbd
2020-01-07 16:38:39 +01:00
Hugues Kamba dbaeeaf758 Replace RawSerial instances as it has been deprecated 2020-01-06 15:48:49 +00:00
cyliangtw dc55d741c0 Adjust _rx_in_progress=true in USBCDC.cpp for USB DMA auto-receive chip 2020-01-03 20:40:39 +08:00
Anna Bridge bad7baf4de
Merge pull request #12121 from hugueskamba/hk-deprecate-serial-class
Serial: Deprecate the class and promote UnbufferedSerial instead
2019-12-19 16:34:01 +00:00
Anna Bridge fb8bbb83e4
Merge pull request #11997 from kjbracey-arm/rm_fp
Remove deprecated FunctionPointer class
2019-12-19 16:32:46 +00:00
Hugues Kamba 79054f154a Serial: Deprecate the class and promote UnbufferedSerial instead 2019-12-18 10:59:26 +00:00
Przemysław Gąsior eee46665d2 Fixed Serial ambiguity for enable_input and output 2019-12-16 15:01:28 +01:00
Anna Bridge d128ff4882
Merge pull request #11961 from hugueskamba/hk-add-unbuffered-serial-class
UnbufferedSerial: Introduce the class to replace RawSerial
2019-12-13 15:54:40 +00:00
Hugues Kamba 7b845409a0 UnbufferedSerial: Introduce the class to replace RawSerial
* Deprecate RawSerial.
* Introduce UnbufferedSerial to provide unbuffered I/O by implementing
  with a FileHandle interface for I/O	streams.
* Add Greentea test for the UnbufferedSerial class.
2019-12-12 08:44:09 +00:00
Przemyslaw Stekiel b6c25b1421 Remove serial flow control functions from image if flow control is not used 2019-12-09 08:28:14 +01:00
Przemyslaw Stekiel 160342b2d0 static pin-map - patch for SerialBase class
Related PR:

https://github.com/ARMmbed/mbed-os/pull/10924

The above PR adds functions to disable/enable serial input/output. If both serial input and serial output are disabled, the peripheral is freed. If either serial input or serial output is re-enabled, the peripheral is reinitialized.

I missed this change while working on the static pinmap and unfortunately it has an impact on it. The reinitialization is a problem for static pinmap. Now the HAL init()/init_direct() function is called not only in the constructor (but also when re-enabling the peripheral). In the current version, even if static pinmap constructor was used to create an object (and init_direct() HAL API), when reinitialization is done it uses init() HAL API. This must be split.

If static pinmap constructor is used, then the peripheral must be always initialized using HAL init_direct() function. If regular the constructor is used, then the peripheral must be initialized using HAL init() function. The same split also must be done while setting flow control during reinitialization.
2019-12-09 08:28:13 +01:00
Kevin Bracey 60e07ef8d6 Remove deprecated FunctionPointer class 2019-12-02 15:53:47 +02:00
Kevin Bracey c67816b5ff Adjust code for MbedCRC changes
* Make mbed_error use bitwise MbedCRC call rather than local
  implementation.
* Remove use of POLY_32BIT_REV_ANSI from LittleFS.
* Move some MbedCRC instances closer to use - construction cost is
  trivial, and visibility aids compiler optimisation.
2019-12-02 14:45:37 +02:00
Kevin Bracey a995c162ac Revise MbedCRC template
* Use compile-time detection of hardware CRC capability, so unneeded
  code and tables do not go into the image.
* Add global JSON config option to allow choice between no tables,
  16-entry tables or 256-entry tables for software CRC. Default set
  to 16-entry, reducing ROM size from previous 256-entry.
* Allow manual override in template parameter to force software or
  bitwise CRC for a particular instance.
* Micro-optimisations, particularly use of `RBIT` instruction and
  optimising bitwise computation using inline assembler.

Incompatible changes:

* Remove special-case "POLY_32BIT_REV_ANSI" - users can use standard
  POLY_32BIT_ANSI, which now uses the same 16-entry tables by default,
  or can use hardware acceleration, which was disabled for
  POLY_32BIT_REV_ANSI. MbedCRC<POLY_32BIT_ANSI, 32, CrcMode::TABLE> can
  be used to force software like POLY_32BIT_REV_ANSI.
* The precomputed table for POLY_16BIT_IBM had errors - this has been
  corrected, but software CRC results will be different from the previous
  software calculation.
* < 8-bit CRC results are no longer are shifted up in the output value,
  but placed in the lowest bits, like other sizes. This means that code
  performing the SD command CRC will now need to use `(crc << 1) | 1`,
  rather than `crc | 1`.
2019-12-02 14:45:37 +02:00
Przemyslaw Stekiel b2dad08387 Change explicit pinmap to static pinmap 2019-11-28 08:32:12 +01:00
Przemyslaw Stekiel 7db99341fa Serial, QSPI: Fix style 2019-11-28 08:32:08 +01:00
Przemyslaw Stekiel 933e77414d prevent passing of temporary pinmap objects 2019-11-28 08:32:07 +01:00
Przemyslaw Stekiel 0147af8418 CAN: remove redundant loop 2019-11-28 08:32:07 +01:00
Przemyslaw Stekiel ef8a99472a QSPI: Add pointer to HAL init function 2019-11-28 08:32:07 +01:00
Przemyslaw Stekiel 0cf9b1ef75 QSPI: Add explicit pinmap support 2019-11-28 08:32:04 +01:00
Przemyslaw Stekiel 655a6b896f CAN: Add explicit pinmap support 2019-11-28 08:32:03 +01:00
Przemyslaw Stekiel d75cc97d80 Explicit pinmap - fix style 2019-11-28 08:32:02 +01:00
Przemyslaw Stekiel 17c1b9a860 Fix spelling error 2019-11-28 08:32:02 +01:00
Przemyslaw Stekiel bef6854a47 Serial, SerialBase, UARTSerial: Add explicit pinmap support 2019-11-28 08:32:00 +01:00
Przemyslaw Stekiel 80b46769aa I2C: Add explicit pinmap support 2019-11-28 08:31:59 +01:00
Przemyslaw Stekiel bbd90b604b AnalogOut: Add explicit pinmap support 2019-11-28 08:31:58 +01:00
Przemyslaw Stekiel bfe19ad170 AnalogIn: Add explicit pinmap support 2019-11-28 08:31:57 +01:00
Przemyslaw Stekiel db5c5b5fb0 PwmOut: Add explicit pinmap support 2019-11-28 08:31:57 +01:00
Przemyslaw Stekiel 3a38c6bae0 SPISlave: Add explicit pinmap support 2019-11-28 08:31:56 +01:00
Przemyslaw Stekiel beec0f1e84 SPI: Add explicit pinmap support 2019-11-28 08:31:56 +01:00
Martin Kojtal 5f7ecea00b
Revert "MbedCRC and CRC HAL revisions" 2019-11-26 13:45:37 +00:00
Kevin Bracey 8811972201 Adjust code for MbedCRC changes
* Make mbed_error use bitwise MbedCRC call rather than local
  implementation.
* Remove use of POLY_32BIT_REV_ANSI from LittleFS.
* Move some MbedCRC instances closer to use - construction cost is
  trivial, and visibility aids compiler optimisation.
2019-11-13 14:31:49 +02:00
Kevin Bracey 3939c992d4 Revise MbedCRC template
* Use compile-time detection of hardware CRC capability, so unneeded
  code and tables do not go into the image.
* Add global JSON config option to allow choice between no tables,
  16-entry tables or 256-entry tables for software CRC. Default set
  to 16-entry, reducing ROM size from previous 256-entry.
* Allow manual override in template parameter to force software or
  bitwise CRC for a particular instance.
* Micro-optimisations, particularly use of `RBIT` instruction and
  optimising bitwise computation using inline assembler.

Incompatible changes:

* Remove special-case "POLY_32BIT_REV_ANSI" - users can use standard
  POLY_32BIT_ANSI, which now uses the same 16-entry tables by default,
  or can use hardware acceleration, which was disabled for
  POLY_32BIT_REV_ANSI. MbedCRC<POLY_32BIT_ANSI, 32, CrcMode::TABLE> can
  be used to force software like POLY_32BIT_REV_ANSI.
* The precomputed table for POLY_16BIT_IBM had errors - this has been
  corrected, but software CRC results will be different from the previous
  software calculation.
* < 8-bit CRC results are no longer are shifted up in the output value,
  but placed in the lowest bits, like other sizes. This means that code
  performing the SD command CRC will now need to use `(crc << 1) | 1`,
  rather than `crc | 1`.
2019-11-13 14:31:49 +02:00
Martin Kojtal a73c2b1429
Merge pull request #11814 from sandeepmistry/usb-msd-mode-sense-10
USBMSD: implement MODE SENSE (10) command
2019-11-11 15:51:51 +01:00
Janne Kiiskila 916b91f13e SerialBase.h|cpp [-Wreorder] compiler warning fix
This fixes:

```
[Warning] SerialBase.h@351,22: 'mbed::SerialBase::_flow2' will be initialized after [-Wreorder]
[Warning] SerialBase.h@343,22:   'bool mbed::SerialBase::_rx_enabled' [-Wreorder]
[Warning] SerialBase.cpp@26,1:   when initialized here [-Wreorder]

```

by using C++11 style initializer for SerialBase

Kudos to Kevin Bracey, as her his suggestion - we can drop the initializer
list if we just set the values directly in the SerialBase.h. No need to
worry about the "right order" after that.
2019-11-08 11:20:47 +02:00
Sandeep Mistry c7d9d0af46 USBMSD: implement MODE SENSE (10) command 2019-11-05 11:17:40 -05:00
Martin Kojtal f560e7960a
Merge pull request #11641 from hugueskamba/hk-fix-deepsleep-pwmout
PmwOut: Add method to enable/disable PWM
2019-11-04 14:28:50 +01:00
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
Martin Kojtal 0aa095b944 Watchdog: add missing docs doxygen 2019-07-02 12:46:23 +01:00
Martin Kojtal f7ccd06685 Watchdog: remove dead reference file 2019-07-02 12:46:23 +01:00
Martin Kojtal 1c0f1880eb VirtualWatchdog: fix error code and timeout 2019-07-02 12:46:23 +01:00
Martin Kojtal 02936376ae Watchdog: fix const static
Fixing error "non-static data member initializers only available with -std=c++11 or -std=gnu++11"
2019-07-02 12:46:23 +01:00
Filip Jagodzinski 455015daf5 Watchdog & VirtualWatchdog process() update
Add uint32 argument - pass how much time already passed to the callback.
2019-07-02 12:46:23 +01:00
Martin Kojtal 701d8f7cef VirtualWatchdog: make sure we are the only owner of watchdog
If virtual one is not the only owner we error - init error code in driver.
2019-07-02 12:46:23 +01:00
Martin Kojtal a3599414e1 Watchdog: clean-up start 2019-07-02 12:46:23 +01:00
Martin Kojtal b166acd1cb watchdog: fix astyle errors 2019-07-02 12:46:23 +01:00
Martin Kojtal f98c2fdbba watchdog: remove manager
Watchdog can handle callbacks - VirtualManager can attach to the tick. This should simplify the logic.

Watchdog can tick on its own using tickers.
VirtualWatchdog uses attach to get a callback when Watchdog ticks - to process own
linked list of virtual watchdogs.
2019-07-02 12:46:23 +01:00
Martin Kojtal 698b0eda8a watchdog: add WatchdogManager
Watchdog should be usable on it's own - kicking it via ticker. No Virtual involved.
VirtualWatchdog as well - services should use this one to have multiple one in the system.

There's WatchdogManager - basically internal class to manage ticker for Watchdog.
2019-07-02 12:46:23 +01:00
Martin Kojtal a668454de4 Watchdog: fix dtor 2019-07-02 12:46:23 +01:00
Martin Kojtal bb1cc32a25 Watchdog: kick method should not have any external dep 2019-07-02 12:46:23 +01:00
Martin Kojtal 91679d40d5 Watchdog: cleanup after singleton usage 2019-07-02 12:46:23 +01:00
Martin Kojtal d9e12e4168 VirtualWatchdog: fix protection macro 2019-07-02 12:46:23 +01:00
Martin Kojtal 7da2c6dbb6 Watchdog: use get_instance to access watchdog hw 2019-07-02 12:46:23 +01:00
Martin Kojtal edd857ea9c VirtualWatchdog: software watchdog
Refactor old Watchdog (it was not a driver) to become VirtualWatchdog.
This is software virtual watchdog. This it the primary used watchdog in user application.

VirtualWatchdog: has-a watchdog. Initializes hw watchdog - start it when first used, stops it when there is no more VirtualWatchdog in the system -
list is empty.

Adding also check to watchdog to make sure there is only one in the system - runtime error if multiple objects created to already
running hw watchdog.
2019-07-02 12:46:23 +01:00
Martin Kojtal 7b0915c7d4 Watchdog: refactor driver
Watchdog is hardware driver. It interacts with HAL - provides wrapper to interact with the peripheral.

Provides basic functionality: start/stop, get timeout/max timeout.
It is automatically kicked by a timer, according to the timeout set in ctor.
2019-07-02 12:46:23 +01:00
mjm2017 b0795821a1
Deinitialize the pin definition
Without freeing the DAC, the pin will continue to be configured as DAC. Which make it impossible to change it from Analogout to anything else. 
Check this code that allow you to change the AnalogOut to DigitalOut

<<code>>
#include "mbed.h"

class myAnalog : public AnalogOut{
    public:

    myAnalog(PinName myname);
    ~myAnalog();
    
 PinName _myname;        
};
    
myAnalog::myAnalog(PinName myname):AnalogOut(myname),
                                   _myname(myname){
                                       ;
                                   
}
 myAnalog::~myAnalog(){
   analogout_free(&this->_dac);
 }

myAnalog *x=0;
DigitalOut *xx=0;
void do_something_analog() {
    x=new myAnalog(PA_4);
    double g=0.0;
    while(g<0.5){
    x->write(g);
    g=g+0.1;
    wait_ms(50);
    }
     if (x!=0){
      delete x;
      x=0;
    }
}

void do_something_digital() {
    xx=new DigitalOut(PA_4);
    for(int i=0;i<10;i++){
        *xx = 1;
       wait_ms(50);
        *xx = 0;
        wait_ms(50);
    }
   if (xx!=0){
      delete xx;
      xx=0;
    }
}

int main()
{
    printf("\nAnalog loop example\n");
    while(1) {
    do_something_digital();
    do_something_analog();    


 }
}

<</code>>
2019-07-01 21:18:43 +02:00
Amanda Butler c497010a56 Edit ResetReason.h
Edit file for active voice, complete sentences and grammar.
2019-06-27 09:45:32 +01:00
Amanda Butler f8a6674afd Edit Watchdog.h
Edit file, mostly for active voice, consistent abbreviations, grammar and spelling.
2019-06-27 09:28:05 +01:00
Filip Jagodzinski e2ba0bb533 ResetReason: Update the header file
Minor doxygen fixes.
2019-06-26 09:58:24 +01:00
Martin Kojtal e40a76575f watchdog: fix copyright 2019-06-26 09:43:21 +01:00
Amanda Butler 13f1217a0a
Edit MbedCRC.h
Review changes, and edit file while I'm at it.
2019-06-17 08:20:55 -05:00
Bartek Szatkowski fda4988c05 Extend MbedCRC class doxygen to add more operational details 2019-06-17 12:14:27 +01:00
Bartek Szatkowski 9e2b516bca Fix doxygen for MbedCRC 2019-06-17 10:21:33 +01:00
Rajkumar Kanagaraj dfe4b533c3 Update Watchdog
- Changed the process into static method
 - used the singletonptr for creating the low power ticker instance
 - Added the mbed stub into cmake build for cellularnonipsocket,loramacrypto
2019-06-03 15:31:20 +02:00
Rajkumar Kanagaraj 696638afeb Incorporated the Reivew Comments 2019-06-03 15:24:03 +02:00
Rajkumar Kanagaraj 3c0cd62476 fix for spell check and header file 2019-06-03 15:24:01 +02:00
Rajkumar Kanagaraj f94eb3cf13 Fix for the Ci build issue 2019-06-03 15:24:01 +02:00
Rajkumar Kanagaraj 47030cd23f SW watchdog unittest cases
-Added the mock class function to mock mbed_assert_internal
  -Added the unit test case to test start,kick,stop
  -Modified the interface api name from is_alive to process
  -added the unit test cases for process
2019-06-03 15:23:59 +02:00
Rajkumar Kanagaraj bcea865db2 Add SW Watchdog
-SW watchdog has interface name start(),stop(),kick()	Sw watchdog internally has static list and shared across multiple instance of SW watchdog
	- Sw watchdog initialize timeout value,unique string via constructor whenever threads created sw watchdog object
	-Threads make sure pass proper timeout value,Unique string while creating the instance.
	-start() called by components(BLE,WIFI etc.,),it adds the entry into static list with few details current count ,etc.,
	-kick() called by registered components(BLE,WIFI etc.) to reset current count to zero.
        -is_alive - interface API to mbed_watchdog_manager
        -implementation optimization
2019-06-03 15:23:57 +02:00
Rajkumar Kanagaraj 3cd52d4732 Watchdog refactoring to multithreaded thread.
-Added API to register muliple threads to watchdog drivers
-Watchdog timeout reconfigures everytime whenever new register thread with longer timeout period
-New APIs for watchdog
 wd_register(const osThreadId_t tid, const uint32_t timeout) to register to watchdog
 wd_unregister(const osThreadId_t tid) to unregister to watchdog
 kick(const osThreadId_t tid) to refresh the watchdog
2019-06-03 15:23:56 +02:00
George Psimenos f82b7d8229 Improve type cast 2019-05-31 13:59:40 +01:00
George Psimenos 9f66347bd3 Make buffer parameter const 2019-05-28 15:58:19 +01:00