Commit Graph

541 Commits (8f07b9ebd5d4a95b33907662d1252db0f8dd7a6c)

Author SHA1 Message Date
Deepika 4e263b17b9 Refactor circular buffer test to platform folder 2018-08-27 09:33:07 -05:00
Russ Butler ec19bf1de4 Allow early use of singleton lock
Allow singleton_lock and singleton_unlock to be called before the
RTOS has been started by checking for a valid mutex before locking
and unlocking it.
2018-08-26 12:59:57 -05:00
Cruz Monrreal 2f8e679183
Merge pull request #7592 from orenc17/remove_uvisor
Remove uVisor from mbed-os
2018-08-25 19:52:24 -05:00
Deepika 546743aeb0 Replace modulo op with compare/reset op 2018-08-24 16:51:32 -05:00
Vincent Coubard 9d1fd9983c Span: Fix documentation. 2018-08-24 17:51:58 +01:00
Amanda Butler bf08651d3a
Copy edit Span.h
Copy edit file, mostly for consistent capitalization, punctuation and tense.
2018-08-24 09:31:10 -05:00
Vincent Coubard af69e1fb8b Span: use static assert to kill copy construction from an incompatible span type.
Copy construction between Span of compatible type is allowed to fulfil the use
case Span<T> -> Span<const T>. This is achieved by a templated copy constructor
like constructor.

In p0122, the overload is discarded from the constructor set if the ElementType
of the Span in input is not convertible into the ElementType of the Span being
constructed.

To discard function overload, SFINAE has to be used which polutes the documentation
and make the code harder to read and maintain.

Unlike p0122, our Span class doesn't exposes (yet) functions with default argument
or functions that convert container in input into span the only overload with the
a single parameter that we exposes are:
- template<size_t N> Span(ElementType (&element)[N])
- Span(const Span& other): <- generated by the compiler.

For both of this functions we expect exact match and their resolution should not
interfere with the constructor that converts from another type of Span.

As a result it is possible to rely solely on C++ default resolution rules as we
won't hit cases were constructors convert from another type (std::array, std
container, span) and raise an error with a static assert if the element type
can't be converted.

If another copy - conversion - constructor is added then SFINAE has to be
reintroduced.
2018-08-24 11:10:17 +01:00
Martin Kojtal 871d7e7361
Merge pull request #7730 from davidsaada/david_stack_stats_fail_fix
When stack stats enabled, prevent exceptions if memory allocations fail
2018-08-24 11:31:24 +02:00
Vincent Coubard d5051a8ca7 Span: Allow copy construction from convertible span.
Addition of these overloads help when Span<const T> is constructed from Span<T>.
2018-08-23 18:41:53 +01:00
Cruz Monrreal deb905da1d
Merge pull request #7815 from donatieng/shared_ptr
Re-add Shared Pointer Class into platform features
2018-08-23 10:09:02 -05:00
Vincent Coubard b7f074ef68 Span: Fix opening brace position. 2018-08-23 14:02:26 +01:00
Vincent Coubard 2a6c6d5985 Span: Use mbed way of writing types in documentation example. 2018-08-23 12:41:04 +01:00
Vincent Coubard 33ca10192d Span: Fix documentation. 2018-08-23 11:38:32 +01:00
Vincent Coubard 6b08320573 Span: Fix doxygen tags. 2018-08-23 09:02:28 +01:00
Vincent Coubard 4e7fa91b94 Span: amend documentation 2018-08-22 15:11:27 +01:00
Oren Cohen 787317b7eb Remove uVisor from mbed-os 2018-08-22 16:36:59 +03:00
Vincent Coubard 95fc284a83 Span: add boundary check in subscript operator for debug profile 2018-08-22 13:32:54 +01:00
Vincent Coubard f6dd5eaa31 Span: Fix static assert message in default constructor. 2018-08-22 13:31:26 +01:00
Vincent Coubard 26b546bab3 Span: Improve readability of precondition checks 2018-08-22 09:40:51 +01:00
Vincent Coubard 938d802ea0 Span: Fix subspan return type 2018-08-22 09:40:50 +01:00
Vincent Coubard 54e2d92c95 Span: Improve consistency with standard.
This commit aims to make Span implementation more in line with what is present in N4762:
- use appropiate index types where applicable.
- use typedefed type inside the class (index_type, reference, pointer, element_type)
- assertion where applicable
- restrict default construction to Span with extent == 0 or extent == dynamic.
- construct span from a range of pointer
- remove non const overload of the subscript operator
- remove non const overload of the data function
- implement subspan function
- implement missing first and last function of dynamic span
2018-08-21 18:20:58 +01:00
Donatien Garnier 298f847821 Fix use_count() in SharedPtr 2018-08-21 12:59:54 +01:00
Amanda Butler 7086d69a83
Copy edit SharedPtr.h
Copy edit for consistent capitalization and minor grammar nits.
2018-08-20 13:55:21 -05:00
Donatien Garnier d9c1748c14 Update formatting for SharedPtr.h 2018-08-20 12:04:53 +01:00
Vincent Coubard 3985fb8d62 Span: Fix documentation error. 2018-08-20 12:00:20 +01:00
Vincent Coubard 1f00336c7e Span: replace reference to Size with Extent. 2018-08-20 11:58:48 +01:00
Vincent Coubard 6fcf1e8284 Span: Make type pointer and reference declaration consistent with guideline. 2018-08-20 10:47:41 +01:00
Vincent Coubard 9b9d33a7b4 Span: Fix typo. 2018-08-20 10:41:47 +01:00
Vincent Coubard 3fb3173876 Span: Fix odd condition in Span::empty. 2018-08-20 10:30:35 +01:00
Vincent Coubard 43170d21bf Span: Make name of dynamic span tag consistent with C++ standard. 2018-08-20 10:29:43 +01:00
Vincent Coubard eba1dc6dd6 Span: Improve comparison operator to array by using fixed size Span. 2018-08-20 09:13:31 +01:00
Vincent Coubard 7f195b8ec1 Span: Cleanup usage of ptrdiff_t and size_t 2018-08-20 09:13:17 +01:00
Vincent Coubard d8c788a413 Platform: Add C++ Span class.
The Span class allows the creation of views over contiguous memory. The view
do not own memory, is typed and has a length. It can be used as a replacement of
the traditional pair of pointer and size in parameters or class fields.

Main operations:
- size(): return the lenght of the memory viewed
- empty(): return if the memory viewed is empty
- [index]: access elements viewed
- data(): return a pointer to the memory viewed.
- first(count): Create a subview from the first count elements.
- last(count): Create a subview from the last count elements.
- == and !=: compare two views or a view to array and return if they are equal or
not.

The Span class came in two flavors:
- Static size: The size is encoded in the Span type and it is as lightweitgh as
a single pointer,
- Dynamic size: The object can store arbitrary views and it costs one pointer
and the size of the view.
2018-08-19 20:20:05 +01:00
Senthil Ramakrishnan 529af2b0f4 Changes to error code names 2018-08-17 23:13:59 -05:00
Senthil Ramakrishnan 7803a40fbd Update BLE error calls to use new error codes and mbed_error 2018-08-17 22:52:50 -05:00
Donatien Garnier 6f3c07f6eb Optimize SharedPtr code 2018-08-17 20:11:00 +01:00
Donatien Garnier ac79b007d0 Cleanup description 2018-08-17 19:05:19 +01:00
Donatien Garnier 2608478e87 Cleanup shared pointer implementation and add reset() methods 2018-08-17 18:45:01 +01:00
Donatien Garnier f45642cec0 Make shared pointer thread safe and clean-up class and doc 2018-08-17 18:25:28 +01:00
Russ Butler 472ababfef Update deep sleep lock check in tests
When the define LPTICKER_DELAY_TICKS is set deep sleep can be randomly
disallowed when using the low power ticker. This is because a Timer
object, which locks deep sleep, is used to protect from back-to-back
writes to lp tickers which can't support that. This causes tests which
assert that deep sleep is allowed to intermittently fail.

To fix this intermittent failure this patch adds the function
sleep_manager_can_deep_sleep_test_check() which checks if deep sleep
is allowed over a duration. It updates all the tests to use
sleep_manager_can_deep_sleep_test_check() rather
than sleep_manager_can_deep_sleep() so the tests work even if deep
sleep is spuriously blocked.
2018-08-17 09:29:41 -05:00
Donatien Garnier 9ebfbc0cdd Re-introduce a shared pointer class in mbed OS 2018-08-17 12:30:51 +01:00
David Saada cfe7df28c9 When stack stats enabled, prevent exceptions if memory allocations fail 2018-08-08 16:18:29 +03:00
Martin Kojtal 7a44185c1c CircularBuffer: volatile specifier removal
Volatile specifier in this case it not required as we currently have all accesses
to the buffer protected by critical section. This shall optimize accesses in
some cases to the buffer.

Fixes #7702
2018-08-08 10:11:59 +01:00
kegilbert 9b53d1256f Replace mbed_mem_tracing_enabled macro with config option 2018-08-06 13:44:12 -05:00
Cruz Monrreal 8292affb53
Merge pull request #7609 from bremoran/patch-2
Make location meaningful in print_error_report
2018-07-26 22:07:22 -05:00
Cruz Monrreal cc506eed14
Merge pull request #7603 from OpenNuvoton/nuvoton_override_gcc_sbrk
Nuvoton: Replace __wrap__sbrk with overriding _sbrk
2018-07-26 12:54:45 -05:00
Brendan Moran 96fbd02f8c
Make location meaningful in print_error_report
`handle_error` calls `MBED_CALLER_ADDR()`, but this is always a location from within platform/mbed_error.c. This is because `handle_error` is declared static. This does not cause the function to be inlined however. Instead, it is called by each function within mbed_error.c. For example, mbed_error yields this code:

```
000625c8 <mbed_error>:
   625c8:       b510            push    {r4, lr}
   625ca:       460c            mov     r4, r1
   625cc:       4611            mov     r1, r2
   625ce:       461a            mov     r2, r3
   625d0:       9b02            ldr     r3, [sp, #8]
   625d2:       f7ff feff       bl      623d4 <handle_error>
   625d6:       b968            cbnz    r0, 625f4 <mbed_error+0x2c>
   625d8:       4620            mov     r0, r4
   625da:       f7ff ff67       bl      624ac <print_error_report.constprop.0>
   625de:       f7ff fea8       bl      62332 <core_util_is_isr_active>
   625e2:       b910            cbnz    r0, 625ea <mbed_error+0x22>
   625e4:       f7ff fe9f       bl      62326 <core_util_are_interrupts_enabled>
   625e8:       b908            cbnz    r0, 625ee <mbed_error+0x26>
   625ea:       bf30            wfi
   625ec:       e7fd            b.n     625ea <mbed_error+0x22>
   625ee:       2001            movs    r0, #1
   625f0:       f000 f948       bl      62884 <__wrap_exit>
   625f4:       4800            ldr     r0, [pc, #0]    ; (625f8 <mbed_error+0x30>)
   625f6:       bd10            pop     {r4, pc}
   625f8:       80ff010f        .word   0x80ff010f
```

Note that at `625d2` there is a bl to handle error. That replaces the LR, which means that ALL calls to mbed_error will report a location of 0x625d6 or 0x625d7 (user vs. supervisor). I do not expect that this was the intention of the code. The simplest fix is to change line 99:

```C
static inline mbed_error_status_t handle_error(mbed_error_status_t error_status, unsigned int error_value, const char *filename, int line_number)
```

Since `handle_error()` will be inlined, the link register will be kept the same, so `MBED_CALLER_ADDR()` will yield the expected result. However, there is no guarantee that the compiler will respect the `inline` keyword in all circumstances.

The result is that each function that wishes to report its caller must extract its caller. This code cannot be centralised.

I have modified `mbed_error.c` to report the caller of each error reporting function, rather than the error reporting function itself.
2018-07-26 16:21:17 +01:00
ccli8 313f322cf7 [Nuvoton] Replace __wrap__sbrk with overriding _sbrk
With _sbrk being weak, we can override it directly rather than #if to support heap with
two-region model.
2018-07-26 15:47:25 +08:00
Senthil Ramakrishnan 7cedccc488 Improved logic in wait_us to avoid division operation in sub-millisec case 2018-07-25 15:04:06 -05:00
Deepika b05d105493 Update stats to fetch Mbed OS version info 2018-07-13 11:58:49 -05:00
Cruz Monrreal 6fcb77ee34
Merge pull request #7434 from deepikabhavnani/version_header
Separate version header file in Mbed OS
2018-07-13 11:43:15 -05:00
Deepika 05d8c74aee Separate version header file to get version updates in Mbed OS 2018-07-11 09:41:30 -05:00
Senthil Ramakrishnan b6179d281d Remove error reporting for release builds 2018-07-06 10:15:07 -05:00
Senthil Ramakrishnan a29eee4e73 Don't print error reports in release builds 2018-07-06 09:56:34 -05:00
Senthil Ramakrishnan a443e9bb47 Fix wrong config binding 2018-07-03 14:00:46 -05:00
Cruz Monrreal 7e0f75e831
Merge pull request #7331 from TomoYamanaka/improve_bootloader
Improve the process for Cortex-A9 in mbed_application
2018-07-03 07:37:19 -05:00
Martin Kojtal ffcb6ecfb5 platform: astyle update 2018-06-29 10:38:44 +01:00
Senthil Ramakrishnan 0e25447b78 Fix error history related comments 2018-06-27 15:32:38 -05:00
TomoYamanaka 9c99d7eb17 Improve the process for Cortex-A9 in mbed_application
I added the powerdown func by GIC in mbed_application because Cortex-A9 use GIC instead of NVIC.
This process prevent unexpected interrupt when updating software by using bootloader.
2018-06-26 19:17:59 +09:00
Cruz Monrreal ea47342f81
Merge pull request #7214 from SenRamakri/sen_ErrorOptimAndConfig
Error handling configuration updates and Optimization for exception handling
2018-06-25 10:10:49 -05:00
TomoYamanaka 5c036cb1ba Add the process for Cortex-A in mbed_applicaion
I added the process for Cortex-A in mbed_application.c because this process was for only Cortex-M.
Also I enabled the macro of MBED_APPLICATION_SUPPORT for Cortex-A.
2018-06-22 10:47:23 +09:00
Senthil Ramakrishnan baa44eb3f2 Limit error filename capture to 64 chars, wrapping tests with right configs and astyle fixes. 2018-06-20 11:56:32 -05:00
Senthil Ramakrishnan cbb12e326d Updates to configuration flags used in error handling implementation.
The new configuration make Error history tracking switched off by default and enabled by using the config flag MBED_CONF_PLATFORM_ERROR_HIST_ENABLED.
Config flag MBED_CONF_PLATFORM_ERROR_ALL_THREADS_INFO enables printing info of all threads. This will be turned off by default.
2018-06-20 11:56:31 -05:00
Cruz Monrreal dabb112ebd
Merge pull request #7117 from OpenNuvoton/nuvoton_fix_armc6_memtrace2
Fix compile error with MBED_MEM_TRACING_ENABLED and ARMC6
2018-06-14 10:14:46 -05:00
Cruz Monrreal 38f9519ccc
Merge pull request #6949 from OpenNuvoton/nuvoton_m23_bootloader
Support mbed_start_application for Cortex-M23
2018-06-07 10:10:46 -05:00
Martin Kojtal 4f90f4c735 error: fix undeclared memcpy
Some targets do not get string header file in, results in the warning:
implicit declaration of function 'memcpy'
2018-06-06 09:00:27 +01:00
ccli8 0597998d91 Fix compile error with MBED_MEM_TRACING_ENABLED and ARMC6 2018-06-05 17:34:28 +08:00
Cruz Monrreal 50cd664628
Merge pull request #7050 from SenRamakri/sen_ErrorHandlingFilenameFix
Fix for filename capture not working
2018-06-04 10:43:56 -05:00
Senthil Ramakrishnan 576bd61d96 Do not capture filename for release builds 2018-05-31 11:30:33 -05:00
Senthil Ramakrishnan 68e59a11b9 Fix for error report not printing when calling error API 2018-05-31 11:27:20 -05:00
Senthil Ramakrishnan 07a6ab0864 Fix for filename capture not working 2018-05-31 10:39:58 -05:00
deepikabhavnani d764a7c627 OS version is not available in code, need a fix for this in next patch release 2018-05-30 08:57:47 -05:00
ccli8 23dcd82fab Remove superfluous MOVT in mbed_start_application/start_new_application 2018-05-30 09:39:07 +08:00
ccli8 3c14cb6332 Fix mbed_start_application on Cortex-M23
1. M23 doesn't support ICTR and supports up to 240 external interrupts.
2. Fix reset of SHPR
3. Fix inline assembly compile error with ARMC6
2018-05-28 11:43:27 +08:00
Bartek Szatkowski efd307fa79 Rename new occurrences of LOWPOWERTIMER to LPTICKER 2018-05-25 12:33:43 -05:00
Senthil Ramakrishnan 92e0cbfaef Doxygen fixes 2018-05-23 13:27:57 -05:00
Senthil Ramakrishnan 5ef6728c08 Splitting MBED_ERROR macros to support ones with/without error value argument 2018-05-23 12:21:28 -05:00
Senthil Ramakrishnan 693a6c40bb Refactor error reporting 2018-05-23 12:21:11 -05:00
Senthil Ramakrishnan d4fe75731d Adding mbed prefixes to all macros and functions to avoid namespace conflicts 2018-05-23 12:21:10 -05:00
Senthil Ramakrishnan 147d9cac4e Test application/cases optimization for some low memory targets, macro changes and test fixes 2018-05-23 12:21:10 -05:00
Senthil Ramakrishnan f9c25612ae Fix test failures when trap errors are enabled and other fixes 2018-05-23 12:21:10 -05:00
Senthil Ramakrishnan cbfc06577b Fixes to align with naming conventions 2018-05-23 12:21:09 -05:00
Senthil Ramakrishnan 92df68b1ea Changed variable names for registers to avoid namespace conflicts, build fixes, macros and other fixes 2018-05-23 12:21:09 -05:00
Senthil Ramakrishnan 530e9d323f Changed variable names for registers to avoid namespace conflicts and rtos disabled build fixes 2018-05-23 12:21:09 -05:00
Senthil Ramakrishnan 2e28dd95e1 Change set_error/set_error_fatal to warning/error, add itm support and other changes 2018-05-23 12:21:08 -05:00
Senthil Ramakrishnan 7c6c718f75 Fixed entity reporting and comments 2018-05-23 12:21:08 -05:00
Senthil Ramakrishnan 839fef0ad1 Added more tests for error log and error reporting, updated doxygen comments 2018-05-23 12:21:07 -05:00
Senthil Ramakrishnan 9041b475c6 Error handling/logging implementation and tests 2018-05-23 12:21:07 -05:00
Martin Kojtal 23d8085174
Merge pull request #6878 from bulislaw/rtc_lp_ticker
Add low power timer fallback for platforms without RTC
2018-05-22 14:35:18 +02:00
Martin Kojtal 5d027f4e27
Merge pull request #6857 from deepikabhavnani/cpu_stats
CPU Statistics
2018-05-22 14:30:21 +02:00
Martin Kojtal 02af950f62
Merge pull request #6336 from geky/fat-errors
fatfs: Update error code mapping
2018-05-22 14:27:01 +02:00
Cruz Monrreal a301db5d43
Merge pull request #6791 from kjbracey-arm/fcntl
Add POSIX fcntl flag support
2018-05-21 17:17:02 -05:00
ccli8 646f61400a Fix start_new_application compile error on Cortex-M23
With "mov r2, #0", compile OK with GCC_ARM, but failed with ARMC6.
With "ldr r2, =0", compile OK with ARMC6, but failed with GCC_ARM.
Finally, with "movw r2, #0"/"movt r2, #0", compile OK with both ARMC6 and GCC_ARM.
2018-05-21 17:39:09 +08:00
ccli8 b3f17a9e01 Support mbed_start_application for Cortex-M23 2018-05-18 17:33:05 +08:00
Christopher Haster effdc6571b retarget: Added workaround for conflicting definitions of error_t
The errno.h header file defines the type error_t, unfortunately this
is a common type name that may be defined in user code. For at least GCC
we can work around this by telling errno that the error_t is already
defined.
2018-05-17 10:26:33 -05:00
Christopher Haster 78992a4c26 retarget: Added include errno.h
Unfortunately, some toolchains don't define the same errno codes that
are used fairly consistently on Linux based platforms, which means they
also don't match the errno codes used in the retarget layer.

If a user includes errno.h after mbed.h, the errno codes can be
redefined incorrectly.

Adding an include of errno.h in mbed.h forces the order to be fixed.
2018-05-17 10:26:33 -05:00
Deepika 029237b683 Addressed review comments
1. LP ticker limiation note
2. Use read_us in mbed_uptime function
3. Doxygen recommendations
4. Use us_timestamp_t instead uint64_t
5. Astyle changes
2018-05-15 11:36:08 -05:00
deepikabhavnani 3420ff7f9c CPU statistics addition
API to get CPU stats like sleep/deepsleep time, uptime and idle time.
These can be used by application to know the CPU Usage runtime.
2018-05-15 11:20:52 -05:00
Deepika 1961428c1b OS version added + CPUID for cortex-M only
CPUID base register is available for Cortex-M processors only.
Cortex-A devices have Main ID Register, which can be used in future to
get processor info.
2018-05-15 10:22:13 -05:00
deepikabhavnani c08b3e3d3d System Info API addition
API added to get the system information like CPU ID, compiler ID and
compiler version.
2018-05-15 10:17:40 -05:00
Bartek Szatkowski ac9276499f Add low power timer fallback for platforms without RTC
Low power timer will be used as RTC for platforms that don't have HW RTC
capabilities.
2018-05-14 12:07:59 +01:00
deepikabhavnani 97c88188d0 Cleanup
1. Enable watermark to get stack space information
2. Restructured code
3. Throw error if MBED_THREAD_STATS_ENABLED is not set
4. Astyle changes
2018-05-11 10:06:44 -05:00
deepikabhavnani f43b16ffd9 Cleaup and review comments addressed
1. Removed prefix thread_ from all elements of mbed_stats_thread_t
2. #if conditions aligned to rest of the file
2018-05-11 10:05:35 -05:00
deepikabhavnani 1dad73949c Thread statistics addition.
API to get all system threads information and states.
2018-05-11 10:05:32 -05:00
Cruz Monrreal ab7a856657
Merge pull request #6784 from deepikabhavnani/mbed_stats_fix
Add common define MBED_ALL_STATS_ENABLED to enable all statistics
2018-05-10 23:25:23 -05:00
Cruz Monrreal a2370d57fa
Merge pull request #6809 from deepikabhavnani/add_assert
Mbed Stats: Assert if NULL pointer passed as arg
2018-05-09 10:50:10 -05:00
Cruz Monrreal 68ad00ffb8
Merge pull request #6645 from woodsking2/master
mbed_wait_api: add comments to warn the func will lock deep sleep
2018-05-08 10:54:48 -05:00
Cruz Monrreal 39fd120064
Merge pull request #6797 from OpenNuvoton/nuvoton_fix_noserial
Fix compile error with DirectSerial in serial-less build
2018-05-07 10:27:27 -05:00
deepikabhavnani 0f0a4c0a50 Check for NULL pointer before access 2018-05-03 11:23:12 -05:00
Kevin Bracey cf91b1c6d7 Add POSIX fcntl to control blocking
Add the POSIX fcntl call, but only implementing F_SETFL and F_GETFL
for O_NONBLOCK, so users can control the blocking flag of streams
with only the integer file descriptor.

Necessary to portably control the blockingness of the console:

    int flags = fcntl(STDOUT_FILENO, F_GETFL);
    fcntl(STDOUT_FILENO, F_SETFL, flags | O_NONBLOCK);
2018-05-03 15:40:26 +03:00
Kevin Bracey a8ab233a1a retarget: distinguish FileHandle and descriptor
Avoid using `fh` for the integer descriptor numbers, reserving
that for the `FileHandle` objects - use `fildes` or `fd`,
matching POSIX.
2018-05-03 15:40:26 +03:00
Kevin Bracey 59f49e2b96 Add `is_blocking()` method to FileHandle
There was no way to check current blocking state, so no way to modify
and restore status.

Also have default FileHandle::set_blocking() used by real files return a
correct error code when asked for non-blocking, and success when asked
for blocking.

These were minor omissions that are required to implement POSIX fcntl
properly.

fixup! Add `is_blocking()` method to FileHandle
2018-05-03 15:38:33 +03:00
ccli8 bfe9ee7777 Fix compile error with DirectSerial in serial-less build 2018-05-03 10:52:09 +08:00
James Wang c9b2640f70 mbed_wait_api: wait_ms() wait() wait_us() add "If the RTOS is present" comments 2018-05-03 10:22:32 +08:00
deepikabhavnani a228fd0f3b Add common define to enable all statistics
As part of Device Health requirement, all mbed OS statistics should be
enabled with single macro `MBED_ALL_STATS_ENABLED`
2018-05-02 14:14:07 -05:00
ccli8 89622378d8 Fix compile error with MBED_MEM_TRACING_ENABLED and ARMC6 2018-04-27 14:19:12 +08:00
Kevin Bracey 39fa676993 Make poll() use RTOS tick count
RTOS maintains a tick count - use it, avoiding issues with sleep and low
power timers.
2018-04-23 14:42:59 +03:00
Martin Kojtal c6b6bab2f9
Merge pull request #6630 from OpenNuvoton/nuvoton_add_nonsecure_flash
Support secure/non-secure flash IAP for Cortex-M23/M33
2018-04-19 17:24:27 +02:00
James Wang 27ce443a70 accept Amanda Butler's review. change to "This function always spins to get the exact number of microseconds, which potentially affects power (such as preventing deep sleep) and multithread performance. You can avoid it by using Thread::wait()." 2018-04-18 10:22:50 +08:00
Cruz Monrreal d680ceeba6
Merge pull request #6603 from marcuschangarm/fix-flowcontrol
Optional hardware flow control for STDOUT
2018-04-17 13:15:31 -05:00
Cruz Monrreal 7dabd247ab
Merge pull request #6510 from yossi2le/add-deprecated-doxygen-remarks
Adding missing @deprecated to function inline documentation
2018-04-17 10:53:54 -05:00
James Wang 04627992db Accept Kevin Bracey's review, "wait_ms() and wait(float) always spin to get an exact number of microseconds, potentially impacting power and multi-thread performance. Again, avoided by Thread::wait()". 2018-04-17 18:11:59 +08:00
James Wang efc228ff06 accept Cruz Monrreal's review 2018-04-17 15:23:15 +08:00
James Wang 4c69419e2e mbed_wait_api: add comments to warn the func will lock deep sleep 2018-04-16 18:13:15 +08:00
Marcus Chang 7e6538ffed Optional hardware flow control for STDOUT
Some platforms have interface chips with hardware flow control
enabled by default. This commit adds configurable flow control to
STDOUT.

Usage:

* Define pin names STDIO_UART_RTS for Rx-flow-control and
  STDIO_UART_CTS for Tx-flow-control.
* Set target.console-uart-flow-control. Valid options are:
  null, RTS, CTS, and RTSCTS.
2018-04-15 20:12:14 -07:00
ccli8 1b7b94e0ad Add MBED_NONSECURE_ENTRY for all-toolchain secure gateway functions 2018-04-16 09:38:39 +08:00
Cruz Monrreal 339283b3b8
Merge pull request #6418 from amq/poll-lowpowertimer
Add an option to use LowPowerTimer for poll
2018-04-12 18:37:22 -05:00
Senthil Ramakrishnan 194b89cce6 Fix doxygen comments to reflect the deprecated functions 2018-04-03 14:10:39 -05:00
Yossi Levy 8684a63732 Fix Travis CI docs issues 2018-04-02 13:01:21 +03:00
Yossi Levy 57b4653a98 Adding @deprecated functions to the inline documentation of deprecated functions 2018-03-29 12:05:26 +03:00
amq fc412bba5f
Include LowPowerTimer.h 2018-03-28 21:53:35 +02:00
Cruz Monrreal ddf70f1dc9
Merge pull request #6377 from scartmell-arm/feature-deep-sleep-tracing-filename-fix
Replace runtime strip_path function with compiler intrinsic equivalents
2018-03-23 10:28:25 -05:00
Cruz Monrreal 9932b4c983
Merge pull request #6309 from deepikabhavnani/peek_api
Peek API to view data of buffer without popping
2018-03-22 11:28:15 -05:00
Cruz Monrreal 3ddca11395
Merge pull request #6368 from kjbracey-arm/atomic_volatile
Sort out volatiles in the atomic functions
2018-03-21 17:03:27 -05:00
amq 2e9ff4755c Add an option to use LowPowerTimer for poll 2018-03-21 05:05:58 +00:00
Steven Cartmell ab2abcb29d Fix issues with __FILENAME__ macro
- Move macro definition to mbed_toolchain.h
- Remove double underscores from macro which are reserved.
- Fix macro for IAR until compiler flags to disable path are added again.
2018-03-20 14:29:34 +00:00
Steven Cartmell 1e3050a1df Remove superfluous compiler check in macro 2018-03-16 14:41:56 +00: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
Steven Cartmell bd63f93984 Replace runtime strip_path function with compiler intrinsic equivalents
Sleep manager tracing strips the path from filenames and uses the result as an
identifier to track drivers that unlock/lock sleep tracing. Replace the function
that strips the path from the string, replace this function with a new macro,
__FILENAME__ which performs the same action in a compiler specific manner.

- GCC_ARM, use __builtin_strrchr which is optimized out at compile time.
- ARM, use __MODULE__ which returns the filename without path.
- IAR, specifiy the --no_path_in_file_macros compiler flag.
2018-03-15 15:49:42 +00:00
Kevin Bracey a8f75e324d Add volatile qualifiers to atomic functions
The atomic functions preserve volatile semantics - they only perform the
accesses specified. Add the volatile qualifier to the value pointer to
reflect this. This does not change existing caller code - it's
equivalent to adding a const qualifier to indicate we don't write to
a pointer - it means people can pass us qualified pointers without
casts, letting the compile check const- or volatile-correctness.

This is consistent with C11 <stdatomic.h>, which volatile-qualifies its
equivalent functions.

Note that this useage of volatile has nothing to do with the atomicity -
objects accessed via the atomic functions do not need to be volatile.
But it does permit these calls to be used on objects which have been
declared volatile.
2018-03-15 11:06:27 +02:00
Kevin Bracey f62b93926a Remove unnecessary casts
The volatile qualifier on the __LDREX/__STREX prototypes only means that
it's safe to use them on volatile objects. Doesn't mean you actually
have to pass them volatile pointers.

Adding the volatile is a bit like doing strlen((const char *) ptr)
because you've got a non-const pointer.
2018-03-15 11:06:27 +02:00
Deepika 9fa660ebde Peek API to view data of buffer without popping 2018-03-08 14:47:21 -06:00
Wolfgang Betz 3057aa71f9 Align `ATCmdParser::process_oob()` to `ATCmdParser::vrecv()`'s newline handling 2018-03-08 14:06:30 +01:00
Bartek Szatkowski d6f57bc3e8 Fix review comments and merge issues 2018-03-02 00:29:14 +00:00
Steven Cartmell 206cc299e0 Fix merge conflict mishap 2018-03-01 17:33:21 +00:00
Steven Cartmell bd23625d23 Rename SLEEP_STATS_ENABLED to SLEEP_TRACING_ENABLED 2018-03-01 17:25:33 +00:00
Steven Cartmell 74bdf1c3a3 Rename SLEEP_PROFILING_ENABLED to MBED_SLEEP_STATS_ENABLED 2018-03-01 17:25:15 +00:00
Steven Cartmell 0f6b73ae0f Add optional tracing to sleep manager lock/unlock
Add tracing output to console to track when drivers lock and unlock deep
sleep. Tracing output is enabled by configuring the
'SLEEP_PROFILING_ENABLED' at compile time.

- Wrapped sleep_manager_lock/sleep_manager_unlock in a macro to
conditionally call tracing functions when 'SLEEP_PROFILING_ENABLED' is
set.
- Define a global structure to track driver names and how many locks
they hold in the sleep manager.
2018-03-01 17:24:53 +00:00
Bartek Szatkowski 4cb47df40a Add system_reset() function to Mbed OS 2018-02-28 16:42:34 +00:00
Anna Bridge dce5a2febe
Merge pull request #6209 from pan-/improve-sleep-header
Platform: Improve mbed_sleep.h
2018-02-28 14:12:54 +00:00