The callback class can now accept generalized function-objects: class Thing { public: int value; void operator()() { printf("hi! %d\n", value); } }; Callback<void()> cb(Thing(2)); However, with the intention of avoiding implicit dynamic-memory allocations, the Callback class is limited to a single word of storage. Exceeding this size will eliminate the function-object type from the overload set and fail to compile. Effort was invested to make this situation very clear to the user. Here is an example error message with noise removed: [ERROR] ./main.cpp: In function 'int main()': ./mbed-os/hal/api/Ticker.h:101:10: note: no known conversion for argument 1 from 'BigFunc' to 'mbed::Callback<void()>' The real benefit of this change is the ability for users to hook into the attributes of the Callback class. This mostly allows lifetime management of the function-objects from third-party libraries (such as the Event class from mbed-events). Note: The convenient `callback` function may become ambiguous if provided with a type that defines multiple incompatible `operator()` member functions. |
||
---|---|---|
.github | ||
TESTS | ||
docs | ||
features | ||
hal | ||
libraries | ||
rtos | ||
tools | ||
.gitattributes | ||
.gitignore | ||
.pylintrc | ||
.travis.yml | ||
CONTRIBUTING.md | ||
DOXYGEN_FRONTPAGE.md | ||
Jenkinsfile | ||
LICENSE | ||
MANIFEST.in | ||
README.md | ||
mbed_lib.json | ||
requirements.txt | ||
setup.py |
README.md
ARM mbed OS
mbed OS is an open-source embedded operating system designed specifically for the "things" in the Internet of Things (IoT). It includes all the features you need to develop a connected product based on an ARM Cortex-M microcontroller.
mbed OS accelerates the process of creating a connected product by providing a platform operating system that includes robust security foundations, standards based communication capabilities, built-in cloud management services, and drivers for sensors, I/O devices and connectivity. mbed OS is built as a modular, configurable software stack so that you can readily customize it to the device you're developing for, and reduce memory requirements by excluding unnecessary software components.
Current release
Our current release series is mbed OS 5.1:
Getting Started for Developers
We have a getting started guide for developers using mbed OS in applications:
Getting Started for Contributors
We have a getting started guide for contributors working on mbed OS:
- Have a look in the docs directory