Commit Graph

251 Commits (698de3b5ffe6906e9ec53de0ab752859d1d5772e)

Author SHA1 Message Date
Martin Kojtal b89cf3ff75
Merge pull request #5578 from mprse/CircularBuffer_tests
CircularBuffer class modification and test
2017-12-20 14:51:44 +00:00
Martin Kojtal bea41d1ebb
Merge pull request #5635 from c1728p9/fix_lazy_init
Protect local static object construction in ARMCC
2017-12-12 17:41:21 +00:00
Martin Kojtal be52ba2156
Merge pull request #5363 from mprse/extended_rtc
Add support and tests for extended RTC
2017-12-12 17:36:44 +00:00
Russ Butler c63a627868 Protect local static object construction in ARMCC
Implement the functions __cxa_guard_acquire, __cxa_guard_release
and __cxa_guard_abort for ARMCC so local static object construction is
thread safe.
2017-12-01 11:14:58 -06:00
Przemyslaw Stekiel dc5a66dc5c Add support for extended RTC.
Provide support to use whole 32-bit range (unsigned int) to hold time since UNIX epoch.
The suppoerted time range is now from the 1st of January 1970 at 00:00:00 to the 7th of February 2106 at 06:28:15.
Add support for two types of RTC devices:
- RTCs which handles all leap years in the mentioned year range correctly. Leap year is determined by checking if the year counter value is divisible by 400, 100, and 4.
- RTCs which handles leap years correctly up to 2100. The RTC does a simple bit comparison to see if the two lowest order bits of the year counter are zero. In this case 2100 year will be considered incorrectly as a leap year, so the last valid point in time will be 28.02.2100 23:59:59 and next day will be 29.02.2100 (invalid). So after 28.02.2100 the day counter will be off by a day.
2017-12-01 17:07:34 +01:00
Martin Kojtal b076565ac0
Merge pull request #5596 from kjbracey-arm/strong_cas
Make LDREX/STREX CAS functions strong
2017-11-30 18:04:14 +00:00
Przemyslaw Stekiel c962913ed9 Add assertion to make CounterType consistent with BufferSize.
CounterType is used to define type of _head and _tail counters. This may cause the following problems:
- counters are used as array indexes so only unsigned types should be used for counters,
- CounterType must be consistent with BufferSize and BufferSize is of uint32_t type (i.e. Circular Buffer with the following parameters: BufferSize = 1000, CounterType = unsigned char will not work properly).
2017-11-29 11:26:23 +01:00
Kevin Bracey 59508d46a6 Explicitly note that CAS is strong in docs
Add a note to each CAS making explicit that the functions are strong.

Minor wording change to expectedCurrentValue - use of "still updated"
about the failure case suggested that it might be written to on success.
For some uses it's critically important that expectedCurrentValue only
be written on failure, so change wording to "instead updated".
2017-11-28 14:02:28 +02:00
Kevin Bracey cfa6d07a3b Make LDREX/STREX CAS functions strong
The LDREX/STREX implementations of the compare-and-swap functions were
weak (they could spuriously fail when the value was expected), whereas
the critial section implementation was strong, and the documentation has
no suggestion that there might be spurious failures.

Rationalise by adding a retry loop for STREX failure, so that it only
returns false when the value is not expected.

Fixes https://github.com/ARMmbed/mbed-os/issues/5556
2017-11-28 11:56:50 +02:00
Jimmy Brisson 70e7b40468
Merge pull request #5583 from kjbracey-arm/delete_null
Remove pointless null check in operator delete
2017-11-27 10:37:40 -06:00
Jimmy Brisson b9c3003419
Merge pull request #5466 from kjbracey-arm/write_all
Make POSIX-like writes write everything when blocking
2017-11-27 10:36:28 -06:00
Kevin Bracey ff6bc08c53 Remove pointless null check in operator delete
free() checks for NULL, no need to add another check.
2017-11-24 10:40:15 +02:00
deepikabhavnani e78998e117 Definition for stat was missing in header file 2017-11-22 17:41:24 -06:00
Jimmy Brisson 4b57c5818e
Merge pull request #5528 from c1728p9/simplify_retarget
Use retarget defines where possible
2017-11-22 10:18:36 -06:00
Jimmy Brisson b6e50f5ed9
Merge pull request #5525 from deepikabhavnani/errno_fix
Fixed: errno update failure with IAR8.x
2017-11-22 10:17:56 -06: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
Russ Butler beb0b20e32 Use retarget defines where possible
Remove the condition code around the defines in mbed_retarget.h so
all toolchains use the defined values. Exclude a small subset of
values for GCC since these are in its standard header files.
2017-11-17 19:40:47 -06:00
Deepika 83409c5af3 Fixed: errno update failure with IAR8.2
errno (part of thread local storage) setting caused hardfault with IAR8.x
versions. TLS is not supported, hence using main thread TLS area for
all threads.
2017-11-17 13:12:39 -06:00
Martin Kojtal 4198695fab
Merge pull request #5485 from pan-/non-copyable-warning
Platform: Allow copy of non copyable objects
2017-11-16 16:14:42 +00:00
Martin Kojtal 41eb565d9c
Merge pull request #5342 from ARMmbed/feature_cortex_a
Update CMSIS/RTX with Cortex-A support
2017-11-15 11:24:36 +00:00
Vincent Coubard 80c9f8bd2f Platform: Turn NonCopyable compile time error into warnings.
Turn the compile time error issued when a NonCopyable resource is copied
into a compile time and runtime warning.

If the application is compiled with the debug profile the compile time
error remains.

The compile time error can be enforced by setting the library option
force-non-copyable-error to true.
2017-11-14 10:09:07 +00:00
Vincent Coubard 5310451c8f Platform: Add MBED_PRETTY_FUNCTION macro.
This macro yields a string literal of the enclosing function name.
2017-11-14 10:07:30 +00:00
Vincent Coubard 3aa4bf4346 Platform: fix end of line whitespace 2017-11-14 10:06:38 +00:00
Bartosz Szatkowski 048a896741 Update definitions of CPSR modes 2017-11-10 09:53:41 +00:00
Bartek Szatkowski 855844f5a1 Update CThunk to support new CMSIS Cortex A ops 2017-11-10 09:53:41 +00:00
Martin Kojtal 589d76e59f
Merge pull request #5058 from 0x6d61726b/patch-2
CircularBuffer(): get available transactions
2017-11-09 16:54:59 +00: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 551a2a3c66
Merge pull request #5373 from ARMmbed/g-fix-nodev-errno
fs: Correct errno when not finding a mounted filesystem
2017-11-02 10:40:19 -05:00
0x6d61726b 830db6a5a0
code style adopted 2017-10-31 16:07:33 +01:00
Senthil Ramakrishnan 37214ab695 Fix comments on mbed_assert.h 2017-10-27 15:38:44 -05:00
Russ Butler 891b06e61b Deprecate CallChain
This patch deprecates the CallChain class since it is an
internal API (not in mbed.h) and is only being used by
InterruptManager which is also deprecated.
2017-10-27 14:55:49 -05:00
Senthil Ramakrishnan 3ad298488c Doxygen comment updates and fixes 2017-10-26 15:36:26 -05:00
Christopher Haster 400c25466d fs: Corrected errno when not finding a mounted filesystem 2017-10-24 11:52:06 -05:00
0x6d61726b c1ab43ce76 Code style updated 2017-10-20 22:06:01 +02:00
Christopher Haster 32faaf65ee Change FileSystemHandle group to platform
Was drivers, should be platform, wasn't updated during move
2017-10-16 17:46:40 -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 a67737f993 Merge pull request #5086 from pan-/systick_sleep_fix
Sleep: Disallow sleep for targets turning off the systick clock at sleep entry
2017-10-13 09:19:10 -05:00
Jimmy Brisson fad67559ae Merge pull request #5028 from c1728p9/ticker_api_changes
Update ticker to map closely to hardware
2017-10-13 09:18:02 -05:00
Anna Bridge 7b2b18f92f Merge pull request #5204 from geky/fix-retarget-defs
fs: Add missing retarget definitions for ARM/IAR
2017-10-06 11:53:05 +01:00
0x6d61726b 69e6f11c2d updates according to comments in pull request 2017-10-05 20:47:31 +02:00
Russ Butler 6452821e2e Add default implementation of timer info
Add weak implementations of *_ticker_get_info which returns 1MHz and
a width of 32 bits. This allows the updated Ticker API to work with
existing devices.

Note - in the future when all targets have implemented
*_ticker_get_info these weak functions will be removed.
2017-10-05 11:57:34 -05:00
Jimmy Brisson 0dc264fa86 Merge pull request #5212 from SenRamakri/sen_ATCmdParserChanges2
Merging changes from ATParser towards parser unification
2017-10-05 11:14:37 -05:00
Jimmy Brisson da138f20d7 Merge pull request #5203 from geky/fix-fstat-newlib
fs: Fix fstat retarget for regular files
2017-10-05 11:13:42 -05:00
Jimmy Brisson a0b624b62e Merge pull request #5038 from chrissnow/LPC1768-Bootloader
Lpc1768 bootloader support
2017-10-05 11:11:08 -05:00
Kevin Bracey de4ced33a6 Make poll() use wait(1) rather than yield()
Spinning while polling is overly CPU intensive, and inconsistent with
the current blocking behaviour of UARTSerial.

Change to use Thread::wait(1) to match UARTSerial.
2017-10-03 10:56:19 +03:00
Christopher Haster e9cd239ac3 fs: Added in missing retarget definitions for ARM/IAR
- missing O_ flags
- missing S_IF flags
- missing system types
- missing stat structure
- exhaustive list of errno codes
2017-10-02 16:12:22 -05:00
Russ Butler f0ac234da7 Prevent DeepSleepLock from leaving sleep locked
Add _lock_count to DeepSleepLock and use this to prevent deep sleep
from staying locked when the DeepSleepLock objected is destroyed after
an unbalanced number of calls to lock and unlock.
2017-10-02 11:34:56 -05:00
Senthil Ramakrishnan 3e1459b691 Merging changes from ATParser got AT parser unification 2017-10-02 10:03:58 -05:00
Senthil Ramakrishnan 7ffa3ddaaf Merging changes from ATParser towards parser unification 2017-10-02 10:03:58 -05:00