Skip to content

Release mbed lib v124 + mbed os 5.1.2 #2499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 68 commits into from
Aug 19, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
8d740d5
Add a test for thread-safe malloc
c1728p9 Jul 30, 2016
c88f282
Added the missing on-board SPI LSM303C sensor SPI pin definition to a…
Aug 1, 2016
3622e3a
Update analogin_api.c
peeyushpashine Aug 3, 2016
490d5e7
Clean pwm and analog definition
svastm Jul 21, 2016
0c12ad5
Clean pwm and analog definition
svastm Jul 21, 2016
ecd2945
Add Cortex-M7 Nanostack binaries
c1728p9 Aug 5, 2016
2190391
KL27Z: Fix duplicate define error
mmahadevan108 Aug 9, 2016
e913f49
Fix heap limit checking and make memory explicit
c1728p9 Jul 29, 2016
91a48a8
Adjust stack size for the nrf51
c1728p9 Aug 3, 2016
4ce977e
Override new and delete operators to trap errors
c1728p9 Aug 1, 2016
863eddb
Correctly set INITIAL_SP for K64F
c1728p9 Aug 3, 2016
0bd2573
Turn on main thread stack checking
c1728p9 Jul 29, 2016
59e4e81
Add a test for heap and stack layout
c1728p9 Jul 29, 2016
5dd5df2
Decrease NUC472 interrupt stack size
c1728p9 Aug 8, 2016
5046c2e
Fix nrf52 initial stack pointer in ARMCC
c1728p9 Aug 9, 2016
1a465d6
Increase interrupt stack size for K64F
c1728p9 Aug 9, 2016
fb70f79
Fix possible overflow of NRF51 os tick.
pan- Aug 10, 2016
cf09dce
Create MBED_A28 test in the common list
jeromecoutant Aug 10, 2016
7de28b5
Add Serial Flow Control pins
bcostm Aug 10, 2016
396f563
Add Serial Flow Control pins
bcostm Aug 10, 2016
6c872f3
Add Serial Flow Control pins
bcostm Aug 10, 2016
1e8e71e
Add Serial Flow Control pins
bcostm Aug 10, 2016
8091386
Add Serial Flow Control pins
bcostm Aug 10, 2016
2c1a790
Add Serial Flow Control pins
bcostm Aug 10, 2016
418e9f0
Activate SERIAL_FC in targets.json
bcostm Aug 10, 2016
3b9b2ec
Add missing serial flow control elements in serial structure
bcostm Aug 10, 2016
ed57495
build_mbed_libs is now aware of the configuration
Aug 10, 2016
ffcfc88
CAN loopback test: correct some NUCLEO pin
jeromecoutant Aug 11, 2016
70abacc
Add config data to build_lib in build_api.py
Aug 11, 2016
040ae6c
Remove argument from tool/project.py -b
theotherjimmy Aug 11, 2016
622347f
Add asynchronous serial
svastm Aug 8, 2016
ef1ffaf
Enable asynchronous serial
svastm Aug 8, 2016
c247f2f
Add tests for asynchronous serial
svastm Aug 8, 2016
a459e85
Improve error for missing name from mbed_lib.json
theotherjimmy Aug 11, 2016
61cd9eb
Add support for IAR compiler
fvincenzo Aug 11, 2016
5ddba77
Change release_version to 5
fvincenzo Aug 12, 2016
74de744
Add support for mbed OS 5
ytsuboi Aug 15, 2016
a007d91
Add support for KL43Z using KSDK 2.0
mmahadevan108 Aug 5, 2016
8753dd6
Add support for FRDM K66
mmahadevan108 Aug 9, 2016
2598daa
Fixed I2C bug.
jeremybrodt Aug 16, 2016
0f847f4
Fixed i2c_byte_write() return value.
jeremybrodt Aug 16, 2016
a135a9a
Fixed analogout bugs.
jeremybrodt Aug 16, 2016
0c59485
Updated bit-band macros to match latest MXC convention.
jeremybrodt Aug 16, 2016
2e786ba
Added missing register definitions.
jeremybrodt Aug 16, 2016
69d4a92
Synchronizing SPI drivers.
jeremybrodt Aug 16, 2016
5b4a0b4
Stylize utils.py
theotherjimmy Jul 27, 2016
899d8c5
Format bulid_api
theotherjimmy Aug 12, 2016
f65b6d3
Glorify config.py (passes pylint)
theotherjimmy Aug 12, 2016
7600a32
Edit the English of the docstrings
theotherjimmy Aug 12, 2016
5755127
Reveal cumulative attributes from Targets
theotherjimmy Aug 12, 2016
e40d95e
Format targets.py
theotherjimmy Aug 12, 2016
895d717
Expand docstrings in build_api
theotherjimmy Aug 15, 2016
7d733fe
Format and add docstrings to memmap
theotherjimmy Aug 15, 2016
de065ab
Format and document colorize
theotherjimmy Aug 15, 2016
4cdd267
Format paths python module
theotherjimmy Aug 15, 2016
d25230f
Add pylint configuration file
theotherjimmy Aug 15, 2016
c7bc655
Format and document libraries.py
theotherjimmy Aug 15, 2016
efb7cfb
Format detect_targets.py
theotherjimmy Aug 15, 2016
b12ad8e
Format and document hooks.py
theotherjimmy Aug 15, 2016
af5d35d
Format and document options.py
theotherjimmy Aug 15, 2016
6d70a7a
Add pylint testing to Travis
theotherjimmy Aug 15, 2016
26e7a35
Fix remaining issues in targets.py
theotherjimmy Aug 15, 2016
1dc77ac
Made linting a recommendation and raised the bar for printing
theotherjimmy Aug 16, 2016
aa9b5df
Added more well-defined garuntees on deprecation notices in mbed
geky Aug 8, 2016
7b02d53
Updated deprecation notices to match branch names
geky Aug 17, 2016
0b195e8
Added exporting support
ytsuboi Aug 17, 2016
5a78cf3
mbed lib revision - 124
0xc0170 Aug 18, 2016
ec15ee6
targets - KL27Z IAR removal
0xc0170 Aug 19, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[Format]
max-line-length=80
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ python:

script:
- PYTHONPATH=. python tools/test/config_test/config_test.py
- python tools/test/pylint.py
- py.test tools/test/toolchains/api.py
- python tools/build_travis.py
before_install:
Expand All @@ -17,3 +18,4 @@ install:
- sudo pip install prettytable
- sudo pip install jinja2
- sudo pip install pytest
- sudo pip install pylint
12 changes: 11 additions & 1 deletion TESTS/mbedmicro-mbed/attributes/attributes.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,17 @@ int testDeprecatedUsed() {
return 0;
}

MBED_DEPRECATED_SINCE("mbed-os-3.14", "this message should not be displayed")
void testDeprecatedSinceUnused();
void testDeprecatedSinceUnused() { }

MBED_DEPRECATED_SINCE("mbed-os-3.14", "this message should be displayed")
int testDeprecatedSinceUsed();
int testDeprecatedSinceUsed() {
return 0;
}

int testDeprecated() {
return testDeprecatedUsed();
return testDeprecatedUsed() + testDeprecatedSinceUsed();
}

68 changes: 68 additions & 0 deletions TESTS/mbedmicro-rtos-mbed/malloc/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#include "mbed.h"
#include "test_env.h"
#include "rtos.h"

#if defined(MBED_RTOS_SINGLE_THREAD)
#error [NOT_SUPPORTED] test not supported
#endif

#define NUM_THREADS 5
#define THREAD_STACK_SIZE 256

DigitalOut led1(LED1);
volatile bool should_exit = false;
volatile bool allocation_failure = false;

void task_using_malloc(void)
{
void* data;
while (1) {
// Repeatedly allocate and free memory
data = malloc(100);
if (data != NULL) {
memset(data, 0, 100);
} else {
allocation_failure = true;
}
free(data);

if (should_exit) {
return;
}
}
}

int main()
{
Thread *thread_list[NUM_THREADS];
int test_time = 15;
GREENTEA_SETUP(20, "default_auto");

// Allocate threads for the test
for (int i = 0; i < NUM_THREADS; i++) {
thread_list[i] = new Thread(osPriorityNormal, THREAD_STACK_SIZE);
if (NULL == thread_list[i]) {
allocation_failure = true;
}
thread_list[i]->start(task_using_malloc);
}

// Give the test time to run
while (test_time) {
led1 = !led1;
Thread::wait(1000);
test_time--;
}

// Join and delete all threads
should_exit = 1;
for (int i = 0; i < NUM_THREADS; i++) {
if (NULL == thread_list[i]) {
continue;
}
thread_list[i]->join();
delete thread_list[i];
}

GREENTEA_TESTSUITE_RESULT(!allocation_failure);
}

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
12 changes: 8 additions & 4 deletions hal/api/FunctionPointer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ namespace mbed {
template <typename R, typename A1>
class FunctionPointerArg1 : public Callback<R(A1)> {
public:
MBED_DEPRECATED("FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
MBED_DEPRECATED_SINCE("mbed-os-5.1",
"FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
FunctionPointerArg1(R (*function)(A1) = 0)
: Callback<R(A1)>(function) {}

template<typename T>
MBED_DEPRECATED("FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
MBED_DEPRECATED_SINCE("mbed-os-5.1",
"FunctionPointerArg1<R, A> has been replaced by Callback<R(A)>")
FunctionPointerArg1(T *object, R (T::*member)(A1))
: Callback<R(A1)>(object, member) {}

Expand All @@ -46,12 +48,14 @@ class FunctionPointerArg1 : public Callback<R(A1)> {
template <typename R>
class FunctionPointerArg1<R, void> : public Callback<R()> {
public:
MBED_DEPRECATED("FunctionPointer has been replaced by Callback<void()>")
MBED_DEPRECATED_SINCE("mbed-os-5.1",
"FunctionPointer has been replaced by Callback<void()>")
FunctionPointerArg1(R (*function)() = 0)
: Callback<R()>(function) {}

template<typename T>
MBED_DEPRECATED("FunctionPointer has been replaced by Callback<void()>")
MBED_DEPRECATED_SINCE("mbed-os-5.1",
"FunctionPointer has been replaced by Callback<void()>")
FunctionPointerArg1(T *object, R (T::*member)())
: Callback<R()>(object, member) {}

Expand Down
2 changes: 1 addition & 1 deletion hal/api/mbed.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#ifndef MBED_H
#define MBED_H

#define MBED_LIBRARY_VERSION 123
#define MBED_LIBRARY_VERSION 124

#if MBED_CONF_RTOS_PRESENT
#include "rtos/rtos.h"
Expand Down
17 changes: 16 additions & 1 deletion hal/api/toolchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
* Mark a function declaration as deprecated, if it used then a warning will be
* issued by the compiler possibly including the provided message. Note that not
* all compilers are able to display the message.
*
*
* @code
* #include "toolchain.h"
*
Expand All @@ -225,6 +225,21 @@
#endif
#endif

/** MBED_DEPRECATED_SINCE("version", "message string")
* Mark a function declaration as deprecated, noting that the declaration was
* deprecated on the specified version. If the function is used then a warning
* will be issued by the compiler possibly including the provided message.
* Note that not all compilers are able to display this message.
*
* @code
* #include "toolchain.h"
*
* MBED_DEPRECATED_SINCE("mbed-os-5.1", "don't foo any more, bar instead")
* void foo(int arg);
* @endcode
*/
#define MBED_DEPRECATED_SINCE(D, M) MBED_DEPRECATED(M " [since " D "]")


// FILEHANDLE declaration
#if defined(TOOLCHAIN_ARM)
Expand Down
43 changes: 43 additions & 0 deletions hal/common/retarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#include "mbed_interface.h"
#include "SingletonPtr.h"
#include "PlatformMutex.h"
#include "mbed_error.h"
#include <stdlib.h>
#if DEVICE_STDIO_MESSAGES
#include <stdio.h>
#endif
Expand Down Expand Up @@ -68,6 +70,10 @@ extern const char __stdout_name[] = "/stdout";
extern const char __stderr_name[] = "/stderr";
#endif

// Heap limits - only used if set
unsigned char *mbed_heap_start = 0;
uint32_t mbed_heap_size = 0;

/* newlib has the filehandle field in the FILE struct as a short, so
* we can't just return a Filehandle* from _open and instead have to
* put it in a filehandles array and return the index into that array
Expand Down Expand Up @@ -596,6 +602,12 @@ extern "C" caddr_t _sbrk(int incr) {
return (caddr_t)-1;
}

// Additional heap checking if set
if (mbed_heap_size && (new_heap >= mbed_heap_start + mbed_heap_size)) {
errno = ENOMEM;
return (caddr_t)-1;
}

heap = new_heap;
return (caddr_t) prev_heap;
}
Expand Down Expand Up @@ -714,3 +726,34 @@ extern "C" void __env_unlock( struct _reent *_r )
#endif

} // namespace mbed

void *operator new(std::size_t count)
{
void *buffer = malloc(count);
if (NULL == buffer) {
error("Operator new out of memory\r\n");
}
return buffer;
}

void *operator new[](std::size_t count)
{
void *buffer = malloc(count);
if (NULL == buffer) {
error("Operator new[] out of memory\r\n");
}
return buffer;
}

void operator delete(void *ptr)
{
if (ptr != NULL) {
free(ptr);
}
}
void operator delete[](void *ptr)
{
if (ptr != NULL) {
free(ptr);
}
}
Loading