Commit Graph

127 Commits (69e35c49c8c063d8e9f6a9e10ced08cd6a701c17)

Author SHA1 Message Date
Paul Thompson d6c5f16fd3 Eliminate complier warning and remove superfluous call to empty()
Appears when complied with -O3 optimization level

Compile: UARTSerial.cpp
../drivers/UARTSerial.cpp: In member function 'void mbed::UARTSerial::tx_irq()':
../drivers/UARTSerial.cpp:314:31: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized]
         SerialBase::_base_putc(data);
2018-04-16 07:23:47 -07:00
Martin Kojtal 501953b1a4
Merge pull request #6442 from deepikabhavnani/crc_test
Add test for MbedCRC.h
2018-04-06 10:46:52 +02:00
Martin Kojtal 3328ecd92a
Merge pull request #6531 from SenRamakri/sen_DeprecatedFixes
Fix doxygen comments to reflect the deprecated functions
2018-04-06 10:06:31 +02:00
Russ Butler 1b58e58e1a Fix deep sleep locking for Timeout class
Detach in the Timeout::handler so deep sleep is properly unlocked.
2018-04-03 15:46:10 -05:00
Senthil Ramakrishnan 194b89cce6 Fix doxygen comments to reflect the deprecated functions 2018-04-03 14:10:39 -05:00
Deepika 331620e1d0 Default constructor for template class should be part of header file 2018-03-23 14:55:07 -05:00
Cruz Monrreal 801f27efcf
Merge pull request #6239 from bmcdonnell-ionx/interrupt-in-pin-mode
Interrupt in pin mode
2018-03-23 12:00:36 -05:00
George Beckstein d3ab5c7e59
Added SerialWireOutput to mbed namespace 2018-03-22 12:35:54 -04:00
Brendan McDonnell 8d2214fa6e linebreaks 2018-03-21 11:18:54 -04:00
Brendan McDonnell 895e19ae0f Restore single-param InterruptIn ctor, to maintain binary compatibility (for Wi-Fi drivers).
Revert "simplify InterruptIn - default parameter instead of multiple constructors"; add comment.

This reverts commit d28dbf6702.
2018-03-21 11:18:42 -04:00
Cruz Monrreal 9cac3b2f6b
Merge pull request #6149 from bmcdonnell-ionx/typos
Fix typos in the files
2018-03-15 10:53:03 -05:00
Cruz Monrreal 9ddb092d43
Merge pull request #6230 from bulislaw/system_reset
Add system_reset call
2018-03-01 10:31:07 -06:00
Brendan McDonnell 087b4281f6 linebreak 2018-03-01 11:13:22 -05:00
Brendan McDonnell e4bf6c47ff add doxygen param info 2018-03-01 11:13:19 -05:00
Brendan McDonnell d28dbf6702 simplify InterruptIn - default parameter instead of multiple constructors 2018-02-28 14:42:43 -05:00
Brendan McDonnell dfa6a7aa97 factor out common function 2018-02-28 14:02:05 -05:00
Brendan McDonnell 35308c1937 overload InterruptIn constructor to allow PinMode control 2018-02-28 14:00:50 -05:00
Cruz Monrreal 3d1174a215
Merge pull request #5911 from deepikabhavnani/common_crc
CRC class implementation
2018-02-28 11:53:54 -06:00
Bartek Szatkowski 4cb47df40a Add system_reset() function to Mbed OS 2018-02-28 16:42:34 +00:00
deepikabhavnani b60eb1d001 Updated table to be const and small fixes 2018-02-27 09:35:55 -06:00
Cruz Monrreal 3d37d819e9
Merge pull request #5046 from fkjagodzinski/timerevent_tests
TimerEvent tests
2018-02-26 15:02:52 -06:00
Filip Jagodzinski 7f73785b9a Drivers: TimerEvent: Update API docs 2018-02-23 09:13:35 +01:00
David Saada 0aeeece97d FlashIAP driver modifications:
- Support programming across sectors.
- Support program size not aligned to page size.
- Fix validations on sector erase.
2018-02-22 22:48:29 +02:00
Brendan McDonnell c4f10aafee typos 2018-02-20 20:11:19 -05:00
Cruz Monrreal cd7595e5a7
Merge pull request #6076 from mprse/remove_ticker_interface_init_while_Ticker_creation
Remove ticker interface initialization while Ticker creation.
2018-02-20 13:21:20 -06:00
deepikabhavnani af0982295f Moved specialized functions to CPP file
Template specialized functions are moved to cpp file, to add MbedCRC.h
in mbed.h. Else linker shall multiple definition error.
2018-02-20 08:12:44 -06:00
Marcus Chang bbf92fdf0d Instrumented Trace Macrocell (ITM) HAL API
HAL API for initializing the ITM and setting SWO debug output.
Actual debug output implemented as SWO FileHandle.
2018-02-16 08:24:31 -08:00
Przemyslaw Stekiel 17dece407a Remove ticker interface initialization while Ticker creation.
Ticker constructor calls directly target specific ticker init function. Currently there is no problem, since ticker interface initialization functions are protected against multi-calls and simply returns if not called for the first time (interface initialization can be performed only once). According to the new Thicker HAL API requirements:
The function ticker_init allows the ticker to keep counting and disables the ticker interrupt.

Disabling interrupts while some Ticker interrupts are already scheduled for sure will destroy the schedule. Ticker interface should be initialized only once and it is already done by: static void initialize(const ticker_data_t *ticker) function in /m-bed/hal/mbed_ticker_api.c file.
2018-02-13 09:11:16 +00:00
deepikabhavnani 8e537115c5 Removed init/deinit and added cpp file for tables 2018-02-02 09:43:06 -06:00
deepikabhavnani afe8834bb8 CRC class implementation
CRC class `MbedCRC.h` is templated class created to support hardware/software
CRCs. Default CRC will be hardware CRC when support for HAL is available.

Polynomial tables are available for 8/16 bit CCITT, 7/16 bit for SD card and
32-bit ANSI. Polynomial table implementation will be used if Hardware CRC is
not available.

In case device does not have hardware CRC and polynomial table is not supported,
CRC is still available and is computed runtime bit by bit for all data input.
2018-01-24 13:26:41 -06:00
Cruz Monrreal 31f59b9fb4
Merge pull request #5721 from scartmell-arm/bug-i2c-abort-deep-sleep
Fix bug allowing I2C::abort_transfer to incorrectly unlock deep sleep mode
2018-01-11 10:30:53 -06:00
Steven Cartmell c2670870dc Fix bug allowing SPI::abort_transfer to incorrectly unlock deep sleep mode
- Add flag to SPI class to track if the SPI instance has locked deep sleep mode.
- Wrap call to sleep_manager_lock_deep_sleep to only be called if SPI instance
  hasn't already locked deep sleep.
- Wrap call to sleep_manager_unlock_deep_sleep to only be called if SPI has
  currently locked deep sleep mode.
2018-01-04 09:39:39 +00:00
Steven Cartmell 26f01d6c25 Fix bug allowing I2C::abort_transfer to incorrectly unlock deep sleep mode
- Add flag to I2C class to track if the I2C instance has locked deep sleep mode.
- Wrap call to sleep_manager_lock_deep_sleep to only be called if I2C instance
  hasn't already locked deep sleep.
- Wrap call to sleep_manager_unlock_deep_sleep to only be called if I2C has
  currently locked deep sleep mode.
2018-01-04 09:37:44 +00:00
Kevin Bracey 9678c8052e Make UARTSerial send all data when blocking
Previously, write() was somewhat soft - it only ever made one attempt to
wait for buffer space, so it would take as much data as would fit in the
buffer in one call.

This is not the intent of a POSIX filehandle write. It should try to
send everything if blocking, and only send less if interrupted by a
signal:

 - If the O_NONBLOCK flag is clear, write() shall block the calling
   thread until the data can be accepted.

 - If the O_NONBLOCK flag is set, write() shall not block the thread.
   If some data can be written without blocking the thread, write()
   shall write what it can and return the number of bytes written.
   Otherwise, it shall return -1 and set errno to [EAGAIN].

This "send all" behaviour is of slightly limited usefulness in POSIX, as
you still usually have to worry about the interruption possibility:

  - If write() is interrupted by a signal before it writes any data, it
    shall return -1 with errno set to [EINTR].

  - If write() is interrupted by a signal after it successfully writes
    some data, it shall return the number of bytes written.

But as mbed OS does not have the possibility of signal interruption, if we
strengthen write to write everything, we can make applications' lives
easier - they can just do "write(large amount)" confident that it will
all go in one call (if no errors).

So, rework to make multiple writes to the buffer, blocking as necessary,
until all data is written.

This change does not apply to read(), which is correct in only blocking until
some data is available:

 - If O_NONBLOCK is set, read() shall return -1 and set errno to [EAGAIN].

 - If O_NONBLOCK is clear, read() shall block the calling thread until some
   data becomes available.

 - The use of the O_NONBLOCK flag has no effect if there is some data
   available.
2017-11-21 09:51:36 +02:00
Martin Kojtal fbd9e7eaf2
Merge pull request #5372 from SenRamakri/sen_PlatformDoxygenUpdates
Doxygen comments fixes
2017-11-09 16:38:45 +00:00
Jimmy Brisson 6912a9dc0d
Merge pull request #5393 from c1728p9/call_chain_deprecation
Deprecate CallChain and InterruptManager
2017-11-02 11:10:52 -05:00
Jimmy Brisson 5768693e0d
Merge pull request #5088 from kjbracey-arm/uartserial_flow
UARTSerial: add flow control and format APIs
2017-11-02 10:37:40 -05:00
Russ Butler 8deef6a699 Deprecate InterruptManager
This patch deprecates the InterruptManager class since it is an
internal API (not in mbed.h) which is not being used anywhere in
the codebase.
2017-10-27 14:47:55 -05:00
Senthil Ramakrishnan 3ad298488c Doxygen comment updates and fixes 2017-10-26 15:36:26 -05:00
Jimmy Brisson 493e3788e3 Merge pull request #5216 from kjbracey-arm/UARTSerial_wait
Avoid wait_ms() spin
2017-10-13 09:20:41 -05:00
Jimmy Brisson 4dff32ab5a Merge pull request #5220 from c1728p9/sleep_lock_fixes
Fix deep sleep lock bugs
2017-10-05 10:03:44 -05:00
Russ Butler 32303a9130 Fix sleep lock underflow in LowPowerTimer
If a LowPowerTimer is started and then goes out of scope then a
deep sleep lock underflow can occur. This is because the
the variable '_lock_deepsleep' is checked when starting the timer
but is not checked in the destructor, which unconditionally releases
the deep sleep lock.
2017-10-02 19:32:20 -05:00
Russ Butler f854f3e6db Properly unlock sleep in destructor of drivers
Unlock sleep in CAN and SerialBase. This prevents deep sleep from
staying locked if these objects are destroyed without first clearing
the callbacks.
2017-10-02 11:35:08 -05:00
Russ Butler 87b151c8a0 Protect Ticker attach with a critical section
Add a critical section to attach_us so setting _function and
locking deep sleep are done atomically.
2017-10-02 11:35:05 -05:00
Jimmy Brisson bb61b42fba Merge pull request #5148 from mprse/fix_enable_deepsleep_for_lp_timer
Enable deepsleep for LowPowerXXX objects
2017-09-28 14:11:40 -05:00
Jimmy Brisson f7cca5b023 Merge pull request #5066 from kjbracey-arm/uartserial_readable
UARTSerial: Avoid readable() ambiguity
2017-09-28 14:08:43 -05:00
Jimmy Brisson 6177c01c92 Merge pull request #5062 from 0xc0170/fix_interruptin_callback
InterruptIn: Use NULL callback by default
2017-09-28 14:04:28 -05:00
Jimmy Brisson f57f0d4631 Merge pull request #5045 from maciejbocianski/ticker_fix
Ticker class description update - small interval warning
2017-09-28 14:01:36 -05:00
Kevin Bracey b18332cb4d Avoid wait_ms() spin
System's wait_ms() spins to achieve a precise delay - we don't want this.
Call Thread::wait directly.
2017-09-28 10:45:57 +03:00
Jimmy Brisson ddb6b66674 Merge pull request #5177 from 0xc0170/fix_pwmout_sleep
PWMOut: lock deesleep addition
2017-09-27 09:09:36 -05:00