Commit Graph

59 Commits (d6a48b5124f4ba8983c6e7eaf505ee4f76f52ed2)

Author SHA1 Message Date
Kevin Bracey d6a48b5124 Turn NULLs into nullptr
Avoids overload problems with Callback(nullptr) versus Callback(fnptr).
2020-01-09 14:52:54 +02: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 fb8bbb83e4
Merge pull request #11997 from kjbracey-arm/rm_fp
Remove deprecated FunctionPointer class
2019-12-19 16:32:46 +00: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 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 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 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 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
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
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
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 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 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
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