From 1492829f82521c07732b5a7df2d722dd88574835 Mon Sep 17 00:00:00 2001 From: Kevin Bracey Date: Tue, 18 Sep 2018 12:35:34 +0300 Subject: [PATCH 01/30] poll: Un-doxygen internal comment --- platform/mbed_poll.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/mbed_poll.cpp b/platform/mbed_poll.cpp index 6d8341020d..5ca1b9a328 100644 --- a/platform/mbed_poll.cpp +++ b/platform/mbed_poll.cpp @@ -29,7 +29,7 @@ namespace mbed { // timeout -1 forever, or milliseconds int poll(pollfh fhs[], unsigned nfhs, int timeout) { - /** + /* * TODO Proper wake-up mechanism. * In order to correctly detect availability of read/write a FileHandle, we needed * a select or poll mechanisms. We opted for poll as POSIX defines in From 69fc875e19ec8b3980e5710c5d8ae9c0d3b0c962 Mon Sep 17 00:00:00 2001 From: Wilfried Chauveau Date: Fri, 21 Sep 2018 07:15:53 +0100 Subject: [PATCH 02/30] align github's issue template with pull request's look&feel. --- .github/issue_template.md | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/issue_template.md b/.github/issue_template.md index bb6b11d530..5d8594d402 100644 --- a/.github/issue_template.md +++ b/.github/issue_template.md @@ -1,5 +1,6 @@ ### Description - - -[ ] Question -[ ] Enhancement -[ ] Bug + [ ] Question + [ ] Enhancement + [ ] Bug From 4687e50dfd1b4f58c00e6f055d2dcb491b7142f4 Mon Sep 17 00:00:00 2001 From: Lari-Matias Orjala Date: Mon, 24 Sep 2018 09:53:06 +0300 Subject: [PATCH 03/30] Improve unit testing instructions. --- UNITTESTS/README.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/UNITTESTS/README.md b/UNITTESTS/README.md index 4d40a7120e..5181383464 100644 --- a/UNITTESTS/README.md +++ b/UNITTESTS/README.md @@ -162,9 +162,11 @@ Use Mbed CLI to build and run unit tests. For advanced use, you can run CMake an 1. Move to the build directory `cd UNITTESTS/build`. 1. Run CMake using a relative path to `UNITTESTS` folder as the argument. So from `UNITTESTS/build` use `cmake ..`: - Add `-g [generator]` if generating other than Unix Makefiles such in case of MinGW use `-g "MinGW Makefiles"`. - - Add `-DCOVERAGE:True` to add coverage compiler flags. + - Add `-DCMAKE_MAKE_PROGRAM=`, `-DCMAKE_CXX_COMPILER=` and `-DCMAKE_C_COMPILER=` to use a specific make program and compilers. + - Add `-DCMAKE_BUILD_TYPE=Debug` to build a debug build. + - Add `-DCOVERAGE=True` to add coverage compiler flags. - See the [CMake manual](https://cmake.org/cmake/help/v3.0/manual/cmake.1.html) for more information. -1. Run a make program (Make, Gmake, Mingw32-make and so on) to build the tests. +1. Run a make program to build the tests. #### Run tests directly with CTest @@ -177,9 +179,19 @@ Run a test binary in the build directory to run a unit test suite. To run multip 1. Add test executables into the list. 1. Run them. +### Debugging + +1. Use Mbed CLI to build a debug build. For advanced use, run CMake directly with `-DCMAKE_BUILD_TYPE=Debug` and then run a make program. +1. Run GDB with a test executable as an argument to debug unit tests. + ### Get code coverage -Use Mbed CLI to generate code coverage reports. For advanced use, you can run Gcovr or any other code coverage tool directly in the build directory. +Use Mbed CLI to generate code coverage reports. For advanced use, follow these steps: + +1. Run CMake with both `-DCMAKE_BUILD_TYPE=Debug` and `-DCOVERAGE=True`. +1. Run a make program to build the tests. +1. Run the tests. +1. Run Gcovr or any other code coverage tool directly in the build directory. ### Troubleshooting From 027e030d76657ea4961bcc569366065c78a506ff Mon Sep 17 00:00:00 2001 From: Amanda Butler Date: Wed, 26 Sep 2018 12:00:47 -0500 Subject: [PATCH 04/30] Edit README.md Edit readme. --- UNITTESTS/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/UNITTESTS/README.md b/UNITTESTS/README.md index 5181383464..0b23dbfcbe 100644 --- a/UNITTESTS/README.md +++ b/UNITTESTS/README.md @@ -1,6 +1,6 @@ ## Unit testing -This document describes how to write and test unit tests for Mbed OS. To prevent and solve problems, please see the [troubleshooting](#troubleshooting) section. +This document describes how to write and test unit tests for Arm Mbed OS. To prevent and solve problems, please see the [troubleshooting](#troubleshooting) section. ### Introduction @@ -16,7 +16,7 @@ Please install the following dependencies to use Mbed OS unit testing. - Python 2.7.x, 3.5 or newer. - Pip 10.0 or newer. - Gcovr 4.1 or newer. -- Mbed CLI 1.8.0 or newer. +- Arm Mbed CLI 1.8.0 or newer. Detailed instructions for supported operating systems are below. @@ -30,7 +30,7 @@ Detailed instructions for supported operating systems are below. sudo easy_install pip ``` -1. Install Gcovr and [Mbed CLI](https://os.mbed.com/docs/latest/tools/arm-mbed-cli.html) with `pip install "gcovr>=4.1" mbed-cli`. +1. Install Gcovr and [Mbed CLI](https://os.mbed.com/docs/latest/tools/developing-arm-mbed-cli.html) with `pip install "gcovr>=4.1" mbed-cli`. #### Installing dependencies on macOS @@ -43,7 +43,7 @@ Detailed instructions for supported operating systems are below. sudo easy_install pip ``` -1. Install Gcovr and [Mbed CLI](https://os.mbed.com/docs/latest/tools/arm-mbed-cli.html) with `pip install "gcovr>=4.1" mbed-cli`. +1. Install Gcovr and [Mbed CLI](https://os.mbed.com/docs/latest/tools/developing-arm-mbed-cli.html) with `pip install "gcovr>=4.1" mbed-cli`. #### Installing dependencies on Windows @@ -51,7 +51,7 @@ Detailed instructions for supported operating systems are below. 1. Download CMake binaries from https://cmake.org/download/, and run the installer. 1. Download Python 2.7 or Python 3 from https://www.python.org/getit/, and run the installer. 1. Add MinGW, CMake and Python into system PATH. -1. Install Gcovr and [Mbed CLI](https://os.mbed.com/docs/latest/tools/arm-mbed-cli.html) with `pip install "gcovr>=4.1" mbed-cli`. +1. Install Gcovr and [Mbed CLI](https://os.mbed.com/docs/latest/tools/developing-arm-mbed-cli.html) with `pip install "gcovr>=4.1" mbed-cli`. ### Test code structure @@ -69,7 +69,7 @@ The build system automatically generates names of test suites. The name is const ### Unit testing with Mbed CLI -Mbed CLI supports unit tests through `mbed test --unittests` command. For information on using Mbed CLI, please see the [CLI documentation in handbook](https://os.mbed.com/docs/latest/tools/arm-mbed-cli.html). +Mbed CLI supports unit tests through `mbed test --unittests` command. For information on using Mbed CLI, please see the [CLI documentation](https://os.mbed.com/docs/latest/tools/developing-arm-mbed-cli.html). ### Writing unit tests @@ -154,7 +154,7 @@ TEST_F(TestSemaphore, constructor) ### Building and running unit tests -Use Mbed CLI to build and run unit tests. For advanced use, you can run CMake and a make program directly. +Use Mbed CLI to build and run unit tests. For advanced use, you can run CMake and a Make program directly. #### Build tests directly with CMake @@ -162,11 +162,11 @@ Use Mbed CLI to build and run unit tests. For advanced use, you can run CMake an 1. Move to the build directory `cd UNITTESTS/build`. 1. Run CMake using a relative path to `UNITTESTS` folder as the argument. So from `UNITTESTS/build` use `cmake ..`: - Add `-g [generator]` if generating other than Unix Makefiles such in case of MinGW use `-g "MinGW Makefiles"`. - - Add `-DCMAKE_MAKE_PROGRAM=`, `-DCMAKE_CXX_COMPILER=` and `-DCMAKE_C_COMPILER=` to use a specific make program and compilers. + - Add `-DCMAKE_MAKE_PROGRAM=`, `-DCMAKE_CXX_COMPILER=` and `-DCMAKE_C_COMPILER=` to use a specific Make program and compilers. - Add `-DCMAKE_BUILD_TYPE=Debug` to build a debug build. - Add `-DCOVERAGE=True` to add coverage compiler flags. - See the [CMake manual](https://cmake.org/cmake/help/v3.0/manual/cmake.1.html) for more information. -1. Run a make program to build the tests. +1. Run a Make program to build the tests. #### Run tests directly with CTest @@ -181,7 +181,7 @@ Run a test binary in the build directory to run a unit test suite. To run multip ### Debugging -1. Use Mbed CLI to build a debug build. For advanced use, run CMake directly with `-DCMAKE_BUILD_TYPE=Debug` and then run a make program. +1. Use Mbed CLI to build a debug build. For advanced use, run CMake directly with `-DCMAKE_BUILD_TYPE=Debug`, and then run a Make program. 1. Run GDB with a test executable as an argument to debug unit tests. ### Get code coverage @@ -189,14 +189,14 @@ Run a test binary in the build directory to run a unit test suite. To run multip Use Mbed CLI to generate code coverage reports. For advanced use, follow these steps: 1. Run CMake with both `-DCMAKE_BUILD_TYPE=Debug` and `-DCOVERAGE=True`. -1. Run a make program to build the tests. +1. Run a Make program to build the tests. 1. Run the tests. 1. Run Gcovr or any other code coverage tool directly in the build directory. ### Troubleshooting **Problem:** Generic problems with CMake or with the build process. -* **Solution**: Delete the build directory. Make sure that CMake, g++, gcc and a make program can be found in the path and are correct versions. +* **Solution**: Delete the build directory. Make sure that CMake, g++, GCC and a Make program can be found in the path and are correct versions. **Problem:** Virus protection identifies files generated by CMake as malicious and quarantines the files on Windows. * **Solution**: Restore the false positive files from the quarantine. From 1918904e918c2c6623811aea861a76d4c38d05f9 Mon Sep 17 00:00:00 2001 From: deepikabhavnani Date: Thu, 11 Oct 2018 10:12:39 -0500 Subject: [PATCH 05/30] QSPI: Remove protected member functions from rendering on docs site, but keep them in the code. --- drivers/QSPI.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/QSPI.h b/drivers/QSPI.h index fc8f6b3b0f..21ed441bfa 100644 --- a/drivers/QSPI.h +++ b/drivers/QSPI.h @@ -89,6 +89,9 @@ public: * */ QSPI(PinName io0, PinName io1, PinName io2, PinName io3, PinName sclk, PinName ssel = NC, int mode = 0); + virtual ~QSPI() + { + } /** Configure the data transmission format * @@ -179,6 +182,7 @@ public: */ qspi_status_t command_transfer(int instruction, int address, const char *tx_buffer, size_t tx_length, const char *rx_buffer, size_t rx_length); +#if !defined(DOXYGEN_ONLY) protected: /** Acquire exclusive access to this SPI bus */ @@ -188,12 +192,6 @@ protected: */ virtual void unlock(void); -public: - virtual ~QSPI() - { - } - -protected: qspi_t _qspi; bool acquire(void); @@ -223,6 +221,7 @@ private: * This function builds the qspi command struct to be send to Hal */ inline void _build_qspi_command(int instruction, int address, int alt); +#endif }; } // namespace mbed From 21136cafcc0b6854b8860f9629709e7ca681b5e2 Mon Sep 17 00:00:00 2001 From: Aashish chaddha Date: Thu, 11 Oct 2018 12:39:46 -0500 Subject: [PATCH 06/30] improve can documentation --- drivers/CAN.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/CAN.h b/drivers/CAN.h index c1aae5c771..d4c24a1c06 100644 --- a/drivers/CAN.h +++ b/drivers/CAN.h @@ -85,7 +85,7 @@ public: class CAN : private NonCopyable { public: - /** Creates an CAN interface connected to specific pins. + /** Creates a CAN interface connected to specific pins. * * @param rd read from transmitter * @param td transmit to transmitter @@ -94,11 +94,15 @@ public: * @code * #include "mbed.h" * + * #if defined (DEVICE_CAN) || defined(DOXYGEN_ONLY) + * * Ticker ticker; * DigitalOut led1(LED1); * DigitalOut led2(LED2); - * CAN can1(p9, p10); - * CAN can2(p30, p29); + * //The constructor takes in RX, and TX pin respectively. + * //These pins, for this example, are defined in mbed_app.json + * CAN can1(MBED_CONF_APP_CAN1_RD, MBED_CONF_APP_CAN1_TD); + * CAN can2(MBED_CONF_APP_CAN2_RD, MBED_CONF_APP_CAN2_TD); * * char counter = 0; * @@ -121,14 +125,19 @@ public: * wait(0.2); * } * } + * + * #else + * #error CAN NOT SUPPORTED + * + * #endif * @endcode */ CAN(PinName rd, PinName td); /** Initialize CAN interface and set the frequency * - * @param rd the rd pin - * @param td the td pin + * @param rd the read pin + * @param td the transmit pin * @param hz the bus frequency in hertz */ CAN(PinName rd, PinName td, int hz); @@ -288,6 +297,7 @@ public: static void _irq_handler(uint32_t id, CanIrqType type); +#if !defined(DOXYGEN_ONLY) protected: virtual void lock(); virtual void unlock(); @@ -295,6 +305,7 @@ protected: Callback _irq[IrqCnt]; PlatformMutex _mutex; }; +#endif } // namespace mbed From 13c194e69496b9d2e2467bf4c3c0e3a45e8cc82a Mon Sep 17 00:00:00 2001 From: deepikabhavnani Date: Thu, 11 Oct 2018 14:40:42 -0500 Subject: [PATCH 07/30] Add QSPI header file in mbed.h --- mbed.h | 1 + 1 file changed, 1 insertion(+) diff --git a/mbed.h b/mbed.h index a1553b7d84..662f07599e 100644 --- a/mbed.h +++ b/mbed.h @@ -73,6 +73,7 @@ #include "drivers/UARTSerial.h" #include "drivers/FlashIAP.h" #include "drivers/MbedCRC.h" +#include "drivers/QSPI.h" // mbed Internal components #include "drivers/Timer.h" From 7b7576feb2cd0894fcfa52173d2d1e9ae1eeb34d Mon Sep 17 00:00:00 2001 From: deepikabhavnani Date: Thu, 11 Oct 2018 14:41:18 -0500 Subject: [PATCH 08/30] Correct the param descritions of QSPI --- drivers/QSPI.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/QSPI.h b/drivers/QSPI.h index 21ed441bfa..764a1167ff 100644 --- a/drivers/QSPI.h +++ b/drivers/QSPI.h @@ -84,8 +84,8 @@ public: * @param io3 4th IO pin used for sending/receiving data during data phase of a transaction * @param sclk QSPI Clock pin * @param ssel QSPI chip select pin - * @param mode Mode specifies the SPI mode(Mode=0 uses CPOL=0, CPHA=0, Mode=1 uses CPOL=1, CPHA=1) - * default value = 0 + * @param mode Clock polarity and phase mode (0 - 3) of SPI + * (Default: Mode=0 uses CPOL=0, CPHA=0, Mode=1 uses CPOL=1, CPHA=1) * */ QSPI(PinName io0, PinName io1, PinName io2, PinName io3, PinName sclk, PinName ssel = NC, int mode = 0); @@ -99,7 +99,7 @@ public: * @param address_width Bus width used by address phase(Valid values are QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_DUAL, QSPI_CFG_BUS_QUAD) * @param address_size Size in bits used by address phase(Valid values are QSPI_CFG_ADDR_SIZE_8, QSPI_CFG_ADDR_SIZE_16, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_ADDR_SIZE_32) * @param alt_width Bus width used by alt phase(Valid values are QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_DUAL, QSPI_CFG_BUS_QUAD) - * @param alt_size Size in bits used by alt phase(Valid values are QSPI_CFG_ADDR_SIZE_8, QSPI_CFG_ADDR_SIZE_16, QSPI_CFG_ADDR_SIZE_24, QSPI_CFG_ADDR_SIZE_32) + * @param alt_size Size in bits used by alt phase(Valid values are QSPI_CFG_ALT_SIZE_8, QSPI_CFG_ALT_SIZE_16, QSPI_CFG_ALT_SIZE_24, QSPI_CFG_ALT_SIZE_32) * @param data_width Bus width used by data phase(Valid values are QSPI_CFG_BUS_SINGLE, QSPI_CFG_BUS_DUAL, QSPI_CFG_BUS_QUAD) * @param dummy_cycles Number of dummy clock cycles to be used after alt phase * From a28d1c0cfcfd803bb045132d98667401de572b01 Mon Sep 17 00:00:00 2001 From: Kevin Gilbert Date: Thu, 11 Oct 2018 15:17:27 -0500 Subject: [PATCH 09/30] Fix minor typo --- drivers/Timeout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/Timeout.h b/drivers/Timeout.h index e3a92cc3be..4bb5c66814 100644 --- a/drivers/Timeout.h +++ b/drivers/Timeout.h @@ -25,7 +25,7 @@ namespace mbed { /** A Timeout is used to call a function at a point in the future * - * You can use as many seperate Timeout objects as you require. + * You can use as many separate Timeout objects as you require. * * @note Synchronization level: Interrupt safe * From 0235838be8fbf69a4c38440ea1731cc36ee0619d Mon Sep 17 00:00:00 2001 From: Naveen Kaje Date: Thu, 11 Oct 2018 16:18:09 -0500 Subject: [PATCH 10/30] InterruptIn: Remove protected attributes from rendering on docs site --- drivers/InterruptIn.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/InterruptIn.h b/drivers/InterruptIn.h index ebc8c84fac..0558cc5540 100644 --- a/drivers/InterruptIn.h +++ b/drivers/InterruptIn.h @@ -157,7 +157,7 @@ public: void disable_irq(); static void _irq_handler(uint32_t id, gpio_irq_event event); - +#if !defined(DOXYGEN_ONLY) protected: gpio_t gpio; gpio_irq_t gpio_irq; @@ -166,6 +166,7 @@ protected: Callback _fall; void irq_init(PinName pin); +#endif }; } // namespace mbed From 8786bfbb9a6e1a10df9231f4af66c922617e5efa Mon Sep 17 00:00:00 2001 From: Aashish chaddha Date: Thu, 11 Oct 2018 16:33:56 -0500 Subject: [PATCH 11/30] improve mutex doc --- rtos/Mutex.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rtos/Mutex.h b/rtos/Mutex.h index ea6c8288be..1ecd9c319b 100644 --- a/rtos/Mutex.h +++ b/rtos/Mutex.h @@ -54,7 +54,7 @@ typedef mbed::ScopedLock ScopedMutexLock; */ /** The Mutex class is used to synchronize the execution of threads. - This is for example used to protect access to a shared resource. + This is, for example, used to protect access to a shared resource. @note You cannot use member functions of this class in ISR context. If you require Mutex functionality within ISR handler, consider using @a Semaphore. @@ -82,7 +82,7 @@ public: Wait until a Mutex becomes available. @return status code that indicates the execution status of the function: - @a osOK the mutex has been obtained. + @a Status code like osOK indicates that the mutex has been obtained. @note You cannot call this function from ISR context. @note This function treats RTOS errors as fatal system errors, so can only return osOK. @@ -91,10 +91,10 @@ public: osStatus lock(void); /** - For backwards compatibility. + Wait until a Mutex becomes available. + @deprecated Do not use this function. This function has been replaced with lock(), trylock() and trylock_for() functions. - Wait until a Mutex becomes available. @param millisec timeout value or 0 in case of no time-out. @return status code that indicates the execution status of the function: @a osOK the mutex has been obtained. @@ -144,7 +144,7 @@ public: Unlock the mutex that has previously been locked by the same thread @return status code that indicates the execution status of the function: - @a osOK the mutex has been released. + @a Status code like osOK indicates that the mutex has been released. @note You cannot call this function from ISR context. @note This function treats RTOS errors as fatal system errors, so can only return osOK. From 3ab4f76d4c1720b757b273ac5a861cd7ede36c4c Mon Sep 17 00:00:00 2001 From: Naveen Kaje Date: Thu, 11 Oct 2018 16:36:05 -0500 Subject: [PATCH 12/30] InterruptIn.h: Update comments --- drivers/InterruptIn.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/InterruptIn.h b/drivers/InterruptIn.h index 0558cc5540..e15a20e02b 100644 --- a/drivers/InterruptIn.h +++ b/drivers/InterruptIn.h @@ -48,6 +48,7 @@ namespace mbed { * } * * int main() { + * // register trigger() to be called upon the rising edge of event * event.rise(&trigger); * while(1) { * led = !led; @@ -71,7 +72,10 @@ public: * and the pin configured to the specified mode. * * @param pin InterruptIn pin to connect to - * @param mode The mode to set the pin to (PullUp/PullDown/etc.) + * @param mode Desired Pin mode configuration. + * (Valid values could be PullNone/PullDown/PullUp/PullDefault + * See PinNames.h for your target for definitions) + * */ InterruptIn(PinName pin, PinMode mode); @@ -142,7 +146,8 @@ public: /** Set the input pin mode * - * @param pull PullUp, PullDown, PullNone + * @param pull PullUp, PullDown, PullNone, PullDefault + * See PinNames.h for your target for definitions) */ void mode(PinMode pull); From 24054ec72371fa4ac6a913c8c282fe4f2cfcb8ea Mon Sep 17 00:00:00 2001 From: Aashish chaddha Date: Thu, 11 Oct 2018 16:48:39 -0500 Subject: [PATCH 13/30] improve mutex doc --- rtos/Mutex.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtos/Mutex.h b/rtos/Mutex.h index 1ecd9c319b..3ccc1d8885 100644 --- a/rtos/Mutex.h +++ b/rtos/Mutex.h @@ -82,7 +82,7 @@ public: Wait until a Mutex becomes available. @return status code that indicates the execution status of the function: - @a Status code like osOK indicates that the mutex has been obtained. + @a Status code such as osOK indicates that the mutex has been obtained. @note You cannot call this function from ISR context. @note This function treats RTOS errors as fatal system errors, so can only return osOK. @@ -144,7 +144,7 @@ public: Unlock the mutex that has previously been locked by the same thread @return status code that indicates the execution status of the function: - @a Status code like osOK indicates that the mutex has been released. + @a Status code such as osOK indicates that the mutex has been released. @note You cannot call this function from ISR context. @note This function treats RTOS errors as fatal system errors, so can only return osOK. From 026c978515eaad88f423656671212bd8fa95f2f0 Mon Sep 17 00:00:00 2001 From: Senthil Ramakrishnan Date: Thu, 11 Oct 2018 16:58:47 -0500 Subject: [PATCH 14/30] Adding doxygen comments for mem trace enum --- platform/mbed_mem_trace.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/platform/mbed_mem_trace.h b/platform/mbed_mem_trace.h index 1fe2e99a90..fc1122adfd 100644 --- a/platform/mbed_mem_trace.h +++ b/platform/mbed_mem_trace.h @@ -28,12 +28,14 @@ extern "C" { #include #include -/* Operation types for tracer */ +/** + * enum Memory operation types for tracer + */ enum { - MBED_MEM_TRACE_MALLOC, - MBED_MEM_TRACE_REALLOC, - MBED_MEM_TRACE_CALLOC, - MBED_MEM_TRACE_FREE + MBED_MEM_TRACE_MALLOC, /**< Identifier for malloc operation */ + MBED_MEM_TRACE_REALLOC, /**< Identifier for realloc operation */ + MBED_MEM_TRACE_CALLOC, /**< Identifier for calloc operation */ + MBED_MEM_TRACE_FREE /**< Identifier for free operation */ }; /** From a92066858bec4cac220493824fd0e9c9e88640b6 Mon Sep 17 00:00:00 2001 From: Aashish chaddha Date: Thu, 11 Oct 2018 17:05:35 -0500 Subject: [PATCH 15/30] improve ticker doc --- drivers/Ticker.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/Ticker.h b/drivers/Ticker.h index e8bca7cbe9..058e2f8ed0 100644 --- a/drivers/Ticker.h +++ b/drivers/Ticker.h @@ -155,6 +155,7 @@ public: */ void detach(); +#if !defined(DOXYGEN_ONLY) protected: void setup(us_timestamp_t t); virtual void handler(); @@ -163,6 +164,7 @@ protected: us_timestamp_t _delay; /**< Time delay (in microseconds) for re-setting the multi-shot callback. */ Callback _function; /**< Callback. */ bool _lock_deepsleep; /**< Flag which indicates if deep-sleep should be disabled. */ +#endif }; } // namespace mbed From ddedc155d498c9201e0b7995dd3ccdb29c4ddcc1 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Thu, 11 Oct 2018 17:39:49 -0500 Subject: [PATCH 16/30] Updating stats doc comments --- platform/mbed_stats.h | 68 ++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 33 deletions(-) diff --git a/platform/mbed_stats.h b/platform/mbed_stats.h index 415be895c2..d502bc4d37 100644 --- a/platform/mbed_stats.h +++ b/platform/mbed_stats.h @@ -42,17 +42,17 @@ extern "C" { * struct mbed_stats_heap_t definition */ typedef struct { - uint32_t current_size; /**< Bytes allocated currently. */ - uint32_t max_size; /**< Max bytes allocated at a given time. */ - uint32_t total_size; /**< Cumulative sum of bytes ever allocated. */ - uint32_t reserved_size; /**< Current number of bytes allocated for the heap. */ - uint32_t alloc_cnt; /**< Current number of allocations. */ - uint32_t alloc_fail_cnt; /**< Number of failed allocations. */ - uint32_t overhead_size; /**< Overhead added to heap for stats. */ + uint32_t current_size; /**< Bytes currently allocated on the heap */ + uint32_t max_size; /**< Maximum bytes allocated on the heap at one time since reset */ + uint32_t total_size; /**< Cumulative sum of bytes allocated on the heap that have not been freed */ + uint32_t reserved_size; /**< Current number of bytes reserved for the heap */ + uint32_t alloc_cnt; /**< Current number of allocations that have not been freed since reset */ + uint32_t alloc_fail_cnt; /**< Number of failed allocations since reset */ + uint32_t overhead_size; /**< Number of bytes used to store heap statistics. This overhead takes up space on the heap, reducing the available heap space */ } mbed_stats_heap_t; /** - * Fill the passed in heap stat structure with heap stats. + * Fill the passed in heap stat structure with the heap statistics. * * @param stats A pointer to the mbed_stats_heap_t structure to fill */ @@ -62,14 +62,14 @@ void mbed_stats_heap_get(mbed_stats_heap_t *stats); * struct mbed_stats_stack_t definition */ typedef struct { - uint32_t thread_id; /**< Identifier for thread that owns the stack or 0 if multiple threads. */ - uint32_t max_size; /**< Maximum number of bytes used on the stack. */ - uint32_t reserved_size; /**< Current number of bytes allocated for the stack. */ - uint32_t stack_cnt; /**< Number of stacks stats accumulated in the structure. */ + uint32_t thread_id; /**< Identifier for the thread that owns the stack or 0 if representing accumulated statistics */ + uint32_t max_size; /**< Maximum number of bytes used on the stack since the thread was started */ + uint32_t reserved_size; /**< Current number of bytes reserved for the stack */ + uint32_t stack_cnt; /**< The number of stacks represented in the accumulated statistics or 1 if repesenting a single stack */ } mbed_stats_stack_t; /** - * Fill the passed in structure with stack stats accumulated for all threads. The thread_id will be 0 + * Fill the passed in structure with stack statistics accumulated for all threads. The thread_id will be 0 * and stack_cnt will represent number of threads. * * @param stats A pointer to the mbed_stats_stack_t structure to fill @@ -77,12 +77,13 @@ typedef struct { void mbed_stats_stack_get(mbed_stats_stack_t *stats); /** - * Fill the passed array of stat structures with the stack stats for each available thread. + * Fill the passed array of structures with the stack statistics for each available thread. * * @param stats A pointer to an array of mbed_stats_stack_t structures to fill * @param count The number of mbed_stats_stack_t structures in the provided array - * @return The number of mbed_stats_stack_t structures that have been filled, - * this is equal to the number of stacks on the system. + * @return The number of mbed_stats_stack_t structures that have been filled. + * If the number of stacks on the system is less than or equal to count, it will equal the number of stacks on the system. + * If the number of stacks on the system is greater than count, it will equal count. */ size_t mbed_stats_stack_get_each(mbed_stats_stack_t *stats, size_t count); @@ -90,10 +91,10 @@ size_t mbed_stats_stack_get_each(mbed_stats_stack_t *stats, size_t count); * struct mbed_stats_cpu_t definition */ typedef struct { - us_timestamp_t uptime; /**< Time since system is up and running */ - us_timestamp_t idle_time; /**< Time spent in idle thread since system is up and running */ - us_timestamp_t sleep_time; /**< Time spent in sleep since system is up and running */ - us_timestamp_t deep_sleep_time; /**< Time spent in deep sleep since system is up and running */ + us_timestamp_t uptime; /**< Time since the system has started */ + us_timestamp_t idle_time; /**< Time spent in the idle thread since the system has started */ + us_timestamp_t sleep_time; /**< Time spent in sleep since the system has started */ + us_timestamp_t deep_sleep_time; /**< Time spent in deep sleep since the system has started */ } mbed_stats_cpu_t; /** @@ -107,21 +108,22 @@ void mbed_stats_cpu_get(mbed_stats_cpu_t *stats); * struct mbed_stats_thread_t definition */ typedef struct { - uint32_t id; /**< Thread Object Identifier */ - uint32_t state; /**< Thread Object State */ - uint32_t priority; /**< Thread Priority */ - uint32_t stack_size; /**< Thread Stack Size */ - uint32_t stack_space; /**< Thread remaining stack size */ - const char *name; /**< Thread Object name */ + uint32_t id; /**< Id of the thread */ + uint32_t state; /**< State of the thread */ + uint32_t priority; /**< Priority of the thread (higher number indicates higher priority) */ + uint32_t stack_size; /**< Current number of bytes reserved for the stack */ + uint32_t stack_space; /**< Current number of free bytes remaining on the stack */ + const char *name; /**< Name of the thread */ } mbed_stats_thread_t; /** - * Fill the passed array of stat structures with the thread stats for each available thread. + * Fill the passed array of stat structures with the thread statistics for each available thread. * * @param stats A pointer to an array of mbed_stats_thread_t structures to fill * @param count The number of mbed_stats_thread_t structures in the provided array - * @return The number of mbed_stats_thread_t structures that have been filled, - * this is equal to the number of threads on the system. + * @return The number of mbed_stats_thread_t structures that have been filled. + * If the number of threads on the system is less than or equal to count, it will equal the number of threads on the system. + * If the number of threads on the system is greater than count, it will equal count. */ size_t mbed_stats_thread_get_each(mbed_stats_thread_t *stats, size_t count); @@ -138,14 +140,14 @@ typedef enum { * struct mbed_stats_sys_t definition */ typedef struct { - uint32_t os_version; /**< Mbed OS Version (Release only) */ - uint32_t cpu_id; /**< CPUID Register data (Cortex-M only supported) */ - mbed_compiler_id_t compiler_id; /**< Compiler ID \ref mbed_compiler_id_t */ + uint32_t os_version; /**< Mbed OS version (populated only for tagged releases) */ + uint32_t cpu_id; /**< CPUID register data (Cortex-M only supported) */ + mbed_compiler_id_t compiler_id; /**< Compiler id \ref mbed_compiler_id_t */ uint32_t compiler_version; /**< Compiler version */ } mbed_stats_sys_t; /** - * Fill the passed in sys stat structure with system stats. + * Fill the passed in system stat structure with system statistics. * * @param stats A pointer to the mbed_stats_sys_t structure to fill */ From feb3833e4b66b7b1f2f5651be67e204e8bc7016e Mon Sep 17 00:00:00 2001 From: Naveen Kaje Date: Fri, 12 Oct 2018 09:51:53 -0500 Subject: [PATCH 17/30] Timer.h: Remove protected attributes from rendering on docs site --- drivers/Timer.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/Timer.h b/drivers/Timer.h index 9fafad945a..0ca0dc6965 100644 --- a/drivers/Timer.h +++ b/drivers/Timer.h @@ -95,6 +95,7 @@ public: */ us_timestamp_t read_high_resolution_us(); +#if !defined(DOXYGEN_ONLY) protected: us_timestamp_t slicetime(); int _running; // whether the timer is running @@ -103,6 +104,7 @@ protected: const ticker_data_t *_ticker_data; bool _lock_deepsleep; // flag which indicates if deep-sleep should be disabled }; +#endif } // namespace mbed From f0a44510546ecd394bcebe56a070ca0ed376dcba Mon Sep 17 00:00:00 2001 From: Aashish chaddha Date: Fri, 12 Oct 2018 10:01:38 -0500 Subject: [PATCH 18/30] fix critical bug where I was hiding a lot more class members than i should. Add "CAN_NOT_SUPPORTED" guard to header instead of example --- drivers/CAN.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/CAN.h b/drivers/CAN.h index d4c24a1c06..ff108576e4 100644 --- a/drivers/CAN.h +++ b/drivers/CAN.h @@ -94,7 +94,6 @@ public: * @code * #include "mbed.h" * - * #if defined (DEVICE_CAN) || defined(DOXYGEN_ONLY) * * Ticker ticker; * DigitalOut led1(LED1); @@ -126,10 +125,6 @@ public: * } * } * - * #else - * #error CAN NOT SUPPORTED - * - * #endif * @endcode */ CAN(PinName rd, PinName td); @@ -304,11 +299,13 @@ protected: can_t _can; Callback _irq[IrqCnt]; PlatformMutex _mutex; -}; #endif +}; } // namespace mbed +#else + #error CAN NOT SUPPORTED #endif #endif // MBED_CAN_H From 615ae0b2ec1bc74b4338c827113ee5bf70f62536 Mon Sep 17 00:00:00 2001 From: Naveen Kaje Date: Fri, 12 Oct 2018 10:09:36 -0500 Subject: [PATCH 19/30] Timer.h: Update comments --- drivers/Timer.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/Timer.h b/drivers/Timer.h index 0ca0dc6965..37305a2af9 100644 --- a/drivers/Timer.h +++ b/drivers/Timer.h @@ -65,7 +65,7 @@ public: /** Reset the timer to 0. * - * If it was already counting, it will continue + * If it was already running, it will continue */ void reset(); @@ -92,6 +92,7 @@ public: operator float(); /** Get in a high resolution type the time passed in micro-seconds. + * Returns a 64 bit integer. */ us_timestamp_t read_high_resolution_us(); From a9ce00bb4dee1f2380e404e05adb2b714e42dfb8 Mon Sep 17 00:00:00 2001 From: Aashish chaddha Date: Fri, 12 Oct 2018 10:16:32 -0500 Subject: [PATCH 20/30] fixed a mistake where I was adding "can not supprted" error at wrong place --- drivers/CAN.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/CAN.h b/drivers/CAN.h index ff108576e4..cc96f76733 100644 --- a/drivers/CAN.h +++ b/drivers/CAN.h @@ -304,8 +304,6 @@ protected: } // namespace mbed -#else - #error CAN NOT SUPPORTED #endif #endif // MBED_CAN_H From 6031bc2fb15a647d8869d34b1d42daac5592a24c Mon Sep 17 00:00:00 2001 From: deepikabhavnani Date: Fri, 12 Oct 2018 10:41:52 -0500 Subject: [PATCH 21/30] Updated doxygen comments --- features/device_key/source/DeviceKey.h | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/features/device_key/source/DeviceKey.h b/features/device_key/source/DeviceKey.h index 08dbb4fcde..3833a348c5 100644 --- a/features/device_key/source/DeviceKey.h +++ b/features/device_key/source/DeviceKey.h @@ -72,20 +72,20 @@ public: ~DeviceKey(); - /** Derive a new key based on the salt string. key type can be with values 16 bytes and 32 bytes - * @param isalt input buffer used to create the new key. Same input will generate always the same key - * @param isalt_size size of the data in salt buffer - * @param output buffer to receive the derived key. Size must be 16 bytes or 32 bytes + /** Derive a new key based on the salt string. + * @param isalt Input buffer used to create the new key. Same input will always generate the same key + * @param isalt_size Size of the data in salt buffer. + * @param output Buffer to receive the derived key. Size must be 16 bytes or 32 bytes * according to the ikey_type parameter - * @param ikey_type type of the required key. Type must be 16 bytes or 32 bytes. + * @param ikey_type Type of the required key. Must be 16 bytes or 32 bytes. * @return 0 on success, negative error code on failure */ int generate_derived_key(const unsigned char *isalt, size_t isalt_size, unsigned char *output, uint16_t ikey_type); /** Set a device key into the NVStore. In case TRNG support is missing, Call this method * before calling device_key_derived_key. This method should be called only once! - * @param value input buffer contain the key. - * @param isize size of the supplied key. Must be 16 bytes or 32 bytes. + * @param value Input buffer contain the key. + * @param isize Size of the supplied key. Must be 16 bytes or 32 bytes. * @return 0 on success, negative error code on failure */ int device_inject_root_of_trust(uint32_t *value, size_t isize); @@ -95,40 +95,40 @@ private: DeviceKey(); /** Read a device key from the NVStore - * @param output buffer for the returned key. - * @param size input: the size of the output buffer. - * output: the actual size of the written data + * @param output Buffer for the returned key. + * @param size Input: The size of the output buffer. + * Output: The actual size of the written data * @return 0 on success, negative error code on failure */ int read_key_from_nvstore(uint32_t *output, size_t& size); /** Set a device key into the NVStore - * @param input input buffer contain the key. - * @param isize the size of the input buffer. + * @param input Input buffer contain the key. + * @param isize The size of the input buffer. * @return 0 on success, negative error code on failure */ int write_key_to_nvstore(uint32_t *input, size_t isize); - /** Get a derived key base on a salt string. The methods implements - * Section 5.1 in NIST SP 800-108, Recommendation for Key Derivation Using Pseudorandom Functions - * @param ikey_buff input buffer holding the ROT key - * @param ikey_size size of the input key. Must be 16 bytes or 32 bytes. - * @param isalt input buffer contain some string. - * @param isalt_size size of the supplied input string. - * @param output buffer for the derived key result. - * @param ikey_type the requested key size. Must be 16 bytes or 32 bytes. + /** Get a derived key base on a salt string. The methods implements Section 5.1 + * in NIST SP 800-108, Recommendation for Key Derivation Using Pseudorandom Functions + * @param ikey_buff Input buffer holding the ROT key + * @param ikey_size Size of the input key. Must be 16 bytes or 32 bytes. + * @param isalt Input buffer contain some string. + * @param isalt_size Size of the supplied input string. + * @param output Buffer for the derived key result. + * @param ikey_type The requested key size. Must be 16 bytes or 32 bytes. * @return 0 on success, negative error code on failure */ int get_derived_key(uint32_t *ikey_buff, size_t ikey_size, const unsigned char *isalt, size_t isalt_size, unsigned char *output, uint32_t ikey_type); /** Generate a random ROT key by using TRNG - * @param output output buffer for the generated key. - * @param size input: the size of the buffer. if size is less + * @param output Output buffer for the generated key. + * @param size Input: The size of the buffer. if size is less * then 16 bytes the method will generate an * error. 16-31 bytes will create a 16 byte key. * 32 or higher will generate a 32 bytes key - * output: the actual written size to the buffer + * Output: The actual written size to the buffer * @return 0 on success, negative error code on failure */ int generate_key_by_trng(uint32_t *output, size_t size); From b993eb9d3d6b2de59cb60a6270a13c798ea13a3f Mon Sep 17 00:00:00 2001 From: Aashish chaddha Date: Fri, 12 Oct 2018 10:51:38 -0500 Subject: [PATCH 22/30] mutex doc changes --- rtos/Mutex.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rtos/Mutex.h b/rtos/Mutex.h index 3ccc1d8885..b68418d659 100644 --- a/rtos/Mutex.h +++ b/rtos/Mutex.h @@ -82,7 +82,7 @@ public: Wait until a Mutex becomes available. @return status code that indicates the execution status of the function: - @a Status code such as osOK indicates that the mutex has been obtained. + @a osOK the mutex has been obtained. @note You cannot call this function from ISR context. @note This function treats RTOS errors as fatal system errors, so can only return osOK. @@ -144,7 +144,7 @@ public: Unlock the mutex that has previously been locked by the same thread @return status code that indicates the execution status of the function: - @a Status code such as osOK indicates that the mutex has been released. + @a osOK the mutex has been released. @note You cannot call this function from ISR context. @note This function treats RTOS errors as fatal system errors, so can only return osOK. From 2da54cbb4af405c1427d5b6f1238bce238eae36a Mon Sep 17 00:00:00 2001 From: Amanda Butler Date: Fri, 12 Oct 2018 10:58:58 -0500 Subject: [PATCH 23/30] Edit DeviceKey.h Standardize tense across documents, and edit some existing text for phrasing. --- features/device_key/source/DeviceKey.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/features/device_key/source/DeviceKey.h b/features/device_key/source/DeviceKey.h index 3833a348c5..e89f3b5948 100644 --- a/features/device_key/source/DeviceKey.h +++ b/features/device_key/source/DeviceKey.h @@ -56,7 +56,7 @@ public: /** * @brief As a singleton, return the single instance of the class. * Reason for this class being a singleton is the following: - * - Ease the use for users of this class not having to coordinate instantiations. + * - Ease of use for users of this class not having to coordinate instantiations. * - Lazy instantiation of internal data (which we can't achieve with simple static classes). * * @returns Singleton instance reference. @@ -65,7 +65,7 @@ public: { // Use this implementation of singleton (Meyer's) rather than the one that allocates // the instance on the heap, as it ensures destruction at program end (preventing warnings - // from memory checking tools such as valgrind). + // from memory checking tools, such as valgrind). static DeviceKey instance; return instance; } @@ -73,7 +73,7 @@ public: ~DeviceKey(); /** Derive a new key based on the salt string. - * @param isalt Input buffer used to create the new key. Same input will always generate the same key + * @param isalt Input buffer used to create the new key. Same input always generates the same key * @param isalt_size Size of the data in salt buffer. * @param output Buffer to receive the derived key. Size must be 16 bytes or 32 bytes * according to the ikey_type parameter @@ -82,7 +82,7 @@ public: */ int generate_derived_key(const unsigned char *isalt, size_t isalt_size, unsigned char *output, uint16_t ikey_type); - /** Set a device key into the NVStore. In case TRNG support is missing, Call this method + /** Set a device key into the NVStore. If TRNG support is missing, call this method * before calling device_key_derived_key. This method should be called only once! * @param value Input buffer contain the key. * @param isize Size of the supplied key. Must be 16 bytes or 32 bytes. @@ -124,10 +124,10 @@ private: /** Generate a random ROT key by using TRNG * @param output Output buffer for the generated key. - * @param size Input: The size of the buffer. if size is less - * then 16 bytes the method will generate an - * error. 16-31 bytes will create a 16 byte key. - * 32 or higher will generate a 32 bytes key + * @param size Input: The size of the buffer. If size is less + * than 16 bytes, the method generates an + * error. 16-31 bytes creates a 16-byte key. + * 32 or higher generates a 32-byte key * Output: The actual written size to the buffer * @return 0 on success, negative error code on failure */ From 648eb39f7451f073136afc36a98205187677568a Mon Sep 17 00:00:00 2001 From: Amanda Butler Date: Fri, 12 Oct 2018 11:01:11 -0500 Subject: [PATCH 24/30] Copy edit Timer.h Copy edit existing text for minor grammar issues. --- drivers/Timer.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/Timer.h b/drivers/Timer.h index 37305a2af9..9cc3586d98 100644 --- a/drivers/Timer.h +++ b/drivers/Timer.h @@ -30,7 +30,7 @@ namespace mbed { * * Example: * @code - * // Count the time to toggle a LED + * // Count the time to toggle an LED * * #include "mbed.h" * @@ -75,15 +75,15 @@ public: */ float read(); - /** Get the time passed in milli-seconds + /** Get the time passed in milliseconds * - * @returns Time passed in milli seconds + * @returns Time passed in milliseconds */ int read_ms(); - /** Get the time passed in micro-seconds + /** Get the time passed in microseconds * - * @returns Time passed in micro seconds + * @returns Time passed in microseconds */ int read_us(); @@ -91,7 +91,7 @@ public: */ operator float(); - /** Get in a high resolution type the time passed in micro-seconds. + /** Get in a high resolution type the time passed in microseconds. * Returns a 64 bit integer. */ us_timestamp_t read_high_resolution_us(); @@ -103,7 +103,7 @@ protected: us_timestamp_t _start; // the start time of the latest slice us_timestamp_t _time; // any accumulated time from previous slices const ticker_data_t *_ticker_data; - bool _lock_deepsleep; // flag which indicates if deep-sleep should be disabled + bool _lock_deepsleep; // flag that indicates if deep sleep should be disabled }; #endif From 82c4ce607dfd759a821d4c4b86a923ac4bc0f45b Mon Sep 17 00:00:00 2001 From: Amanda Butler Date: Fri, 12 Oct 2018 11:08:01 -0500 Subject: [PATCH 25/30] Edit mbed_stats.h Capitalize ID for consistency. --- platform/mbed_stats.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/mbed_stats.h b/platform/mbed_stats.h index d502bc4d37..aa7b581976 100644 --- a/platform/mbed_stats.h +++ b/platform/mbed_stats.h @@ -108,7 +108,7 @@ void mbed_stats_cpu_get(mbed_stats_cpu_t *stats); * struct mbed_stats_thread_t definition */ typedef struct { - uint32_t id; /**< Id of the thread */ + uint32_t id; /**< ID of the thread */ uint32_t state; /**< State of the thread */ uint32_t priority; /**< Priority of the thread (higher number indicates higher priority) */ uint32_t stack_size; /**< Current number of bytes reserved for the stack */ @@ -142,7 +142,7 @@ typedef enum { typedef struct { uint32_t os_version; /**< Mbed OS version (populated only for tagged releases) */ uint32_t cpu_id; /**< CPUID register data (Cortex-M only supported) */ - mbed_compiler_id_t compiler_id; /**< Compiler id \ref mbed_compiler_id_t */ + mbed_compiler_id_t compiler_id; /**< Compiler ID \ref mbed_compiler_id_t */ uint32_t compiler_version; /**< Compiler version */ } mbed_stats_sys_t; From bbc6e5dee4da89c3cb009181451351b8cddceb1d Mon Sep 17 00:00:00 2001 From: Amanda Butler Date: Fri, 12 Oct 2018 11:11:20 -0500 Subject: [PATCH 26/30] Edit Mutex.h Make minor copy edits to existing text. --- rtos/Mutex.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rtos/Mutex.h b/rtos/Mutex.h index b68418d659..9e80f5e281 100644 --- a/rtos/Mutex.h +++ b/rtos/Mutex.h @@ -60,7 +60,7 @@ typedef mbed::ScopedLock ScopedMutexLock; ISR handler, consider using @a Semaphore. @note - Memory considerations: The mutex control structures will be created on current thread's stack, both for the Mbed OS + Memory considerations: The mutex control structures are created on the current thread's stack, both for the Mbed OS and underlying RTOS objects (static or dynamic RTOS memory pools are not being used). */ class Mutex : private mbed::NonCopyable { @@ -85,7 +85,7 @@ public: @a osOK the mutex has been obtained. @note You cannot call this function from ISR context. - @note This function treats RTOS errors as fatal system errors, so can only return osOK. + @note This function treats RTOS errors as fatal system errors, so it can only return osOK. Use of the return value is deprecated, as the return is expected to become void in the future. */ osStatus lock(void); @@ -102,7 +102,7 @@ public: @a osErrorResource the mutex could not be obtained when no timeout was specified. @note You cannot call this function from ISR context. - @note This function treats RTOS errors as fatal system errors, so can only return osOK or + @note This function treats RTOS errors as fatal system errors, so it can only return osOK or osErrorResource in case when millisec is 0 or osErrorTimeout if millisec is not osWaitForever. */ MBED_DEPRECATED_SINCE("mbed-os-5.10.0", "Replaced with lock(), trylock() and trylock_for() functions") @@ -147,7 +147,7 @@ public: @a osOK the mutex has been released. @note You cannot call this function from ISR context. - @note This function treats RTOS errors as fatal system errors, so can only return osOK. + @note This function treats RTOS errors as fatal system errors, so it can only return osOK. Use of the return value is deprecated, as the return is expected to become void in the future. */ osStatus unlock(); From 9eab32e3650e976d45a2270a68e589d1d2478c7d Mon Sep 17 00:00:00 2001 From: Amanda Butler Date: Fri, 12 Oct 2018 11:13:31 -0500 Subject: [PATCH 27/30] Copy edit changes to mbed_mem_trace.h Delete extra spaces. --- platform/mbed_mem_trace.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/mbed_mem_trace.h b/platform/mbed_mem_trace.h index fc1122adfd..7e9d1f1401 100644 --- a/platform/mbed_mem_trace.h +++ b/platform/mbed_mem_trace.h @@ -33,9 +33,9 @@ extern "C" { */ enum { MBED_MEM_TRACE_MALLOC, /**< Identifier for malloc operation */ - MBED_MEM_TRACE_REALLOC, /**< Identifier for realloc operation */ - MBED_MEM_TRACE_CALLOC, /**< Identifier for calloc operation */ - MBED_MEM_TRACE_FREE /**< Identifier for free operation */ + MBED_MEM_TRACE_REALLOC, /**< Identifier for realloc operation */ + MBED_MEM_TRACE_CALLOC, /**< Identifier for calloc operation */ + MBED_MEM_TRACE_FREE /**< Identifier for free operation */ }; /** From be4985e87e056d34bb712a2c2a3a057bc989b95f Mon Sep 17 00:00:00 2001 From: Amanda Butler Date: Fri, 12 Oct 2018 11:16:32 -0500 Subject: [PATCH 28/30] Edit Ticker.h Make minor copy edits to existing text. --- drivers/Ticker.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/Ticker.h b/drivers/Ticker.h index 058e2f8ed0..059d6a1792 100644 --- a/drivers/Ticker.h +++ b/drivers/Ticker.h @@ -35,7 +35,7 @@ namespace mbed { * * Example: * @code - * // Toggle the blinking led after 5 seconds + * // Toggle the blinking LED after 5 seconds * * #include "mbed.h" * @@ -70,7 +70,7 @@ public: { } - // When low power ticker is in use, then do not disable deep-sleep. + // When low power ticker is in use, then do not disable deep sleep. Ticker(const ticker_data_t *data) : TimerEvent(data), _function(0), _lock_deepsleep(true) { #if DEVICE_LPTICKER @@ -106,13 +106,13 @@ public: attach(callback(obj, method), t); } - /** Attach a function to be called by the Ticker, specifying the interval in micro-seconds + /** Attach a function to be called by the Ticker, specifying the interval in microseconds * * @param func pointer to the function to be called * @param t the time between calls in micro-seconds * - * @note setting @a t to a value shorter that it takes to process the ticker callback - * will cause the system to hang. Ticker callback will be called constantly with no time + * @note setting @a t to a value shorter than it takes to process the ticker callback + * causes the system to hang. Ticker callback is called constantly with no time * for threads scheduling. * */ @@ -128,11 +128,11 @@ public: core_util_critical_section_exit(); } - /** Attach a member function to be called by the Ticker, specifying the interval in micro-seconds + /** Attach a member function to be called by the Ticker, specifying the interval in microseconds * * @param obj pointer to the object to call the member function on * @param method pointer to the member function to be called - * @param t the time between calls in micro-seconds + * @param t the time between calls in microseconds * @deprecated * The attach_us function does not support cv-qualifiers. Replaced by * attach_us(callback(obj, method), t). @@ -161,9 +161,9 @@ protected: virtual void handler(); protected: - us_timestamp_t _delay; /**< Time delay (in microseconds) for re-setting the multi-shot callback. */ + us_timestamp_t _delay; /**< Time delay (in microseconds) for resetting the multishot callback. */ Callback _function; /**< Callback. */ - bool _lock_deepsleep; /**< Flag which indicates if deep-sleep should be disabled. */ + bool _lock_deepsleep; /**< Flag which indicates if deep sleep should be disabled. */ #endif }; From 985cd7024390660f6a1cd58f3acb90410d875d25 Mon Sep 17 00:00:00 2001 From: Amanda Butler Date: Fri, 12 Oct 2018 11:19:34 -0500 Subject: [PATCH 29/30] Edit InterruptIn.h Make minor grammar edits. --- drivers/InterruptIn.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/InterruptIn.h b/drivers/InterruptIn.h index e15a20e02b..af59801471 100644 --- a/drivers/InterruptIn.h +++ b/drivers/InterruptIn.h @@ -73,7 +73,7 @@ public: * * @param pin InterruptIn pin to connect to * @param mode Desired Pin mode configuration. - * (Valid values could be PullNone/PullDown/PullUp/PullDefault + * (Valid values could be PullNone, PullDown, PullUp and PullDefault. * See PinNames.h for your target for definitions) * */ @@ -151,7 +151,7 @@ public: */ void mode(PinMode pull); - /** Enable IRQ. This method depends on hw implementation, might enable one + /** Enable IRQ. This method depends on hardware implementation, might enable one * port interrupts. For further information, check gpio_irq_enable(). */ void enable_irq(); From e547e3d88d53bddd361910baa9fc2fb94463e091 Mon Sep 17 00:00:00 2001 From: Senthil Ramakrishnan Date: Thu, 11 Oct 2018 17:29:56 -0500 Subject: [PATCH 30/30] Fix doxygen comments and spelling errors --- platform/mbed_error.h | 88 ++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/platform/mbed_error.h b/platform/mbed_error.h index 18d02d62e8..9d35ff0e84 100644 --- a/platform/mbed_error.h +++ b/platform/mbed_error.h @@ -90,7 +90,7 @@ extern "C" { * System Error Status-es - 0x80XX0100 to 0x80XX0FFF - This corresponds to System error codes range(all values are negative). Bits 23-16 will be module type(marked with XX)\n * Custom Error Status-es - 0xA0XX1000 to 0xA0XXFFFF - This corresponds to Custom error codes range(all values are negative). Bits 23-16 will be module type(marked with XX)\n\n * - * The ERROR CODE(values encoded into ERROR CODE bit-field in mbed_error_status_t) value range for each error type is also seperated as below:\n + * The ERROR CODE(values encoded into ERROR CODE bit-field in mbed_error_status_t) value range for each error type is also separated as below:\n * Posix Error Codes - 1 to 255.\n * System Error Codes - 256 to 4095.\n * Custom Error Codes - 4096 to 65535.\n @@ -231,31 +231,32 @@ typedef enum _mbed_error_type_t { * @note * \n Below are the module code mappings:\n \verbatim - MBED_MODULE_APPLICATION 0 Application - MBED_MODULE_PLATFORM 1 Platform - MODULE_KERNEL 2 RTX Kernel - MBED_MODULE_NETWORK_STACK 3 Network stack - MBED_MODULE_HAL 4 HAL - Hardware Abstraction Layer - MBED_MODULE_NETWORK_STACKMODULE_MEMORY_SUBSYSTEM 5 Memory Subsystem - MBED_MODULE_FILESYSTEM 6 Filesystem - MBED_MODULE_BLOCK_DEVICE 7 Block device - MBED_MODULE_DRIVER 8 Driver - MBED_MODULE_DRIVER_SERIAL 9 Serial Driver - MBED_MODULE_DRIVER_RTC 10 RTC Driver - MBED_MODULE_DRIVER_I2C 11 I2C Driver - MODULE_DRIVER_SPI 12 SPI Driver - MODULE_DRIVER_GPIO 13 GPIO Driver - MODULE_DRIVER_ANALOG 14 Analog Driver - MODULE_DRIVER_DIGITAL 15 DigitalIO Driver - MODULE_DRIVER_CAN 16 CAN Driver - MODULE_DRIVER_ETHERNET 17 Ethernet Driver - MODULE_DRIVER_CRC 18 CRC Module - MODULE_DRIVER_PWM 19 PWM Driver - MODULE_DRIVER_QSPI 20 QSPI Driver - MODULE_DRIVER_USB 21 USB Driver - MODULE_TARGET_SDK 22 SDK + MBED_MODULE_APPLICATION 0 Application + MBED_MODULE_PLATFORM 1 Platform + MBED_MODULE_KERNEL 2 RTX Kernel + MBED_MODULE_NETWORK_STACK 3 Network stack + MBED_MODULE_HAL 4 HAL - Hardware Abstraction Layer + MBED_MODULE_MEMORY_SUBSYSTEM 5 Memory Subsystem + MBED_MODULE_FILESYSTEM 6 Filesystem + MBED_MODULE_BLOCK_DEVICE 7 Block device + MBED_MODULE_DRIVER 8 Driver + MBED_MODULE_DRIVER_SERIAL 9 Serial Driver + MBED_MODULE_DRIVER_RTC 10 RTC Driver + MBED_MODULE_DRIVER_I2C 11 I2C Driver + MBED_MODULE_DRIVER_SPI 12 SPI Driver + MBED_MODULE_DRIVER_GPIO 13 GPIO Driver + MBED_MODULE_DRIVER_ANALOG 14 Analog Driver + MBED_MODULE_DRIVER_DIGITAL 15 DigitalIO Driver + MBED_MODULE_DRIVER_CAN 16 CAN Driver + MBED_MODULE_DRIVER_ETHERNET 17 Ethernet Driver + MBED_MODULE_DRIVER_CRC 18 CRC Module + MBED_MODULE_DRIVER_PWM 19 PWM Driver + MBED_MODULE_DRIVER_QSPI 20 QSPI Driver + MBED_MODULE_DRIVER_USB 21 USB Driver + MBED_MODULE_TARGET_SDK 22 SDK + MBED_MODULE_BLE 23 BLE - MBED_MODULE_UNKNOWN 255 Unknown module + MBED_MODULE_UNKNOWN 255 Unknown module \endverbatim * */ @@ -265,7 +266,7 @@ typedef enum _mbed_module_type { MBED_MODULE_KERNEL, MBED_MODULE_NETWORK_STACK, MBED_MODULE_HAL, - MBED_MODULE_NETWORK_STACKMODULE_MEMORY_SUBSYSTEM, + MBED_MODULE_MEMORY_SUBSYSTEM, MBED_MODULE_FILESYSTEM, MBED_MODULE_BLOCK_DEVICE, MBED_MODULE_DRIVER, @@ -290,7 +291,7 @@ typedef enum _mbed_module_type { MBED_MODULE_MAX = MBED_MODULE_UNKNOWN } mbed_module_type_t; -//Use MBED_SUCCESS(=0) or any postive number for successful returns +//Use MBED_SUCCESS(=0) or any positive number for successful returns #define MBED_SUCCESS 0 #define MBED_POSIX_ERROR_BASE 0 @@ -469,7 +470,7 @@ typedef enum _mbed_module_type { INVALID_DATA 258 Invalid data INVALID_FORMAT 259 Invalid format INVALID_INDEX 260 Invalid Index - INVALID_SIZE 261 Inavlid Size + INVALID_SIZE 261 Invalid Size INVALID_OPERATION 262 Invalid Operation NOT_FOUND 263 Not Found ACCESS_DENIED 264 Access Denied @@ -484,9 +485,9 @@ typedef enum _mbed_module_type { OPERATION_ABORTED 273 Operation failed WRITE_PROTECTED 274 Attempt to write to write-protected resource NO_RESPONSE 275 No response - SEMAPHORE_LOCK_FAILED 276 Sempahore lock failed + SEMAPHORE_LOCK_FAILED 276 Semaphore lock failed MUTEX_LOCK_FAILED 277 Mutex lock failed - SEMAPHORE_UNLOCK_FAILED 278 Sempahore unlock failed + SEMAPHORE_UNLOCK_FAILED 278 Semaphore unlock failed MUTEX_UNLOCK_FAILED 279 Mutex unlock failed CRC_ERROR 280 CRC error or mismatch OPEN_FAILED 281 Open failed @@ -524,11 +525,14 @@ typedef enum _mbed_module_type { DEVICE_BUSY 313 Device Busy CONFIG_UNSUPPORTED 314 Configuration not supported CONFIG_MISMATCH 315 Configuration mismatch - ALREADY_INITIALIZED 316 Already initialzied + ALREADY_INITIALIZED 316 Already initialized HARDFAULT_EXCEPTION 317 HardFault exception MEMMANAGE_EXCEPTION 318 MemManage exception BUSFAULT_EXCEPTION 319 BusFault exception USAGEFAULT_EXCEPTION 320 UsageFault exception + BLE_NO_FRAME_INITIALIZED, 321 BLE No frame initialized + BLE_BACKEND_CREATION_FAILED 322 BLE Backend creation failed + BLE_BACKEND_NOT_INITIALIZED 323 BLE Backend not initialized \endverbatim * * @note @@ -561,13 +565,12 @@ typedef enum _mbed_module_type { * * \verbatim ++ MbedOS Error Info ++ - Error Status: 0x80040103 - Error Code: 259 - Error Module: 04 - Error Message: HAL Module error - Error Location: 0x000067C7 - Error Value: 0x00005566 - Current Thread: Id: 0x200024A8 EntryFn: 0x0000FB0D StackSize: 0x00001000 StackMem: 0x200014A8 SP: 0x2002FFD8 + Error Status: 0x80FF013D Code: 317 Module: 255 + Error Message: Fault exception + Location: 0x5CD1 + Error Value: 0x4A2A + Current Thread: Id: 0x20001E80 Entry: 0x5EB1 StackSize: 0x1000 StackMem: 0x20000E80 SP: 0x2002FF90 + For more info, visit: https://mbed.com/s/error?error=0x80FF013D&mbedos=999999&core=0x410FC241&compile=1&ver=5060528 -- MbedOS Error Info -- \endverbatim */ @@ -717,7 +720,7 @@ typedef enum _mbed_error_code { MBED_DEFINE_SYSTEM_ERROR(INVALID_DATA_DETECTED, 2), /* 258 Invalid data detected */ MBED_DEFINE_SYSTEM_ERROR(INVALID_FORMAT, 3), /* 259 Invalid format */ MBED_DEFINE_SYSTEM_ERROR(INVALID_INDEX, 4), /* 260 Invalid Index */ - MBED_DEFINE_SYSTEM_ERROR(INVALID_SIZE, 5), /* 261 Inavlid Size */ + MBED_DEFINE_SYSTEM_ERROR(INVALID_SIZE, 5), /* 261 Invalid Size */ MBED_DEFINE_SYSTEM_ERROR(INVALID_OPERATION, 6), /* 262 Invalid Operation */ MBED_DEFINE_SYSTEM_ERROR(ITEM_NOT_FOUND, 7), /* 263 Item Not Found */ MBED_DEFINE_SYSTEM_ERROR(ACCESS_DENIED, 8), /* 264 Access Denied */ @@ -732,9 +735,9 @@ typedef enum _mbed_error_code { MBED_DEFINE_SYSTEM_ERROR(OPERATION_ABORTED, 17), /* 273 Operation failed */ MBED_DEFINE_SYSTEM_ERROR(WRITE_PROTECTED, 18), /* 274 Attempt to write to write-protected resource */ MBED_DEFINE_SYSTEM_ERROR(NO_RESPONSE, 19), /* 275 No response */ - MBED_DEFINE_SYSTEM_ERROR(SEMAPHORE_LOCK_FAILED, 20), /* 276 Sempahore lock failed */ + MBED_DEFINE_SYSTEM_ERROR(SEMAPHORE_LOCK_FAILED, 20), /* 276 Semaphore lock failed */ MBED_DEFINE_SYSTEM_ERROR(MUTEX_LOCK_FAILED, 21), /* 277 Mutex lock failed */ - MBED_DEFINE_SYSTEM_ERROR(SEMAPHORE_UNLOCK_FAILED, 22), /* 278 Sempahore unlock failed */ + MBED_DEFINE_SYSTEM_ERROR(SEMAPHORE_UNLOCK_FAILED, 22), /* 278 Semaphore unlock failed */ MBED_DEFINE_SYSTEM_ERROR(MUTEX_UNLOCK_FAILED, 23), /* 279 Mutex unlock failed */ MBED_DEFINE_SYSTEM_ERROR(CRC_ERROR, 24), /* 280 CRC error or mismatch */ MBED_DEFINE_SYSTEM_ERROR(OPEN_FAILED, 25), /* 281 Open failed */ @@ -772,7 +775,7 @@ typedef enum _mbed_error_code { MBED_DEFINE_SYSTEM_ERROR(DEVICE_BUSY, 57), /* 313 Device Busy */ MBED_DEFINE_SYSTEM_ERROR(CONFIG_UNSUPPORTED, 58), /* 314 Configuration not supported */ MBED_DEFINE_SYSTEM_ERROR(CONFIG_MISMATCH, 59), /* 315 Configuration mismatch */ - MBED_DEFINE_SYSTEM_ERROR(ALREADY_INITIALIZED, 60), /* 316 Already initialzied */ + MBED_DEFINE_SYSTEM_ERROR(ALREADY_INITIALIZED, 60), /* 316 Already initialized */ MBED_DEFINE_SYSTEM_ERROR(HARDFAULT_EXCEPTION, 61), /* 317 HardFault exception */ MBED_DEFINE_SYSTEM_ERROR(MEMMANAGE_EXCEPTION, 62), /* 318 MemManage exception */ MBED_DEFINE_SYSTEM_ERROR(BUSFAULT_EXCEPTION, 63), /* 319 BusFault exception */ @@ -919,7 +922,6 @@ void error(const char *format, ...); * Callback/Error hook function prototype. Applications needing a callback when an error is reported can use mbed_set_error_hook function * to register a callback/error hook function using the following prototype. When an error happens in the system error handling * implementation will invoke this callback with the mbed_error_status_t reported and the error context at the time of error. - * @param error_status mbed_error_status_t status being reported. * @param error_ctx Error context structure associated with this error. * @return void *