diff --git a/.astyleignore b/.astyleignore index 71141325c60..e1509e735ec 100644 --- a/.astyleignore +++ b/.astyleignore @@ -11,6 +11,7 @@ features/FEATURE_BLE/targets features/FEATURE_LWIP/lwip-interface/lwip features/unsupported/ features/FEATURE_COMMON_PAL/ +hal/storage_abstraction FEATURE_NANOSTACK/coap-service FEATURE_NANOSTACK/sal-stack-nanostack rtos/TARGET_CORTEX/rtx5 diff --git a/TESTS/mbed_drivers/lp_timer/main.cpp b/TESTS/mbed_drivers/lp_timer/main.cpp index cadf3f41c7d..56d37fd8d5d 100644 --- a/TESTS/mbed_drivers/lp_timer/main.cpp +++ b/TESTS/mbed_drivers/lp_timer/main.cpp @@ -55,6 +55,18 @@ extern uint32_t SystemCoreClock; #define DELTA_MS(delay_ms) (1 + ((delay_ms) * US_PER_MSEC / 20 / US_PER_MSEC)) #define DELTA_S(delay_ms) (0.000500f + (((float)(delay_ms)) / MSEC_PER_SEC / 20)) +void busy_wait_us(int us) +{ + const ticker_data_t *const ticker = get_us_ticker_data(); + uint32_t start = ticker_read(ticker); + while ((ticker_read(ticker) - start) < (uint32_t)us); +} + +void busy_wait_ms(int ms) +{ + busy_wait_us(ms * US_PER_MSEC); +} + /* This test verifies if low power timer is stopped after * creation. * @@ -74,7 +86,7 @@ void test_lptimer_creation() /* Wait 10 ms. * After that operation timer read routines should still return 0. */ - wait_ms(10); + busy_wait_ms(10); /* Check results. */ TEST_ASSERT_EQUAL_FLOAT(0, lp_timer.read()); @@ -102,7 +114,7 @@ void test_lptimer_time_accumulation() lp_timer.start(); /* Wait 10 ms. */ - wait_ms(10); + busy_wait_ms(10); /* Stop the timer. */ lp_timer.stop(); @@ -116,7 +128,7 @@ void test_lptimer_time_accumulation() /* Wait 50 ms - this is done to show that time elapsed when * the timer is stopped does not have influence on the * timer counted time. */ - wait_ms(50); + busy_wait_ms(50); /* ------ */ @@ -124,7 +136,7 @@ void test_lptimer_time_accumulation() lp_timer.start(); /* Wait 20 ms. */ - wait_ms(20); + busy_wait_ms(20); /* Stop the timer. */ lp_timer.stop(); @@ -145,7 +157,7 @@ void test_lptimer_time_accumulation() lp_timer.start(); /* Wait 30 ms. */ - wait_ms(30); + busy_wait_ms(30); /* Stop the timer. */ lp_timer.stop(); @@ -159,7 +171,7 @@ void test_lptimer_time_accumulation() /* Wait 50 ms - this is done to show that time elapsed when * the timer is stopped does not have influence on the * timer time. */ - wait_ms(50); + busy_wait_ms(50); /* ------ */ @@ -167,7 +179,7 @@ void test_lptimer_time_accumulation() lp_timer.start(); /* Wait 1 sec. */ - wait_ms(1000); + busy_wait_ms(1000); /* Stop the timer. */ lp_timer.stop(); @@ -196,7 +208,7 @@ void test_lptimer_reset() lp_timer.start(); /* Wait 10 ms. */ - wait_ms(10); + busy_wait_ms(10); /* Stop the timer. */ lp_timer.stop(); @@ -214,7 +226,7 @@ void test_lptimer_reset() lp_timer.start(); /* Wait 20 ms. */ - wait_ms(20); + busy_wait_ms(20); /* Stop the timer. */ lp_timer.stop(); @@ -241,13 +253,13 @@ void test_lptimer_start_started_timer() lp_timer.start(); /* Wait 10 ms. */ - wait_ms(10); + busy_wait_ms(10); /* Now start timer again. */ lp_timer.start(); /* Wait 20 ms. */ - wait_ms(20); + busy_wait_ms(20); /* Stop the timer. */ lp_timer.stop(); @@ -274,7 +286,7 @@ void test_lptimer_float_operator() lp_timer.start(); /* Wait 10 ms. */ - wait_ms(10); + busy_wait_ms(10); /* Stop the timer. */ lp_timer.stop(); @@ -302,7 +314,7 @@ void test_lptimer_time_measurement() lp_timer.start(); /* Wait us. */ - wait_us(wait_val_us); + busy_wait_us(wait_val_us); /* Stop the timer. */ lp_timer.stop(); diff --git a/TESTS/mbed_hal/common_tickers/main.cpp b/TESTS/mbed_hal/common_tickers/main.cpp index b63df92c0c3..873f06b78ba 100644 --- a/TESTS/mbed_hal/common_tickers/main.cpp +++ b/TESTS/mbed_hal/common_tickers/main.cpp @@ -52,6 +52,7 @@ unsigned int ticker_overflow_delta; /* Auxiliary function to count ticker ticks elapsed during execution of N cycles of empty while loop. * Parameter is used to disable compiler optimisation. */ +MBED_NOINLINE uint32_t count_ticks(uint32_t cycles, uint32_t step) { register uint32_t reg_cycles = cycles; diff --git a/TESTS/mbed_hal/lp_ticker/main.cpp b/TESTS/mbed_hal/lp_ticker/main.cpp index 8c40e9c6677..92aa4c04770 100644 --- a/TESTS/mbed_hal/lp_ticker/main.cpp +++ b/TESTS/mbed_hal/lp_ticker/main.cpp @@ -29,6 +29,8 @@ using namespace utest::v1; volatile int intFlag = 0; +#define US_PER_MS 1000 + #define TICKER_GLITCH_TEST_TICKS 1000 #define TICKER_INT_VAL 500 @@ -36,6 +38,29 @@ volatile int intFlag = 0; #define LP_TICKER_OV_LIMIT 4000 +/* Flush serial buffer before deep sleep + * + * Since deepsleep() may shut down the UART peripheral, we wait for some time + * to allow for hardware serial buffers to completely flush. + * + * Take NUMAKER_PFM_NUC472 as an example: + * Its UART peripheral has 16-byte Tx FIFO. With baud rate set to 9600, flush + * Tx FIFO would take: 16 * 8 * 1000 / 9600 = 13.3 (ms). So set wait time to + * 20ms here for safe. + * + * This should be replaced with a better function that checks if the + * hardware buffers are empty. However, such an API does not exist now, + * so we'll use the busy_wait_ms() function for now. + */ +#define SERIAL_FLUSH_TIME_MS 20 + +void busy_wait_ms(int ms) +{ + const ticker_data_t *const ticker = get_us_ticker_data(); + uint32_t start = ticker_read(ticker); + while ((ticker_read(ticker) - start) < (uint32_t)(ms * US_PER_MS)); +} + /* Since according to the ticker requirements min acceptable counter size is * - 12 bits for low power timer - max count = 4095, * then all test cases must be executed in this time windows. @@ -72,11 +97,6 @@ void ticker_event_handler_stub(const ticker_data_t * const ticker) lp_ticker_disable_interrupt(); } -void wait_cycles(volatile unsigned int cycles) -{ - while (cycles--); -} - /* Test that the ticker has the correct frequency and number of bits. */ void lp_ticker_info_test() { @@ -97,8 +117,10 @@ void lp_ticker_deepsleep_test() lp_ticker_init(); - /* Wait for green tea UART transmission before entering deep-sleep mode. */ - wait_cycles(400000); + /* Give some time Green Tea to finish UART transmission before entering + * deep-sleep mode. + */ + busy_wait_ms(SERIAL_FLUSH_TIME_MS); overflow_protect(); diff --git a/TESTS/mbed_platform/stats_sys/main.cpp b/TESTS/mbed_platform/stats_sys/main.cpp index a9949d67dbd..9cbd898e562 100644 --- a/TESTS/mbed_platform/stats_sys/main.cpp +++ b/TESTS/mbed_platform/stats_sys/main.cpp @@ -32,6 +32,7 @@ void test_sys_info() mbed_stats_sys_t stats; mbed_stats_sys_get(&stats); + TEST_ASSERT_NOT_EQUAL(0, stats.os_version); #if defined(__CORTEX_M) TEST_ASSERT_NOT_EQUAL(0, stats.cpu_id); #endif diff --git a/TESTS/mbedmicro-rtos-mbed/kernel_tick_count/main.cpp b/TESTS/mbedmicro-rtos-mbed/kernel_tick_count/main.cpp new file mode 100644 index 00000000000..9f5eb6eabe5 --- /dev/null +++ b/TESTS/mbedmicro-rtos-mbed/kernel_tick_count/main.cpp @@ -0,0 +1,119 @@ +/* mbed Microcontroller Library + * Copyright (c) 2018-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "greentea-client/test_env.h" +#include "utest/utest.h" +#include "unity/unity.h" + +#include "rtos/Kernel.h" +#include "mbed.h" + + +using utest::v1::Case; + +#define TEST_REPEAT_COUNT 1000 +#define NUM_WAIT_TICKS 1000 + +// all in [us] +#define ONE_SECOND 1000000 +#define SMALL_DELTA 1500 // 0.15% +#define BIG_DELTA 15000 // 1.5% + +/** Test if kernel ticker frequency is 1kHz + + Given a RTOS kernel ticker + When check it frequency + Then the the frequency is 1kHz + */ +void test_frequency() +{ + uint32_t freq = osKernelGetTickFreq(); + TEST_ASSERT_EQUAL_UINT32_MESSAGE(1000, freq, "Expected SysTick frequency is 1kHz"); +} + +/** Test if kernel ticker increments by one + + Given a RTOS kernel ticker + When perform subsequent calls of @a rtos::Kernel::get_ms_count + Then subsequent reads should not differ by more than one + */ +void test_increment(void) +{ + for (uint32_t i = 0; i < TEST_REPEAT_COUNT; i++) { + const uint64_t start = rtos::Kernel::get_ms_count(); + while (true) { + uint64_t diff = rtos::Kernel::get_ms_count() - start; + if (diff != 0) { + TEST_ASSERT_EQUAL_UINT64(1, diff); + break; + } + } + } +} + +/** Test if kernel ticker interval is 1ms + + Given a RTOS kernel ticker + When perform subsequent calls of @a rtos::Kernel::get_ms_count + Then the ticker interval should be 1ms + */ +void test_interval() +{ + uint64_t start, stop; + Timer timer; + + start = rtos::Kernel::get_ms_count(); + // wait for tick + do { + stop = rtos::Kernel::get_ms_count(); + } while ((stop - start) == 0); + timer.start(); + start = stop; + + // wait for NUM_WAIT_TICKS ticks + do { + stop = rtos::Kernel::get_ms_count(); + } while ((stop - start) != NUM_WAIT_TICKS); + timer.stop(); + TEST_ASSERT_EQUAL_UINT64(NUM_WAIT_TICKS, (stop - start)); + +#if defined(NO_SYSTICK) || defined(MBED_TICKLESS) + // On targets with NO_SYSTICK/MBED_TICKLESS enabled, systick is emulated by lp_ticker what makes it less accurate + // for more details https://os.mbed.com/docs/latest/reference/tickless.html + TEST_ASSERT_UINT64_WITHIN(BIG_DELTA, ONE_SECOND, timer.read_high_resolution_us()); +#else + TEST_ASSERT_UINT64_WITHIN(SMALL_DELTA, ONE_SECOND, timer.read_high_resolution_us()); +#endif +} + +// Test cases +Case cases[] = { + Case("Test kernel ticker frequency", test_frequency), + Case("Test if kernel ticker increments by one", test_increment), + Case("Test if kernel ticker interval is 1ms", test_interval) +}; + +utest::v1::status_t greentea_test_setup(const size_t number_of_cases) +{ + GREENTEA_SETUP(10, "timing_drift_auto"); + return utest::v1::greentea_test_setup_handler(number_of_cases); +} + +utest::v1::Specification specification(greentea_test_setup, cases); + +int main() +{ + return !utest::v1::Harness::run(specification); +} diff --git a/drivers/AnalogIn.h b/drivers/AnalogIn.h index e81428fc21f..c9ccfa25a16 100644 --- a/drivers/AnalogIn.h +++ b/drivers/AnalogIn.h @@ -57,7 +57,8 @@ class AnalogIn { * * @param pin AnalogIn pin to connect to */ - AnalogIn(PinName pin) { + AnalogIn(PinName pin) + { lock(); analogin_init(&_adc, pin); unlock(); @@ -67,7 +68,8 @@ class AnalogIn { * * @returns A floating-point value representing the current input voltage, measured as a percentage */ - float read() { + float read() + { lock(); float ret = analogin_read(&_adc); unlock(); @@ -79,7 +81,8 @@ class AnalogIn { * @returns * 16-bit unsigned short representing the current input voltage, normalised to a 16-bit value */ - unsigned short read_u16() { + unsigned short read_u16() + { lock(); unsigned short ret = analogin_read_u16(&_adc); unlock(); @@ -99,22 +102,26 @@ class AnalogIn { * if(volume > 0.25) { ... } * @endcode */ - operator float() { + operator float() + { // Underlying call is thread safe return read(); } - virtual ~AnalogIn() { + virtual ~AnalogIn() + { // Do nothing } protected: - virtual void lock() { + virtual void lock() + { _mutex->lock(); } - virtual void unlock() { + virtual void unlock() + { _mutex->unlock(); } diff --git a/drivers/AnalogOut.h b/drivers/AnalogOut.h index 5038f0f7a43..3945c580c44 100644 --- a/drivers/AnalogOut.h +++ b/drivers/AnalogOut.h @@ -57,7 +57,8 @@ class AnalogOut { * * @param pin AnalogOut pin to connect to */ - AnalogOut(PinName pin) { + AnalogOut(PinName pin) + { analogout_init(&_dac, pin); } @@ -68,7 +69,8 @@ class AnalogOut { * 0.0f (representing 0v / 0%) and 1.0f (representing 3.3v / 100%). * Values outside this range will be saturated to 0.0f or 1.0f. */ - void write(float value) { + void write(float value) + { lock(); analogout_write(&_dac, value); unlock(); @@ -79,7 +81,8 @@ class AnalogOut { * @param value 16-bit unsigned short representing the output voltage, * normalised to a 16-bit value (0x0000 = 0v, 0xFFFF = 3.3v) */ - void write_u16(unsigned short value) { + void write_u16(unsigned short value) + { lock(); analogout_write_u16(&_dac, value); unlock(); @@ -95,7 +98,8 @@ class AnalogOut { * @note * This value may not match exactly the value set by a previous write(). */ - float read() { + float read() + { lock(); float ret = analogout_read(&_dac); unlock(); @@ -105,7 +109,8 @@ class AnalogOut { /** An operator shorthand for write() * \sa AnalogOut::write() */ - AnalogOut& operator= (float percent) { + AnalogOut &operator= (float percent) + { // Underlying write call is thread safe write(percent); return *this; @@ -114,7 +119,8 @@ class AnalogOut { /** An operator shorthand for write() * \sa AnalogOut::write() */ - AnalogOut& operator= (AnalogOut& rhs) { + AnalogOut &operator= (AnalogOut &rhs) + { // Underlying write call is thread safe write(rhs.read()); return *this; @@ -123,22 +129,26 @@ class AnalogOut { /** An operator shorthand for read() * \sa AnalogOut::read() */ - operator float() { + operator float() + { // Underlying read call is thread safe return read(); } - virtual ~AnalogOut() { + virtual ~AnalogOut() + { // Do nothing } protected: - virtual void lock() { + virtual void lock() + { _mutex.lock(); } - virtual void unlock() { + virtual void unlock() + { _mutex.unlock(); } diff --git a/drivers/BusIn.cpp b/drivers/BusIn.cpp index 1fd05282148..f6cc933e7ea 100644 --- a/drivers/BusIn.cpp +++ b/drivers/BusIn.cpp @@ -18,12 +18,13 @@ namespace mbed { -BusIn::BusIn(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) { +BusIn::BusIn(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) +{ PinName pins[16] = {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15}; // No lock needed in the constructor _nc_mask = 0; - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { _pin[i] = (pins[i] != NC) ? new DigitalIn(pins[i]) : 0; if (pins[i] != NC) { _nc_mask |= (1 << i); @@ -31,10 +32,11 @@ BusIn::BusIn(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName } } -BusIn::BusIn(PinName pins[16]) { +BusIn::BusIn(PinName pins[16]) +{ // No lock needed in the constructor _nc_mask = 0; - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { _pin[i] = (pins[i] != NC) ? new DigitalIn(pins[i]) : 0; if (pins[i] != NC) { _nc_mask |= (1 << i); @@ -42,19 +44,21 @@ BusIn::BusIn(PinName pins[16]) { } } -BusIn::~BusIn() { +BusIn::~BusIn() +{ // No lock needed in the destructor - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { delete _pin[i]; } } } -int BusIn::read() { +int BusIn::read() +{ int v = 0; lock(); - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { v |= _pin[i]->read() << i; } @@ -63,9 +67,10 @@ int BusIn::read() { return v; } -void BusIn::mode(PinMode pull) { +void BusIn::mode(PinMode pull) +{ lock(); - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { _pin[i]->mode(pull); } @@ -73,20 +78,24 @@ void BusIn::mode(PinMode pull) { unlock(); } -void BusIn::lock() { +void BusIn::lock() +{ _mutex.lock(); } -void BusIn::unlock() { +void BusIn::unlock() +{ _mutex.unlock(); } -BusIn::operator int() { +BusIn::operator int() +{ // Underlying read is thread safe return read(); } -DigitalIn& BusIn::operator[] (int index) { +DigitalIn &BusIn::operator[](int index) +{ // No lock needed since _pin is not modified outside the constructor MBED_ASSERT(index >= 0 && index <= 16); MBED_ASSERT(_pin[index]); diff --git a/drivers/BusIn.h b/drivers/BusIn.h index d015529435f..80b20d72a1f 100644 --- a/drivers/BusIn.h +++ b/drivers/BusIn.h @@ -62,12 +62,12 @@ class BusIn : private NonCopyable { PinName p8 = NC, PinName p9 = NC, PinName p10 = NC, PinName p11 = NC, PinName p12 = NC, PinName p13 = NC, PinName p14 = NC, PinName p15 = NC); - + /** Create an BusIn, connected to the specified pins * * @param pins An array of pins to connect to bus bit */ - BusIn(PinName pins[16]); + BusIn(PinName pins[16]); virtual ~BusIn(); @@ -90,7 +90,8 @@ class BusIn : private NonCopyable { * @returns * Binary mask of connected pins */ - int mask() { + int mask() + { // No lock needed since _nc_mask is not modified outside the constructor return _nc_mask; } @@ -103,10 +104,10 @@ class BusIn : private NonCopyable { /** Access to particular bit in random-iterator fashion * @param index Position of bit */ - DigitalIn & operator[] (int index); + DigitalIn &operator[](int index); protected: - DigitalIn* _pin[16]; + DigitalIn *_pin[16]; /* Mask of bus's NC pins * If bit[n] is set to 1 - pin is connected diff --git a/drivers/BusInOut.cpp b/drivers/BusInOut.cpp index ff244fa464e..950cbb5d58f 100644 --- a/drivers/BusInOut.cpp +++ b/drivers/BusInOut.cpp @@ -18,12 +18,13 @@ namespace mbed { -BusInOut::BusInOut(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) { +BusInOut::BusInOut(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) +{ PinName pins[16] = {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15}; // No lock needed in the constructor _nc_mask = 0; - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { _pin[i] = (pins[i] != NC) ? new DigitalInOut(pins[i]) : 0; if (pins[i] != NC) { _nc_mask |= (1 << i); @@ -31,10 +32,11 @@ BusInOut::BusInOut(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, P } } -BusInOut::BusInOut(PinName pins[16]) { +BusInOut::BusInOut(PinName pins[16]) +{ // No lock needed in the constructor _nc_mask = 0; - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { _pin[i] = (pins[i] != NC) ? new DigitalInOut(pins[i]) : 0; if (pins[i] != NC) { _nc_mask |= (1 << i); @@ -42,18 +44,20 @@ BusInOut::BusInOut(PinName pins[16]) { } } -BusInOut::~BusInOut() { +BusInOut::~BusInOut() +{ // No lock needed in the destructor - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { delete _pin[i]; } } } -void BusInOut::write(int value) { +void BusInOut::write(int value) +{ lock(); - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { _pin[i]->write((value >> i) & 1); } @@ -61,10 +65,11 @@ void BusInOut::write(int value) { unlock(); } -int BusInOut::read() { +int BusInOut::read() +{ lock(); int v = 0; - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { v |= _pin[i]->read() << i; } @@ -73,9 +78,10 @@ int BusInOut::read() { return v; } -void BusInOut::output() { +void BusInOut::output() +{ lock(); - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { _pin[i]->output(); } @@ -83,9 +89,10 @@ void BusInOut::output() { unlock(); } -void BusInOut::input() { +void BusInOut::input() +{ lock(); - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { _pin[i]->input(); } @@ -93,9 +100,10 @@ void BusInOut::input() { unlock(); } -void BusInOut::mode(PinMode pull) { +void BusInOut::mode(PinMode pull) +{ lock(); - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { _pin[i]->mode(pull); } @@ -103,35 +111,41 @@ void BusInOut::mode(PinMode pull) { unlock(); } -BusInOut& BusInOut::operator= (int v) { +BusInOut &BusInOut::operator= (int v) +{ // Underlying write is thread safe write(v); return *this; } -BusInOut& BusInOut::operator= (BusInOut& rhs) { +BusInOut &BusInOut::operator= (BusInOut &rhs) +{ // Underlying read is thread safe write(rhs.read()); return *this; } -DigitalInOut& BusInOut::operator[] (int index) { +DigitalInOut &BusInOut::operator[](int index) +{ // No lock needed since _pin is not modified outside the constructor MBED_ASSERT(index >= 0 && index <= 16); MBED_ASSERT(_pin[index]); return *_pin[index]; } -BusInOut::operator int() { +BusInOut::operator int() +{ // Underlying read is thread safe return read(); } -void BusInOut::lock() { +void BusInOut::lock() +{ _mutex.lock(); } -void BusInOut::unlock() { +void BusInOut::unlock() +{ _mutex.unlock(); } diff --git a/drivers/BusInOut.h b/drivers/BusInOut.h index 0be52cacc55..9bb4e995ae3 100644 --- a/drivers/BusInOut.h +++ b/drivers/BusInOut.h @@ -103,21 +103,22 @@ class BusInOut : private NonCopyable { * @returns * Binary mask of connected pins */ - int mask() { + int mask() + { // No lock needed since _nc_mask is not modified outside the constructor return _nc_mask; } - /** A shorthand for write() + /** A shorthand for write() * \sa BusInOut::write() - */ - BusInOut& operator= (int v); - BusInOut& operator= (BusInOut& rhs); + */ + BusInOut &operator= (int v); + BusInOut &operator= (BusInOut &rhs); /** Access to particular bit in random-iterator fashion * @param index Bit Position */ - DigitalInOut& operator[] (int index); + DigitalInOut &operator[](int index); /** A shorthand for read() * \sa BusInOut::read() @@ -127,7 +128,7 @@ class BusInOut : private NonCopyable { protected: virtual void lock(); virtual void unlock(); - DigitalInOut* _pin[16]; + DigitalInOut *_pin[16]; /* Mask of bus's NC pins * If bit[n] is set to 1 - pin is connected diff --git a/drivers/BusOut.cpp b/drivers/BusOut.cpp index 901955257a8..913ba197505 100644 --- a/drivers/BusOut.cpp +++ b/drivers/BusOut.cpp @@ -18,12 +18,13 @@ namespace mbed { -BusOut::BusOut(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) { +BusOut::BusOut(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinName p5, PinName p6, PinName p7, PinName p8, PinName p9, PinName p10, PinName p11, PinName p12, PinName p13, PinName p14, PinName p15) +{ PinName pins[16] = {p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15}; // No lock needed in the constructor _nc_mask = 0; - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { _pin[i] = (pins[i] != NC) ? new DigitalOut(pins[i]) : 0; if (pins[i] != NC) { _nc_mask |= (1 << i); @@ -31,10 +32,11 @@ BusOut::BusOut(PinName p0, PinName p1, PinName p2, PinName p3, PinName p4, PinNa } } -BusOut::BusOut(PinName pins[16]) { +BusOut::BusOut(PinName pins[16]) +{ // No lock needed in the constructor _nc_mask = 0; - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { _pin[i] = (pins[i] != NC) ? new DigitalOut(pins[i]) : 0; if (pins[i] != NC) { _nc_mask |= (1 << i); @@ -42,18 +44,20 @@ BusOut::BusOut(PinName pins[16]) { } } -BusOut::~BusOut() { +BusOut::~BusOut() +{ // No lock needed in the destructor - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { delete _pin[i]; } } } -void BusOut::write(int value) { +void BusOut::write(int value) +{ lock(); - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { _pin[i]->write((value >> i) & 1); } @@ -61,10 +65,11 @@ void BusOut::write(int value) { unlock(); } -int BusOut::read() { +int BusOut::read() +{ lock(); int v = 0; - for (int i=0; i<16; i++) { + for (int i = 0; i < 16; i++) { if (_pin[i] != 0) { v |= _pin[i]->read() << i; } @@ -73,35 +78,41 @@ int BusOut::read() { return v; } -BusOut& BusOut::operator= (int v) { +BusOut &BusOut::operator= (int v) +{ // Underlying write is thread safe write(v); return *this; } -BusOut& BusOut::operator= (BusOut& rhs) { +BusOut &BusOut::operator= (BusOut &rhs) +{ // Underlying write is thread safe write(rhs.read()); return *this; } -DigitalOut& BusOut::operator[] (int index) { +DigitalOut &BusOut::operator[](int index) +{ // No lock needed since _pin is not modified outside the constructor MBED_ASSERT(index >= 0 && index <= 16); MBED_ASSERT(_pin[index]); return *_pin[index]; } -BusOut::operator int() { +BusOut::operator int() +{ // Underlying read is thread safe return read(); } -void BusOut::lock() { +void BusOut::lock() +{ _mutex.lock(); } -void BusOut::unlock() { +void BusOut::unlock() +{ _mutex.unlock(); } diff --git a/drivers/BusOut.h b/drivers/BusOut.h index d7612d45924..2f908b65d84 100644 --- a/drivers/BusOut.h +++ b/drivers/BusOut.h @@ -87,7 +87,8 @@ class BusOut : private NonCopyable { * @returns * Binary mask of connected pins */ - int mask() { + int mask() + { // No lock needed since _nc_mask is not modified outside the constructor return _nc_mask; } @@ -95,13 +96,13 @@ class BusOut : private NonCopyable { /** A shorthand for write() * \sa BusOut::write() */ - BusOut& operator= (int v); - BusOut& operator= (BusOut& rhs); + BusOut &operator= (int v); + BusOut &operator= (BusOut &rhs); /** Access to particular bit in random-iterator fashion * @param index Bit Position */ - DigitalOut& operator[] (int index); + DigitalOut &operator[](int index); /** A shorthand for read() * \sa BusOut::read() @@ -111,7 +112,7 @@ class BusOut : private NonCopyable { protected: virtual void lock(); virtual void unlock(); - DigitalOut* _pin[16]; + DigitalOut *_pin[16]; /* Mask of bus's NC pins * If bit[n] is set to 1 - pin is connected diff --git a/drivers/CAN.cpp b/drivers/CAN.cpp index a5e8e4266b9..2c0a53442f5 100644 --- a/drivers/CAN.cpp +++ b/drivers/CAN.cpp @@ -22,7 +22,8 @@ namespace mbed { -CAN::CAN(PinName rd, PinName td) : _can(), _irq() { +CAN::CAN(PinName rd, PinName td) : _can(), _irq() +{ // No lock needed in constructor for (size_t i = 0; i < sizeof _irq / sizeof _irq[0]; i++) { @@ -33,7 +34,8 @@ CAN::CAN(PinName rd, PinName td) : _can(), _irq() { can_irq_init(&_can, (&CAN::_irq_handler), (uint32_t)this); } -CAN::CAN(PinName rd, PinName td, int hz) : _can(), _irq() { +CAN::CAN(PinName rd, PinName td, int hz) : _can(), _irq() +{ // No lock needed in constructor for (size_t i = 0; i < sizeof _irq / sizeof _irq[0]; i++) { @@ -44,7 +46,8 @@ CAN::CAN(PinName rd, PinName td, int hz) : _can(), _irq() { can_irq_init(&_can, (&CAN::_irq_handler), (uint32_t)this); } -CAN::~CAN() { +CAN::~CAN() +{ // No lock needed in destructor // Detaching interrupts releases the sleep lock if it was locked @@ -55,68 +58,78 @@ CAN::~CAN() { can_free(&_can); } -int CAN::frequency(int f) { +int CAN::frequency(int f) +{ lock(); int ret = can_frequency(&_can, f); unlock(); return ret; } -int CAN::write(CANMessage msg) { +int CAN::write(CANMessage msg) +{ lock(); int ret = can_write(&_can, msg, 0); unlock(); return ret; } -int CAN::read(CANMessage &msg, int handle) { +int CAN::read(CANMessage &msg, int handle) +{ lock(); int ret = can_read(&_can, &msg, handle); unlock(); return ret; } -void CAN::reset() { +void CAN::reset() +{ lock(); can_reset(&_can); unlock(); } -unsigned char CAN::rderror() { +unsigned char CAN::rderror() +{ lock(); int ret = can_rderror(&_can); unlock(); return ret; } -unsigned char CAN::tderror() { +unsigned char CAN::tderror() +{ lock(); int ret = can_tderror(&_can); unlock(); return ret; } -void CAN::monitor(bool silent) { +void CAN::monitor(bool silent) +{ lock(); can_monitor(&_can, (silent) ? 1 : 0); unlock(); } -int CAN::mode(Mode mode) { +int CAN::mode(Mode mode) +{ lock(); int ret = can_mode(&_can, (CanMode)mode); unlock(); return ret; } -int CAN::filter(unsigned int id, unsigned int mask, CANFormat format, int handle) { +int CAN::filter(unsigned int id, unsigned int mask, CANFormat format, int handle) +{ lock(); int ret = can_filter(&_can, id, mask, format, handle); unlock(); return ret; } -void CAN::attach(Callback func, IrqType type) { +void CAN::attach(Callback func, IrqType type) +{ lock(); if (func) { // lock deep sleep only the first time @@ -136,18 +149,21 @@ void CAN::attach(Callback func, IrqType type) { unlock(); } -void CAN::_irq_handler(uint32_t id, CanIrqType type) { - CAN *handler = (CAN*)id; +void CAN::_irq_handler(uint32_t id, CanIrqType type) +{ + CAN *handler = (CAN *)id; if (handler->_irq[type]) { handler->_irq[type].call(); } } -void CAN::lock() { +void CAN::lock() +{ _mutex.lock(); } -void CAN::unlock() { +void CAN::unlock() +{ _mutex.unlock(); } diff --git a/drivers/CAN.h b/drivers/CAN.h index 668e32c256e..5f506f68adb 100644 --- a/drivers/CAN.h +++ b/drivers/CAN.h @@ -38,7 +38,8 @@ class CANMessage : public CAN_Message { public: /** Creates empty CAN message. */ - CANMessage() : CAN_Message() { + CANMessage() : CAN_Message() + { len = 8; type = CANData; format = CANStandard; @@ -54,12 +55,13 @@ class CANMessage : public CAN_Message { * @param _type Type of Data: Use enum CANType for valid parameter values * @param _format Data Format: Use enum CANFormat for valid parameter values */ - CANMessage(int _id, const char *_data, char _len = 8, CANType _type = CANData, CANFormat _format = CANStandard) { - len = _len & 0xF; - type = _type; - format = _format; - id = _id; - memcpy(data, _data, _len); + CANMessage(int _id, const char *_data, char _len = 8, CANType _type = CANData, CANFormat _format = CANStandard) + { + len = _len & 0xF; + type = _type; + format = _format; + id = _id; + memcpy(data, _data, _len); } /** Creates CAN remote message. @@ -67,12 +69,13 @@ class CANMessage : public CAN_Message { * @param _id Message ID * @param _format Data Format: Use enum CANType for valid parameter values */ - CANMessage(int _id, CANFormat _format = CANStandard) { - len = 0; - type = CANRemote; - format = _format; - id = _id; - memset(data, 0, 8); + CANMessage(int _id, CANFormat _format = CANStandard) + { + len = 0; + type = CANRemote; + format = _format; + id = _id; + memset(data, 0, 8); } }; @@ -235,48 +238,50 @@ class CAN : private NonCopyable { /** Attach a function to call whenever a CAN frame received interrupt is * generated. - * + * * This function locks the deep sleep while a callback is attached - * + * * @param func A pointer to a void function, or 0 to set as none * @param type Which CAN interrupt to attach the member function to (CAN::RxIrq for message received, CAN::TxIrq for transmitted or aborted, CAN::EwIrq for error warning, CAN::DoIrq for data overrun, CAN::WuIrq for wake-up, CAN::EpIrq for error passive, CAN::AlIrq for arbitration lost, CAN::BeIrq for bus error) */ - void attach(Callback func, IrqType type=RxIrq); - - /** Attach a member function to call whenever a CAN frame received interrupt - * is generated. - * - * @param obj pointer to the object to call the member function on - * @param method pointer to the member function to be called - * @param type Which CAN interrupt to attach the member function to (CAN::RxIrq for message received, TxIrq for transmitted or aborted, EwIrq for error warning, DoIrq for data overrun, WuIrq for wake-up, EpIrq for error passive, AlIrq for arbitration lost, BeIrq for bus error) - * @deprecated - * The attach function does not support cv-qualifiers. Replaced by - * attach(callback(obj, method), type). - */ + void attach(Callback func, IrqType type = RxIrq); + + /** Attach a member function to call whenever a CAN frame received interrupt + * is generated. + * + * @param obj pointer to the object to call the member function on + * @param method pointer to the member function to be called + * @param type Which CAN interrupt to attach the member function to (CAN::RxIrq for message received, TxIrq for transmitted or aborted, EwIrq for error warning, DoIrq for data overrun, WuIrq for wake-up, EpIrq for error passive, AlIrq for arbitration lost, BeIrq for bus error) + * @deprecated + * The attach function does not support cv-qualifiers. Replaced by + * attach(callback(obj, method), type). + */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "The attach function does not support cv-qualifiers. Replaced by " - "attach(callback(obj, method), type).") - void attach(T* obj, void (T::*method)(), IrqType type=RxIrq) { + "The attach function does not support cv-qualifiers. Replaced by " + "attach(callback(obj, method), type).") + void attach(T *obj, void (T::*method)(), IrqType type = RxIrq) + { // Underlying call thread safe attach(callback(obj, method), type); } - /** Attach a member function to call whenever a CAN frame received interrupt - * is generated. - * - * @param obj pointer to the object to call the member function on - * @param method pointer to the member function to be called - * @param type Which CAN interrupt to attach the member function to (CAN::RxIrq for message received, TxIrq for transmitted or aborted, EwIrq for error warning, DoIrq for data overrun, WuIrq for wake-up, EpIrq for error passive, AlIrq for arbitration lost, BeIrq for bus error) - * @deprecated - * The attach function does not support cv-qualifiers. Replaced by - * attach(callback(obj, method), type). - */ + /** Attach a member function to call whenever a CAN frame received interrupt + * is generated. + * + * @param obj pointer to the object to call the member function on + * @param method pointer to the member function to be called + * @param type Which CAN interrupt to attach the member function to (CAN::RxIrq for message received, TxIrq for transmitted or aborted, EwIrq for error warning, DoIrq for data overrun, WuIrq for wake-up, EpIrq for error passive, AlIrq for arbitration lost, BeIrq for bus error) + * @deprecated + * The attach function does not support cv-qualifiers. Replaced by + * attach(callback(obj, method), type). + */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "The attach function does not support cv-qualifiers. Replaced by " - "attach(callback(obj, method), type).") - void attach(T* obj, void (*method)(T*), IrqType type=RxIrq) { + "The attach function does not support cv-qualifiers. Replaced by " + "attach(callback(obj, method), type).") + void attach(T *obj, void (*method)(T *), IrqType type = RxIrq) + { // Underlying call thread safe attach(callback(obj, method), type); } diff --git a/drivers/DigitalIn.h b/drivers/DigitalIn.h index d35476c296b..1a2af01fa3a 100644 --- a/drivers/DigitalIn.h +++ b/drivers/DigitalIn.h @@ -55,7 +55,8 @@ class DigitalIn { * * @param pin DigitalIn pin to connect to */ - DigitalIn(PinName pin) : gpio() { + DigitalIn(PinName pin) : gpio() + { // No lock needed in the constructor gpio_init_in(&gpio, pin); } @@ -65,7 +66,8 @@ class DigitalIn { * @param pin DigitalIn pin to connect to * @param mode the initial mode of the pin */ - DigitalIn(PinName pin, PinMode mode) : gpio() { + DigitalIn(PinName pin, PinMode mode) : gpio() + { // No lock needed in the constructor gpio_init_in_ex(&gpio, pin, mode); } @@ -75,7 +77,8 @@ class DigitalIn { * An integer representing the state of the input pin, * 0 for logical 0, 1 for logical 1 */ - int read() { + int read() + { // Thread safe / atomic HAL call return gpio_read(&gpio); } @@ -84,7 +87,8 @@ class DigitalIn { * * @param pull PullUp, PullDown, PullNone, OpenDrain */ - void mode(PinMode pull) { + void mode(PinMode pull) + { core_util_critical_section_enter(); gpio_mode(&gpio, pull); core_util_critical_section_exit(); @@ -96,7 +100,8 @@ class DigitalIn { * Non zero value if pin is connected to uc GPIO * 0 if gpio object was initialized with NC */ - int is_connected() { + int is_connected() + { // Thread safe / atomic HAL call return gpio_is_connected(&gpio); } @@ -104,7 +109,8 @@ class DigitalIn { /** An operator shorthand for read() * \sa DigitalIn::read() */ - operator int() { + operator int() + { // Underlying read is thread safe return read(); } diff --git a/drivers/DigitalInOut.h b/drivers/DigitalInOut.h index cc524ff5107..a11fcad2c0f 100644 --- a/drivers/DigitalInOut.h +++ b/drivers/DigitalInOut.h @@ -36,7 +36,8 @@ class DigitalInOut { * * @param pin DigitalInOut pin to connect to */ - DigitalInOut(PinName pin) : gpio() { + DigitalInOut(PinName pin) : gpio() + { // No lock needed in the constructor gpio_init_in(&gpio, pin); } @@ -48,7 +49,8 @@ class DigitalInOut { * @param mode the initial mode of the pin * @param value the initial value of the pin if is an output */ - DigitalInOut(PinName pin, PinDirection direction, PinMode mode, int value) : gpio() { + DigitalInOut(PinName pin, PinDirection direction, PinMode mode, int value) : gpio() + { // No lock needed in the constructor gpio_init_inout(&gpio, pin, direction, mode, value); } @@ -58,7 +60,8 @@ class DigitalInOut { * @param value An integer specifying the pin output value, * 0 for logical 0, 1 (or any other non-zero value) for logical 1 */ - void write(int value) { + void write(int value) + { // Thread safe / atomic HAL call gpio_write(&gpio, value); } @@ -69,14 +72,16 @@ class DigitalInOut { * an integer representing the output setting of the pin if it is an output, * or read the input if set as an input */ - int read() { + int read() + { // Thread safe / atomic HAL call return gpio_read(&gpio); } /** Set as an output */ - void output() { + void output() + { core_util_critical_section_enter(); gpio_dir(&gpio, PIN_OUTPUT); core_util_critical_section_exit(); @@ -84,7 +89,8 @@ class DigitalInOut { /** Set as an input */ - void input() { + void input() + { core_util_critical_section_enter(); gpio_dir(&gpio, PIN_INPUT); core_util_critical_section_exit(); @@ -94,7 +100,8 @@ class DigitalInOut { * * @param pull PullUp, PullDown, PullNone, OpenDrain */ - void mode(PinMode pull) { + void mode(PinMode pull) + { core_util_critical_section_enter(); gpio_mode(&gpio, pull); core_util_critical_section_exit(); @@ -106,7 +113,8 @@ class DigitalInOut { * Non zero value if pin is connected to uc GPIO * 0 if gpio object was initialized with NC */ - int is_connected() { + int is_connected() + { // Thread safe / atomic HAL call return gpio_is_connected(&gpio); } @@ -114,7 +122,8 @@ class DigitalInOut { /** A shorthand for write() * \sa DigitalInOut::write() */ - DigitalInOut& operator= (int value) { + DigitalInOut &operator= (int value) + { // Underlying write is thread safe write(value); return *this; @@ -123,7 +132,8 @@ class DigitalInOut { /** A shorthand for write() * \sa DigitalInOut::write() */ - DigitalInOut& operator= (DigitalInOut& rhs) { + DigitalInOut &operator= (DigitalInOut &rhs) + { core_util_critical_section_enter(); write(rhs.read()); core_util_critical_section_exit(); @@ -133,7 +143,8 @@ class DigitalInOut { /** A shorthand for read() * \sa DigitalInOut::read() */ - operator int() { + operator int() + { // Underlying call is thread safe return read(); } diff --git a/drivers/DigitalOut.h b/drivers/DigitalOut.h index 06c57359e00..fb6d1be6c2d 100644 --- a/drivers/DigitalOut.h +++ b/drivers/DigitalOut.h @@ -50,7 +50,8 @@ class DigitalOut { * * @param pin DigitalOut pin to connect to */ - DigitalOut(PinName pin) : gpio() { + DigitalOut(PinName pin) : gpio() + { // No lock needed in the constructor gpio_init_out(&gpio, pin); } @@ -60,7 +61,8 @@ class DigitalOut { * @param pin DigitalOut pin to connect to * @param value the initial pin value */ - DigitalOut(PinName pin, int value) : gpio() { + DigitalOut(PinName pin, int value) : gpio() + { // No lock needed in the constructor gpio_init_out_ex(&gpio, pin, value); } @@ -70,7 +72,8 @@ class DigitalOut { * @param value An integer specifying the pin output value, * 0 for logical 0, 1 (or any other non-zero value) for logical 1 */ - void write(int value) { + void write(int value) + { // Thread safe / atomic HAL call gpio_write(&gpio, value); } @@ -81,7 +84,8 @@ class DigitalOut { * an integer representing the output setting of the pin, * 0 for logical 0, 1 for logical 1 */ - int read() { + int read() + { // Thread safe / atomic HAL call return gpio_read(&gpio); } @@ -92,7 +96,8 @@ class DigitalOut { * Non zero value if pin is connected to uc GPIO * 0 if gpio object was initialized with NC */ - int is_connected() { + int is_connected() + { // Thread safe / atomic HAL call return gpio_is_connected(&gpio); } @@ -100,7 +105,8 @@ class DigitalOut { /** A shorthand for write() * \sa DigitalOut::write() */ - DigitalOut& operator= (int value) { + DigitalOut &operator= (int value) + { // Underlying write is thread safe write(value); return *this; @@ -109,7 +115,8 @@ class DigitalOut { /** A shorthand for write() * \sa DigitalOut::write() */ - DigitalOut& operator= (DigitalOut& rhs) { + DigitalOut &operator= (DigitalOut &rhs) + { core_util_critical_section_enter(); write(rhs.read()); core_util_critical_section_exit(); @@ -119,7 +126,8 @@ class DigitalOut { /** A shorthand for read() * \sa DigitalOut::read() */ - operator int() { + operator int() + { // Underlying call is thread safe return read(); } diff --git a/drivers/Ethernet.cpp b/drivers/Ethernet.cpp index c275f4a99bf..6b0a2bfab6f 100644 --- a/drivers/Ethernet.cpp +++ b/drivers/Ethernet.cpp @@ -21,48 +21,72 @@ namespace mbed { -Ethernet::Ethernet() { +Ethernet::Ethernet() +{ ethernet_init(); } -Ethernet::~Ethernet() { +Ethernet::~Ethernet() +{ ethernet_free(); } -int Ethernet::write(const char *data, int size) { +int Ethernet::write(const char *data, int size) +{ return ethernet_write(data, size); } -int Ethernet::send() { +int Ethernet::send() +{ return ethernet_send(); } -int Ethernet::receive() { +int Ethernet::receive() +{ return ethernet_receive(); } -int Ethernet::read(char *data, int size) { +int Ethernet::read(char *data, int size) +{ return ethernet_read(data, size); } -void Ethernet::address(char *mac) { +void Ethernet::address(char *mac) +{ return ethernet_address(mac); } -int Ethernet::link() { +int Ethernet::link() +{ return ethernet_link(); } -void Ethernet::set_link(Mode mode) { +void Ethernet::set_link(Mode mode) +{ int speed = -1; int duplex = 0; - switch(mode) { - case AutoNegotiate : speed = -1; duplex = 0; break; - case HalfDuplex10 : speed = 0; duplex = 0; break; - case FullDuplex10 : speed = 0; duplex = 1; break; - case HalfDuplex100 : speed = 1; duplex = 0; break; - case FullDuplex100 : speed = 1; duplex = 1; break; + switch (mode) { + case AutoNegotiate : + speed = -1; + duplex = 0; + break; + case HalfDuplex10 : + speed = 0; + duplex = 0; + break; + case FullDuplex10 : + speed = 0; + duplex = 1; + break; + case HalfDuplex100 : + speed = 1; + duplex = 0; + break; + case FullDuplex100 : + speed = 1; + duplex = 1; + break; } ethernet_set_link(speed, duplex); diff --git a/drivers/FlashIAP.cpp b/drivers/FlashIAP.cpp index 3c2009ef96b..8f710614722 100644 --- a/drivers/FlashIAP.cpp +++ b/drivers/FlashIAP.cpp @@ -99,7 +99,7 @@ int FlashIAP::program(const void *buffer, uint32_t addr, uint32_t size) // addr should be aligned to page size if (!is_aligned(addr, page_size) || (!buffer) || - ((addr + size) > (flash_start_addr + flash_size))) { + ((addr + size) > (flash_start_addr + flash_size))) { return -1; } @@ -143,7 +143,7 @@ bool FlashIAP::is_aligned_to_sector(uint32_t addr, uint32_t size) { uint32_t current_sector_size = flash_get_sector_size(&_flash, addr); if (!is_aligned(size, current_sector_size) || - !is_aligned(addr, current_sector_size)) { + !is_aligned(addr, current_sector_size)) { return false; } else { return true; @@ -160,7 +160,7 @@ int FlashIAP::erase(uint32_t addr, uint32_t size) if (erase_end_addr > flash_end_addr) { return -1; - } else if (erase_end_addr < flash_end_addr){ + } else if (erase_end_addr < flash_end_addr) { uint32_t following_sector_size = flash_get_sector_size(&_flash, erase_end_addr); if (!is_aligned(erase_end_addr, following_sector_size)) { return -1; diff --git a/drivers/FlashIAP.h b/drivers/FlashIAP.h index a818410c550..92a93996768 100644 --- a/drivers/FlashIAP.h +++ b/drivers/FlashIAP.h @@ -56,7 +56,7 @@ class FlashIAP : private NonCopyable { */ int deinit(); - /** Read data from a flash device. + /** Read data from a flash device. * * This method invokes memcpy - reads number of bytes from the address * @@ -90,7 +90,7 @@ class FlashIAP : private NonCopyable { /** Get the sector size at the defined address * - * Sector size might differ at address ranges. + * Sector size might differ at address ranges. * An example <0-0x1000, sector size=1024; 0x10000-0x20000, size=2048> * * @param addr Address of or inside the sector to query @@ -98,15 +98,15 @@ class FlashIAP : private NonCopyable { */ uint32_t get_sector_size(uint32_t addr) const; - /** Get the flash start address + /** Get the flash start address * - * @return Flash start address + * @return Flash start address */ uint32_t get_flash_start() const; /** Get the flash size * - * @return Flash size + * @return Flash size */ uint32_t get_flash_size() const; diff --git a/drivers/I2C.cpp b/drivers/I2C.cpp index 148d48ee38d..08d8d2320f9 100644 --- a/drivers/I2C.cpp +++ b/drivers/I2C.cpp @@ -41,7 +41,8 @@ I2C::I2C(PinName sda, PinName scl) : _owner = this; } -void I2C::frequency(int hz) { +void I2C::frequency(int hz) +{ lock(); _hz = hz; @@ -53,7 +54,8 @@ void I2C::frequency(int hz) { unlock(); } -void I2C::aquire() { +void I2C::aquire() +{ lock(); if (_owner != this) { i2c_frequency(&_i2c, _hz); @@ -63,7 +65,8 @@ void I2C::aquire() { } // write - Master Transmitter Mode -int I2C::write(int address, const char* data, int length, bool repeated) { +int I2C::write(int address, const char *data, int length, bool repeated) +{ lock(); aquire(); @@ -74,7 +77,8 @@ int I2C::write(int address, const char* data, int length, bool repeated) { return length != written; } -int I2C::write(int data) { +int I2C::write(int data) +{ lock(); int ret = i2c_byte_write(&_i2c, data); unlock(); @@ -82,7 +86,8 @@ int I2C::write(int data) { } // read - Master Receiver Mode -int I2C::read(int address, char* data, int length, bool repeated) { +int I2C::read(int address, char *data, int length, bool repeated) +{ lock(); aquire(); @@ -93,7 +98,8 @@ int I2C::read(int address, char* data, int length, bool repeated) { return length != read; } -int I2C::read(int ack) { +int I2C::read(int ack) +{ lock(); int ret; if (ack) { @@ -105,29 +111,33 @@ int I2C::read(int ack) { return ret; } -void I2C::start(void) { +void I2C::start(void) +{ lock(); i2c_start(&_i2c); unlock(); } -void I2C::stop(void) { +void I2C::stop(void) +{ lock(); i2c_stop(&_i2c); unlock(); } -void I2C::lock() { +void I2C::lock() +{ _mutex->lock(); } -void I2C::unlock() { +void I2C::unlock() +{ _mutex->unlock(); } #if DEVICE_I2C_ASYNCH -int I2C::transfer(int address, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t& callback, int event, bool repeated) +int I2C::transfer(int address, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t &callback, int event, bool repeated) { lock(); if (i2c_active(&_i2c)) { diff --git a/drivers/I2C.h b/drivers/I2C.h index a4b0598d299..13f43186d60 100644 --- a/drivers/I2C.h +++ b/drivers/I2C.h @@ -151,7 +151,8 @@ class I2C : private NonCopyable { */ virtual void unlock(void); - virtual ~I2C() { + virtual ~I2C() + { // Do nothing } @@ -160,7 +161,7 @@ class I2C : private NonCopyable { /** Start non-blocking I2C transfer. * * This function locks the deep sleep until any event has occurred - * + * * @param address 8/10 bit I2C slave address * @param tx_buffer The TX buffer with data to be transfered * @param tx_length The length of TX buffer in bytes @@ -171,13 +172,13 @@ class I2C : private NonCopyable { * @param repeated Repeated start, true - do not send stop at end * @return Zero if the transfer has started, or -1 if I2C peripheral is busy */ - int transfer(int address, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t& callback, int event = I2C_EVENT_TRANSFER_COMPLETE, bool repeated = false); + int transfer(int address, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t &callback, int event = I2C_EVENT_TRANSFER_COMPLETE, bool repeated = false); /** Abort the on-going I2C transfer */ void abort_transfer(); - protected: +protected: /** Lock deep sleep only if it is not yet locked */ void lock_deep_sleep(); diff --git a/drivers/I2CSlave.cpp b/drivers/I2CSlave.cpp index f168c2a6c74..b29b4e74e24 100644 --- a/drivers/I2CSlave.cpp +++ b/drivers/I2CSlave.cpp @@ -19,42 +19,51 @@ namespace mbed { -I2CSlave::I2CSlave(PinName sda, PinName scl) : _i2c() { +I2CSlave::I2CSlave(PinName sda, PinName scl) : _i2c() +{ i2c_init(&_i2c, sda, scl); i2c_frequency(&_i2c, 100000); i2c_slave_mode(&_i2c, 1); } -void I2CSlave::frequency(int hz) { +void I2CSlave::frequency(int hz) +{ i2c_frequency(&_i2c, hz); } -void I2CSlave::address(int address) { +void I2CSlave::address(int address) +{ int addr = (address & 0xFF) | 1; i2c_slave_address(&_i2c, 0, addr, 0); } -int I2CSlave::receive(void) { +int I2CSlave::receive(void) +{ return i2c_slave_receive(&_i2c); } -int I2CSlave::read(char *data, int length) { +int I2CSlave::read(char *data, int length) +{ return i2c_slave_read(&_i2c, data, length) != length; } -int I2CSlave::read(void) { +int I2CSlave::read(void) +{ return i2c_byte_read(&_i2c, 0); } -int I2CSlave::write(const char *data, int length) { +int I2CSlave::write(const char *data, int length) +{ return i2c_slave_write(&_i2c, data, length) != length; } -int I2CSlave::write(int data) { +int I2CSlave::write(int data) +{ return i2c_byte_write(&_i2c, data); } -void I2CSlave::stop(void) { +void I2CSlave::stop(void) +{ i2c_stop(&_i2c); } diff --git a/drivers/InterruptIn.cpp b/drivers/InterruptIn.cpp index 28f90419ad4..51d947f7a35 100644 --- a/drivers/InterruptIn.cpp +++ b/drivers/InterruptIn.cpp @@ -24,45 +24,52 @@ namespace mbed { // If not for that, we could simplify by having only the 2-param // constructor, with a default value for the PinMode. InterruptIn::InterruptIn(PinName pin) : gpio(), - gpio_irq(), - _rise(NULL), - _fall(NULL) { + gpio_irq(), + _rise(NULL), + _fall(NULL) +{ // No lock needed in the constructor irq_init(pin); gpio_init_in(&gpio, pin); } InterruptIn::InterruptIn(PinName pin, PinMode mode) : - gpio(), - gpio_irq(), - _rise(NULL), - _fall(NULL) { + gpio(), + gpio_irq(), + _rise(NULL), + _fall(NULL) +{ // No lock needed in the constructor irq_init(pin); gpio_init_in_ex(&gpio, pin, mode); } -void InterruptIn::irq_init(PinName pin) { - gpio_irq_init(&gpio_irq, pin, (&InterruptIn::_irq_handler), (uint32_t)this); +void InterruptIn::irq_init(PinName pin) +{ + gpio_irq_init(&gpio_irq, pin, (&InterruptIn::_irq_handler), (uint32_t)this); } -InterruptIn::~InterruptIn() { +InterruptIn::~InterruptIn() +{ // No lock needed in the destructor gpio_irq_free(&gpio_irq); } -int InterruptIn::read() { +int InterruptIn::read() +{ // Read only return gpio_read(&gpio); } -void InterruptIn::mode(PinMode pull) { +void InterruptIn::mode(PinMode pull) +{ core_util_critical_section_enter(); gpio_mode(&gpio, pull); core_util_critical_section_exit(); } -void InterruptIn::rise(Callback func) { +void InterruptIn::rise(Callback func) +{ core_util_critical_section_enter(); if (func) { _rise = func; @@ -74,7 +81,8 @@ void InterruptIn::rise(Callback func) { core_util_critical_section_exit(); } -void InterruptIn::fall(Callback func) { +void InterruptIn::fall(Callback func) +{ core_util_critical_section_enter(); if (func) { _fall = func; @@ -86,36 +94,41 @@ void InterruptIn::fall(Callback func) { core_util_critical_section_exit(); } -void InterruptIn::_irq_handler(uint32_t id, gpio_irq_event event) { - InterruptIn *handler = (InterruptIn*)id; +void InterruptIn::_irq_handler(uint32_t id, gpio_irq_event event) +{ + InterruptIn *handler = (InterruptIn *)id; switch (event) { - case IRQ_RISE: + case IRQ_RISE: if (handler->_rise) { handler->_rise(); } break; - case IRQ_FALL: + case IRQ_FALL: if (handler->_fall) { - handler->_fall(); + handler->_fall(); } break; - case IRQ_NONE: break; + case IRQ_NONE: + break; } } -void InterruptIn::enable_irq() { +void InterruptIn::enable_irq() +{ core_util_critical_section_enter(); gpio_irq_enable(&gpio_irq); core_util_critical_section_exit(); } -void InterruptIn::disable_irq() { +void InterruptIn::disable_irq() +{ core_util_critical_section_enter(); gpio_irq_disable(&gpio_irq); core_util_critical_section_exit(); } -InterruptIn::operator int() { +InterruptIn::operator int() +{ // Underlying call is atomic return read(); } diff --git a/drivers/InterruptIn.h b/drivers/InterruptIn.h index e226d31993d..ebc8c84fac3 100644 --- a/drivers/InterruptIn.h +++ b/drivers/InterruptIn.h @@ -106,9 +106,10 @@ class InterruptIn : private NonCopyable { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "The rise function does not support cv-qualifiers. Replaced by " - "rise(callback(obj, method)).") - void rise(T *obj, M method) { + "The rise function does not support cv-qualifiers. Replaced by " + "rise(callback(obj, method)).") + void rise(T *obj, M method) + { core_util_critical_section_enter(); rise(callback(obj, method)); core_util_critical_section_exit(); @@ -130,9 +131,10 @@ class InterruptIn : private NonCopyable { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "The fall function does not support cv-qualifiers. Replaced by " - "fall(callback(obj, method)).") - void fall(T *obj, M method) { + "The fall function does not support cv-qualifiers. Replaced by " + "fall(callback(obj, method)).") + void fall(T *obj, M method) + { core_util_critical_section_enter(); fall(callback(obj, method)); core_util_critical_section_exit(); diff --git a/drivers/InterruptManager.cpp b/drivers/InterruptManager.cpp index 9c2b4c2acb8..f557cf43781 100644 --- a/drivers/InterruptManager.cpp +++ b/drivers/InterruptManager.cpp @@ -32,12 +32,13 @@ namespace mbed { typedef void (*pvoidf)(void); -InterruptManager* InterruptManager::_instance = (InterruptManager*)NULL; +InterruptManager *InterruptManager::_instance = (InterruptManager *)NULL; -InterruptManager* InterruptManager::get() { +InterruptManager *InterruptManager::get() +{ if (NULL == _instance) { - InterruptManager* temp = new InterruptManager(); + InterruptManager *temp = new InterruptManager(); // Atomically set _instance core_util_critical_section_enter(); @@ -55,28 +56,33 @@ InterruptManager* InterruptManager::get() { return _instance; } -InterruptManager::InterruptManager() { +InterruptManager::InterruptManager() +{ // No mutex needed in constructor - memset(_chains, 0, NVIC_NUM_VECTORS * sizeof(CallChain*)); + memset(_chains, 0, NVIC_NUM_VECTORS * sizeof(CallChain *)); } -void InterruptManager::destroy() { +void InterruptManager::destroy() +{ // Not a good idea to call this unless NO interrupt at all // is under the control of the handler; otherwise, a system crash // is very likely to occur if (NULL != _instance) { delete _instance; - _instance = (InterruptManager*)NULL; + _instance = (InterruptManager *)NULL; } } -InterruptManager::~InterruptManager() { - for(int i = 0; i < NVIC_NUM_VECTORS; i++) - if (NULL != _chains[i]) +InterruptManager::~InterruptManager() +{ + for (int i = 0; i < NVIC_NUM_VECTORS; i++) + if (NULL != _chains[i]) { delete _chains[i]; + } } -bool InterruptManager::must_replace_vector(IRQn_Type irq) { +bool InterruptManager::must_replace_vector(IRQn_Type irq) +{ lock(); int ret = false; @@ -90,19 +96,22 @@ bool InterruptManager::must_replace_vector(IRQn_Type irq) { return ret; } -pFunctionPointer_t InterruptManager::add_common(void (*function)(void), IRQn_Type irq, bool front) { +pFunctionPointer_t InterruptManager::add_common(void (*function)(void), IRQn_Type irq, bool front) +{ lock(); int irq_pos = get_irq_index(irq); bool change = must_replace_vector(irq); pFunctionPointer_t pf = front ? _chains[irq_pos]->add_front(function) : _chains[irq_pos]->add(function); - if (change) + if (change) { NVIC_SetVector(irq, (uint32_t)&InterruptManager::static_irq_helper); + } unlock(); return pf; } -bool InterruptManager::remove_handler(pFunctionPointer_t handler, IRQn_Type irq) { +bool InterruptManager::remove_handler(pFunctionPointer_t handler, IRQn_Type irq) +{ int irq_pos = get_irq_index(irq); bool ret = false; @@ -117,24 +126,29 @@ bool InterruptManager::remove_handler(pFunctionPointer_t handler, IRQn_Type irq) return ret; } -void InterruptManager::irq_helper() { +void InterruptManager::irq_helper() +{ _chains[__get_IPSR()]->call(); } -int InterruptManager::get_irq_index(IRQn_Type irq) { +int InterruptManager::get_irq_index(IRQn_Type irq) +{ // Pure function - no lock needed return (int)irq + NVIC_USER_IRQ_OFFSET; } -void InterruptManager::static_irq_helper() { +void InterruptManager::static_irq_helper() +{ InterruptManager::get()->irq_helper(); } -void InterruptManager::lock() { +void InterruptManager::lock() +{ _mutex.lock(); } -void InterruptManager::unlock() { +void InterruptManager::unlock() +{ _mutex.unlock(); } diff --git a/drivers/InterruptManager.h b/drivers/InterruptManager.h index b787c4bda76..c65fb683e8f 100644 --- a/drivers/InterruptManager.h +++ b/drivers/InterruptManager.h @@ -58,26 +58,26 @@ namespace mbed { class InterruptManager : private NonCopyable { public: /** Get the instance of InterruptManager Class - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @return the only instance of this class */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") - static InterruptManager* get(); + "public API of mbed-os and is being removed in the future.") + static InterruptManager *get(); /** Destroy the current instance of the interrupt manager - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") static void destroy(); /** Add a handler for an interrupt at the end of the handler list - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @param function the handler to add @@ -87,14 +87,15 @@ class InterruptManager : private NonCopyable { * The function object created for 'function' */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") - pFunctionPointer_t add_handler(void (*function)(void), IRQn_Type irq) { + "public API of mbed-os and is being removed in the future.") + pFunctionPointer_t add_handler(void (*function)(void), IRQn_Type irq) + { // Underlying call is thread safe return add_common(function, irq); } /** Add a handler for an interrupt at the beginning of the handler list - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @param function the handler to add @@ -104,14 +105,15 @@ class InterruptManager : private NonCopyable { * The function object created for 'function' */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") - pFunctionPointer_t add_handler_front(void (*function)(void), IRQn_Type irq) { + "public API of mbed-os and is being removed in the future.") + pFunctionPointer_t add_handler_front(void (*function)(void), IRQn_Type irq) + { // Underlying call is thread safe return add_common(function, irq, true); } /** Add a handler for an interrupt at the end of the handler list - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @param tptr pointer to the object that has the handler function @@ -123,14 +125,15 @@ class InterruptManager : private NonCopyable { */ template MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") - pFunctionPointer_t add_handler(T* tptr, void (T::*mptr)(void), IRQn_Type irq) { + "public API of mbed-os and is being removed in the future.") + pFunctionPointer_t add_handler(T *tptr, void (T::*mptr)(void), IRQn_Type irq) + { // Underlying call is thread safe return add_common(tptr, mptr, irq); } /** Add a handler for an interrupt at the beginning of the handler list - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @param tptr pointer to the object that has the handler function @@ -142,14 +145,15 @@ class InterruptManager : private NonCopyable { */ template MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") - pFunctionPointer_t add_handler_front(T* tptr, void (T::*mptr)(void), IRQn_Type irq) { + "public API of mbed-os and is being removed in the future.") + pFunctionPointer_t add_handler_front(T *tptr, void (T::*mptr)(void), IRQn_Type irq) + { // Underlying call is thread safe return add_common(tptr, mptr, irq, true); } /** Remove a handler from an interrupt - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @param handler the function object for the handler to remove @@ -159,7 +163,7 @@ class InterruptManager : private NonCopyable { * true if the handler was found and removed, false otherwise */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") bool remove_handler(pFunctionPointer_t handler, IRQn_Type irq); private: @@ -170,27 +174,29 @@ class InterruptManager : private NonCopyable { void unlock(); template - pFunctionPointer_t add_common(T *tptr, void (T::*mptr)(void), IRQn_Type irq, bool front=false) { + pFunctionPointer_t add_common(T *tptr, void (T::*mptr)(void), IRQn_Type irq, bool front = false) + { _mutex.lock(); int irq_pos = get_irq_index(irq); bool change = must_replace_vector(irq); pFunctionPointer_t pf = front ? _chains[irq_pos]->add_front(tptr, mptr) : _chains[irq_pos]->add(tptr, mptr); - if (change) + if (change) { NVIC_SetVector(irq, (uint32_t)&InterruptManager::static_irq_helper); + } _mutex.unlock(); return pf; } - pFunctionPointer_t add_common(void (*function)(void), IRQn_Type irq, bool front=false); + pFunctionPointer_t add_common(void (*function)(void), IRQn_Type irq, bool front = false); bool must_replace_vector(IRQn_Type irq); int get_irq_index(IRQn_Type irq); void irq_helper(); - void add_helper(void (*function)(void), IRQn_Type irq, bool front=false); + void add_helper(void (*function)(void), IRQn_Type irq, bool front = false); static void static_irq_helper(); - CallChain* _chains[NVIC_NUM_VECTORS]; - static InterruptManager* _instance; + CallChain *_chains[NVIC_NUM_VECTORS]; + static InterruptManager *_instance; PlatformMutex _mutex; }; diff --git a/drivers/LowPowerTicker.h b/drivers/LowPowerTicker.h index 9a4caf82180..a77307e68bc 100644 --- a/drivers/LowPowerTicker.h +++ b/drivers/LowPowerTicker.h @@ -35,10 +35,12 @@ namespace mbed { class LowPowerTicker : public Ticker, private NonCopyable { public: - LowPowerTicker() : Ticker(get_lp_ticker_data()) { + LowPowerTicker() : Ticker(get_lp_ticker_data()) + { } - virtual ~LowPowerTicker() { + virtual ~LowPowerTicker() + { } }; diff --git a/drivers/LowPowerTimeout.h b/drivers/LowPowerTimeout.h index ef96006738d..7c9d00e3844 100644 --- a/drivers/LowPowerTimeout.h +++ b/drivers/LowPowerTimeout.h @@ -35,7 +35,8 @@ namespace mbed { class LowPowerTimeout : public LowPowerTicker, private NonCopyable { private: - virtual void handler(void) { + virtual void handler(void) + { _function.call(); } }; diff --git a/drivers/LowPowerTimer.h b/drivers/LowPowerTimer.h index 20959d6721d..19bb8fdc3ef 100644 --- a/drivers/LowPowerTimer.h +++ b/drivers/LowPowerTimer.h @@ -35,7 +35,8 @@ namespace mbed { class LowPowerTimer : public Timer, private NonCopyable { public: - LowPowerTimer() : Timer(get_lp_ticker_data()) { + LowPowerTimer() : Timer(get_lp_ticker_data()) + { } }; diff --git a/drivers/MbedCRC.cpp b/drivers/MbedCRC.cpp index bece2e2366d..cc90945ac09 100644 --- a/drivers/MbedCRC.cpp +++ b/drivers/MbedCRC.cpp @@ -26,40 +26,40 @@ namespace mbed { */ template<> MbedCRC::MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder): - _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), - _crc_table((uint32_t *)Table_CRC_32bit_ANSI) + _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), + _crc_table((uint32_t *)Table_CRC_32bit_ANSI) { mbed_crc_ctor(); } template<> MbedCRC::MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder): - _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), - _crc_table((uint32_t *)Table_CRC_8bit_CCITT) + _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), + _crc_table((uint32_t *)Table_CRC_8bit_CCITT) { mbed_crc_ctor(); } template<> MbedCRC::MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder): - _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), - _crc_table((uint32_t *)Table_CRC_7Bit_SD) + _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), + _crc_table((uint32_t *)Table_CRC_7Bit_SD) { mbed_crc_ctor(); } template<> MbedCRC::MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder): - _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), - _crc_table((uint32_t *)Table_CRC_16bit_CCITT) + _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), + _crc_table((uint32_t *)Table_CRC_16bit_CCITT) { mbed_crc_ctor(); } template<> MbedCRC::MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder): - _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), - _crc_table((uint32_t *)Table_CRC_16bit_IBM) + _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), _reflect_remainder(reflect_remainder), + _crc_table((uint32_t *)Table_CRC_16bit_IBM) { mbed_crc_ctor(); } diff --git a/drivers/MbedCRC.h b/drivers/MbedCRC.h index 3c37fba85b5..1221c4fe0bc 100644 --- a/drivers/MbedCRC.h +++ b/drivers/MbedCRC.h @@ -92,9 +92,8 @@ namespace mbed { * @ingroup drivers */ -template -class MbedCRC -{ +template +class MbedCRC { public: enum CrcMode { HARDWARE = 0, TABLE, BITWISE }; @@ -107,7 +106,7 @@ class MbedCRC * @param final_xor Final Xor value * @param reflect_data * @param reflect_remainder -* @note Default constructor without any arguments is valid only for supported CRC polynomials. :: crc_polynomial_t + * @note Default constructor without any arguments is valid only for supported CRC polynomials. :: crc_polynomial_t * MbedCRC ct; --- Valid POLY_7BIT_SD * MbedCRC <0x1021, 16> ct; --- Valid POLY_16BIT_CCITT * MbedCRC ct; --- Invalid, compilation error @@ -117,8 +116,8 @@ class MbedCRC * */ MbedCRC(uint32_t initial_xor, uint32_t final_xor, bool reflect_data, bool reflect_remainder) : - _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), - _reflect_remainder(reflect_remainder), _crc_table(NULL) + _initial_value(initial_xor), _final_xor(final_xor), _reflect_data(reflect_data), + _reflect_remainder(reflect_remainder), _crc_table(NULL) { mbed_crc_ctor(); } @@ -170,8 +169,7 @@ class MbedCRC */ int32_t compute_partial(void *buffer, crc_data_size_t size, uint32_t *crc) { - switch (_mode) - { + switch (_mode) { case HARDWARE: #ifdef DEVICE_CRC hal_crc_compute_partial((uint8_t *)buffer, size); @@ -332,7 +330,7 @@ class MbedCRC */ uint32_t reflect_bytes(uint32_t data) const { - if(_reflect_data) { + if (_reflect_data) { uint32_t reflection = 0x0; for (uint8_t bit = 0; bit < 8; ++bit) { @@ -368,7 +366,7 @@ class MbedCRC data_byte = reflect_bytes(data[byte]); for (uint8_t bit = 8; bit > 0; --bit) { p_crc <<= 1; - if (( data_byte ^ p_crc) & get_top_bit()) { + if ((data_byte ^ p_crc) & get_top_bit()) { p_crc ^= polynomial; } data_byte <<= 1; @@ -392,13 +390,13 @@ class MbedCRC return 0; } - /** CRC computation using ROM tables - * - * @param buffer data buffer - * @param size size of the data - * @param crc CRC value is filled in, but the value is not the final - * @return 0 on success or a negative error code on failure - */ + /** CRC computation using ROM tables + * + * @param buffer data buffer + * @param size size of the data + * @param crc CRC value is filled in, but the value is not the final + * @return 0 on success or a negative error code on failure + */ int32_t table_compute_partial(const void *buffer, crc_data_size_t size, uint32_t *crc) const { MBED_ASSERT(crc != NULL); diff --git a/drivers/PortIn.h b/drivers/PortIn.h index 2796916fe25..62e48e1c19e 100644 --- a/drivers/PortIn.h +++ b/drivers/PortIn.h @@ -60,7 +60,8 @@ class PortIn { * @param port Port to connect to (Port0-Port5) * @param mask A bitmask to identify which bits in the port should be included (0 - ignore) */ - PortIn(PortName port, int mask = 0xFFFFFFFF) { + PortIn(PortName port, int mask = 0xFFFFFFFF) + { core_util_critical_section_enter(); port_init(&_port, port, mask, PIN_INPUT); core_util_critical_section_exit(); @@ -71,7 +72,8 @@ class PortIn { * @returns * An integer with each bit corresponding to associated port pin setting */ - int read() { + int read() + { return port_read(&_port); } @@ -79,7 +81,8 @@ class PortIn { * * @param mode PullUp, PullDown, PullNone, OpenDrain */ - void mode(PinMode mode) { + void mode(PinMode mode) + { core_util_critical_section_enter(); port_mode(&_port, mode); core_util_critical_section_exit(); @@ -87,7 +90,8 @@ class PortIn { /** A shorthand for read() */ - operator int() { + operator int() + { return read(); } diff --git a/drivers/PortInOut.h b/drivers/PortInOut.h index 4eb9ecb7292..00c972c2a0f 100644 --- a/drivers/PortInOut.h +++ b/drivers/PortInOut.h @@ -39,7 +39,8 @@ class PortInOut { * @param port Port to connect to (Port0-Port5) * @param mask A bitmask to identify which bits in the port should be included (0 - ignore) */ - PortInOut(PortName port, int mask = 0xFFFFFFFF) { + PortInOut(PortName port, int mask = 0xFFFFFFFF) + { core_util_critical_section_enter(); port_init(&_port, port, mask, PIN_INPUT); core_util_critical_section_exit(); @@ -49,7 +50,8 @@ class PortInOut { * * @param value An integer specifying a bit to write for every corresponding port pin */ - void write(int value) { + void write(int value) + { port_write(&_port, value); } @@ -58,13 +60,15 @@ class PortInOut { * @returns * An integer with each bit corresponding to associated port pin setting */ - int read() { + int read() + { return port_read(&_port); } /** Set as an output */ - void output() { + void output() + { core_util_critical_section_enter(); port_dir(&_port, PIN_OUTPUT); core_util_critical_section_exit(); @@ -72,7 +76,8 @@ class PortInOut { /** Set as an input */ - void input() { + void input() + { core_util_critical_section_enter(); port_dir(&_port, PIN_INPUT); core_util_critical_section_exit(); @@ -82,7 +87,8 @@ class PortInOut { * * @param mode PullUp, PullDown, PullNone, OpenDrain */ - void mode(PinMode mode) { + void mode(PinMode mode) + { core_util_critical_section_enter(); port_mode(&_port, mode); core_util_critical_section_exit(); @@ -91,7 +97,8 @@ class PortInOut { /** A shorthand for write() * \sa PortInOut::write() */ - PortInOut& operator= (int value) { + PortInOut &operator= (int value) + { write(value); return *this; } @@ -99,7 +106,8 @@ class PortInOut { /** A shorthand for write() * \sa PortInOut::write() */ - PortInOut& operator= (PortInOut& rhs) { + PortInOut &operator= (PortInOut &rhs) + { write(rhs.read()); return *this; } @@ -107,7 +115,8 @@ class PortInOut { /** A shorthand for read() * \sa PortInOut::read() */ - operator int() { + operator int() + { return read(); } diff --git a/drivers/PortOut.h b/drivers/PortOut.h index 9b8a76b60c3..ccdcc25dbf8 100644 --- a/drivers/PortOut.h +++ b/drivers/PortOut.h @@ -59,7 +59,8 @@ class PortOut { * @param port Port to connect to (Port0-Port5) * @param mask A bitmask to identify which bits in the port should be included (0 - ignore) */ - PortOut(PortName port, int mask = 0xFFFFFFFF) { + PortOut(PortName port, int mask = 0xFFFFFFFF) + { core_util_critical_section_enter(); port_init(&_port, port, mask, PIN_OUTPUT); core_util_critical_section_exit(); @@ -69,7 +70,8 @@ class PortOut { * * @param value An integer specifying a bit to write for every corresponding PortOut pin */ - void write(int value) { + void write(int value) + { port_write(&_port, value); } @@ -78,14 +80,16 @@ class PortOut { * @returns * An integer with each bit corresponding to associated PortOut pin setting */ - int read() { + int read() + { return port_read(&_port); } /** A shorthand for write() * \sa PortOut::write() */ - PortOut& operator= (int value) { + PortOut &operator= (int value) + { write(value); return *this; } @@ -93,7 +97,8 @@ class PortOut { /** A shorthand for read() * \sa PortOut::read() */ - PortOut& operator= (PortOut& rhs) { + PortOut &operator= (PortOut &rhs) + { write(rhs.read()); return *this; } @@ -101,7 +106,8 @@ class PortOut { /** A shorthand for read() * \sa PortOut::read() */ - operator int() { + operator int() + { return read(); } diff --git a/drivers/PwmOut.h b/drivers/PwmOut.h index 5f7bb478ae0..04e0a22618d 100644 --- a/drivers/PwmOut.h +++ b/drivers/PwmOut.h @@ -57,13 +57,15 @@ class PwmOut { * * @param pin PwmOut pin to connect to */ - PwmOut(PinName pin) : _deep_sleep_locked(false) { + PwmOut(PinName pin) : _deep_sleep_locked(false) + { core_util_critical_section_enter(); pwmout_init(&_pwm, pin); core_util_critical_section_exit(); } - ~PwmOut() { + ~PwmOut() + { core_util_critical_section_enter(); unlock_deep_sleep(); core_util_critical_section_exit(); @@ -76,7 +78,8 @@ class PwmOut { * 0.0f (representing on 0%) and 1.0f (representing on 100%). * Values outside this range will be saturated to 0.0f or 1.0f. */ - void write(float value) { + void write(float value) + { core_util_critical_section_enter(); lock_deep_sleep(); pwmout_write(&_pwm, value); @@ -93,7 +96,8 @@ class PwmOut { * @note * This value may not match exactly the value set by a previous write(). */ - float read() { + float read() + { core_util_critical_section_enter(); float val = pwmout_read(&_pwm); core_util_critical_section_exit(); @@ -107,7 +111,8 @@ class PwmOut { * The resolution is currently in microseconds; periods smaller than this * will be set to zero. */ - void period(float seconds) { + void period(float seconds) + { core_util_critical_section_enter(); pwmout_period(&_pwm, seconds); core_util_critical_section_exit(); @@ -116,7 +121,8 @@ class PwmOut { /** Set the PWM period, specified in milli-seconds (int), keeping the duty cycle the same. * @param ms Change the period of a PWM signal in milli-seconds without modifying the duty cycle */ - void period_ms(int ms) { + void period_ms(int ms) + { core_util_critical_section_enter(); pwmout_period_ms(&_pwm, ms); core_util_critical_section_exit(); @@ -125,7 +131,8 @@ class PwmOut { /** Set the PWM period, specified in micro-seconds (int), keeping the duty cycle the same. * @param us Change the period of a PWM signal in micro-seconds without modifying the duty cycle */ - void period_us(int us) { + void period_us(int us) + { core_util_critical_section_enter(); pwmout_period_us(&_pwm, us); core_util_critical_section_exit(); @@ -134,7 +141,8 @@ class PwmOut { /** Set the PWM pulsewidth, specified in seconds (float), keeping the period the same. * @param seconds Change the pulse width of a PWM signal specified in seconds (float) */ - void pulsewidth(float seconds) { + void pulsewidth(float seconds) + { core_util_critical_section_enter(); pwmout_pulsewidth(&_pwm, seconds); core_util_critical_section_exit(); @@ -143,16 +151,18 @@ class PwmOut { /** Set the PWM pulsewidth, specified in milli-seconds (int), keeping the period the same. * @param ms Change the pulse width of a PWM signal specified in milli-seconds */ - void pulsewidth_ms(int ms) { + void pulsewidth_ms(int ms) + { core_util_critical_section_enter(); pwmout_pulsewidth_ms(&_pwm, ms); core_util_critical_section_exit(); } /** Set the PWM pulsewidth, specified in micro-seconds (int), keeping the period the same. - * @param us Change the pulse width of a PWM signal specified in micro-seconds + * @param us Change the pulse width of a PWM signal specified in micro-seconds */ - void pulsewidth_us(int us) { + void pulsewidth_us(int us) + { core_util_critical_section_enter(); pwmout_pulsewidth_us(&_pwm, us); core_util_critical_section_exit(); @@ -161,7 +171,8 @@ class PwmOut { /** A operator shorthand for write() * \sa PwmOut::write() */ - PwmOut& operator= (float value) { + PwmOut &operator= (float value) + { // Underlying call is thread safe write(value); return *this; @@ -169,8 +180,9 @@ class PwmOut { /** A operator shorthand for write() * \sa PwmOut::write() - */ - PwmOut& operator= (PwmOut& rhs) { + */ + PwmOut &operator= (PwmOut &rhs) + { // Underlying call is thread safe write(rhs.read()); return *this; @@ -179,14 +191,16 @@ class PwmOut { /** An operator shorthand for read() * \sa PwmOut::read() */ - operator float() { + operator float() + { // Underlying call is thread safe return read(); } protected: /** Lock deep sleep only if it is not yet locked */ - void lock_deep_sleep() { + void lock_deep_sleep() + { if (_deep_sleep_locked == false) { sleep_manager_lock_deep_sleep(); _deep_sleep_locked = true; @@ -194,7 +208,8 @@ class PwmOut { } /** Unlock deep sleep in case it is locked */ - void unlock_deep_sleep() { + void unlock_deep_sleep() + { if (_deep_sleep_locked == true) { sleep_manager_unlock_deep_sleep(); _deep_sleep_locked = false; diff --git a/drivers/RawSerial.cpp b/drivers/RawSerial.cpp index 639586892ac..2943bd95206 100644 --- a/drivers/RawSerial.cpp +++ b/drivers/RawSerial.cpp @@ -25,28 +25,33 @@ namespace mbed { -RawSerial::RawSerial(PinName tx, PinName rx, int baud) : SerialBase(tx, rx, baud) { +RawSerial::RawSerial(PinName tx, PinName rx, int baud) : SerialBase(tx, rx, baud) +{ // No lock needed in the constructor } -int RawSerial::getc() { +int RawSerial::getc() +{ lock(); int ret = _base_getc(); unlock(); return ret; } -int RawSerial::putc(int c) { +int RawSerial::putc(int c) +{ lock(); int ret = _base_putc(c); unlock(); return ret; } -int RawSerial::puts(const char *str) { +int RawSerial::puts(const char *str) +{ lock(); - while (*str) + while (*str) { putc(*str ++); + } unlock(); return 0; } @@ -55,7 +60,8 @@ int RawSerial::puts(const char *str) { // means we can't call printf() directly, so we use sprintf() instead. // We only call malloc() for the sprintf() buffer if the buffer // length is above a certain threshold, otherwise we use just the stack. -int RawSerial::printf(const char *format, ...) { +int RawSerial::printf(const char *format, ...) +{ lock(); std::va_list arg; va_start(arg, format); @@ -80,13 +86,15 @@ int RawSerial::printf(const char *format, ...) { /** Acquire exclusive access to this serial port */ -void RawSerial::lock() { +void RawSerial::lock() +{ // No lock used - external synchronization required } /** Release exclusive access to this serial port */ -void RawSerial::unlock() { +void RawSerial::unlock() +{ // No lock used - external synchronization required } diff --git a/drivers/SPI.cpp b/drivers/SPI.cpp index cdc11702289..fc52be754d7 100644 --- a/drivers/SPI.cpp +++ b/drivers/SPI.cpp @@ -29,23 +29,25 @@ CircularBuffer, TRANSACTION_QUEUE_SIZE_SPI> SPI::_transaction_b #endif SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel) : - _spi(), + _spi(), #if DEVICE_SPI_ASYNCH - _irq(this), - _usage(DMA_USAGE_NEVER), - _deep_sleep_locked(false), + _irq(this), + _usage(DMA_USAGE_NEVER), + _deep_sleep_locked(false), #endif - _bits(8), - _mode(0), - _hz(1000000), - _write_fill(SPI_FILL_CHAR) { + _bits(8), + _mode(0), + _hz(1000000), + _write_fill(SPI_FILL_CHAR) +{ // No lock needed in the constructor spi_init(&_spi, mosi, miso, sclk, ssel); _acquire(); } -void SPI::format(int bits, int mode) { +void SPI::format(int bits, int mode) +{ lock(); _bits = bits; _mode = mode; @@ -60,7 +62,8 @@ void SPI::format(int bits, int mode) { unlock(); } -void SPI::frequency(int hz) { +void SPI::frequency(int hz) +{ lock(); _hz = hz; // If changing format while you are the owner then just @@ -74,13 +77,14 @@ void SPI::frequency(int hz) { unlock(); } -SPI* SPI::_owner = NULL; +SPI *SPI::_owner = NULL; SingletonPtr SPI::_mutex; // ignore the fact there are multiple physical spis, and always update if it wasn't us last -void SPI::aquire() { +void SPI::aquire() +{ lock(); - if (_owner != this) { + if (_owner != this) { spi_format(&_spi, _bits, _mode, 0); spi_frequency(&_spi, _hz); _owner = this; @@ -89,15 +93,17 @@ void SPI::aquire() { } // Note: Private function with no locking -void SPI::_acquire() { - if (_owner != this) { +void SPI::_acquire() +{ + if (_owner != this) { spi_format(&_spi, _bits, _mode, 0); spi_frequency(&_spi, _hz); _owner = this; } } -int SPI::write(int value) { +int SPI::write(int value) +{ lock(); _acquire(); int ret = spi_master_write(&_spi, value); @@ -105,7 +111,8 @@ int SPI::write(int value) { return ret; } -int SPI::write(const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length) { +int SPI::write(const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length) +{ lock(); _acquire(); int ret = spi_master_block_write(&_spi, tx_buffer, tx_length, rx_buffer, rx_length, _write_fill); @@ -113,15 +120,18 @@ int SPI::write(const char *tx_buffer, int tx_length, char *rx_buffer, int rx_len return ret; } -void SPI::lock() { +void SPI::lock() +{ _mutex->lock(); } -void SPI::unlock() { +void SPI::unlock() +{ _mutex->unlock(); } -void SPI::set_default_write_value(char data) { +void SPI::set_default_write_value(char data) +{ lock(); _write_fill = data; unlock(); @@ -129,7 +139,7 @@ void SPI::set_default_write_value(char data) { #if DEVICE_SPI_ASYNCH -int SPI::transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event) +int SPI::transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event) { if (spi_active(&_spi)) { return queue_transfer(tx_buffer, tx_length, rx_buffer, rx_length, bit_width, callback, event); @@ -170,7 +180,7 @@ int SPI::set_dma_usage(DMAUsage usage) return 0; } -int SPI::queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event) +int SPI::queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event) { #if TRANSACTION_QUEUE_SIZE_SPI transaction_t t; @@ -199,13 +209,13 @@ int SPI::queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, i #endif } -void SPI::start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event) +void SPI::start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event) { lock_deep_sleep(); _acquire(); _callback = callback; _irq.callback(&SPI::irq_handler_asynch); - spi_master_transfer(&_spi, tx_buffer, tx_length, rx_buffer, rx_length, bit_width, _irq.entry(), event , _usage); + spi_master_transfer(&_spi, tx_buffer, tx_length, rx_buffer, rx_length, bit_width, _irq.entry(), event, _usage); } void SPI::lock_deep_sleep() @@ -235,8 +245,8 @@ void SPI::dequeue_transaction() { Transaction t; if (_transaction_buffer.pop(t)) { - SPI* obj = t.get_object(); - transaction_t* data = t.get_transaction(); + SPI *obj = t.get_object(); + transaction_t *data = t.get_transaction(); obj->start_transaction(data); } } diff --git a/drivers/SPI.h b/drivers/SPI.h index 144191902cb..8d24dcc9662 100644 --- a/drivers/SPI.h +++ b/drivers/SPI.h @@ -86,7 +86,7 @@ class SPI : private NonCopyable { * @param sclk SPI Clock pin * @param ssel SPI chip select pin */ - SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel=NC); + SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel = NC); /** Configure the data transmission format * @@ -157,7 +157,7 @@ class SPI : private NonCopyable { /** Start non-blocking SPI transfer using 8bit buffers. * * This function locks the deep sleep until any event has occurred - * + * * @param tx_buffer The TX buffer with data to be transfered. If NULL is passed, * the default SPI value is sent * @param tx_length The length of TX buffer in bytes @@ -169,11 +169,12 @@ class SPI : private NonCopyable { * @return Zero if the transfer has started, or -1 if SPI peripheral is busy */ template - int transfer(const Type *tx_buffer, int tx_length, Type *rx_buffer, int rx_length, const event_callback_t& callback, int event = SPI_EVENT_COMPLETE) { + int transfer(const Type *tx_buffer, int tx_length, Type *rx_buffer, int rx_length, const event_callback_t &callback, int event = SPI_EVENT_COMPLETE) + { if (spi_active(&_spi)) { - return queue_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type)*8, callback, event); + return queue_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type) * 8, callback, event); } - start_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type)*8, callback, event); + start_transfer(tx_buffer, tx_length, rx_buffer, rx_length, sizeof(Type) * 8, callback, event); return 0; } @@ -215,7 +216,7 @@ class SPI : private NonCopyable { * @param event The logical OR of events to modify * @return Zero if the transfer has started or was added to the queue, or -1 if SPI peripheral is busy/buffer is full */ - int transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event); + int transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event); /** * @@ -230,7 +231,7 @@ class SPI : private NonCopyable { * @param event The logical OR of events to modify * @return Zero if a transfer was added to the queue, or -1 if the queue is full */ - int queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event); + int queue_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event); /** Configures a callback, spi peripheral and initiate a new transfer * @@ -244,7 +245,7 @@ class SPI : private NonCopyable { * @param callback The event callback function * @param event The logical OR of events to modify */ - void start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t& callback, int event); + void start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event); private: /** Lock deep sleep only if it is not yet locked */ @@ -272,7 +273,8 @@ class SPI : private NonCopyable { #endif public: - virtual ~SPI() { + virtual ~SPI() + { } protected: diff --git a/drivers/SPISlave.cpp b/drivers/SPISlave.cpp index 8ae263e5d86..1f826bb3433 100644 --- a/drivers/SPISlave.cpp +++ b/drivers/SPISlave.cpp @@ -24,32 +24,37 @@ SPISlave::SPISlave(PinName mosi, PinName miso, PinName sclk, PinName ssel) : _bits(8), _mode(0), _hz(1000000) - { +{ spi_init(&_spi, mosi, miso, sclk, ssel); spi_format(&_spi, _bits, _mode, 1); spi_frequency(&_spi, _hz); } -void SPISlave::format(int bits, int mode) { +void SPISlave::format(int bits, int mode) +{ _bits = bits; _mode = mode; spi_format(&_spi, _bits, _mode, 1); } -void SPISlave::frequency(int hz) { +void SPISlave::frequency(int hz) +{ _hz = hz; spi_frequency(&_spi, _hz); } -int SPISlave::receive(void) { - return(spi_slave_receive(&_spi)); +int SPISlave::receive(void) +{ + return (spi_slave_receive(&_spi)); } -int SPISlave::read(void) { - return(spi_slave_read(&_spi)); +int SPISlave::read(void) +{ + return (spi_slave_read(&_spi)); } -void SPISlave::reply(int value) { +void SPISlave::reply(int value) +{ spi_slave_write(&_spi, value); } diff --git a/drivers/Serial.cpp b/drivers/Serial.cpp index 8e3ce518a53..55e5a38bba5 100644 --- a/drivers/Serial.cpp +++ b/drivers/Serial.cpp @@ -20,27 +20,33 @@ namespace mbed { -Serial::Serial(PinName tx, PinName rx, const char *name, int baud) : SerialBase(tx, rx, baud), Stream(name) { +Serial::Serial(PinName tx, PinName rx, const char *name, int baud) : SerialBase(tx, rx, baud), Stream(name) +{ } -Serial::Serial(PinName tx, PinName rx, int baud): SerialBase(tx, rx, baud), Stream(NULL) { +Serial::Serial(PinName tx, PinName rx, int baud): SerialBase(tx, rx, baud), Stream(NULL) +{ } -int Serial::_getc() { +int Serial::_getc() +{ // Mutex is already held return _base_getc(); } -int Serial::_putc(int c) { +int Serial::_putc(int c) +{ // Mutex is already held return _base_putc(c); } -void Serial::lock() { +void Serial::lock() +{ _mutex.lock(); } -void Serial::unlock() { +void Serial::unlock() +{ _mutex.unlock(); } diff --git a/drivers/Serial.h b/drivers/Serial.h index 549943a47c0..11e237bffa4 100644 --- a/drivers/Serial.h +++ b/drivers/Serial.h @@ -68,7 +68,7 @@ class Serial : public SerialBase, public Stream, private NonCopyable { * @note * Either tx or rx may be specified as NC if unused */ - Serial(PinName tx, PinName rx, const char *name=NULL, int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE); + Serial(PinName tx, PinName rx, const char *name = NULL, int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE); /** Create a Serial port, connected to the specified transmit and receive pins, with the specified baud diff --git a/drivers/SerialBase.cpp b/drivers/SerialBase.cpp index ba5f9db3f25..b3f2399ac3e 100644 --- a/drivers/SerialBase.cpp +++ b/drivers/SerialBase.cpp @@ -24,11 +24,12 @@ namespace mbed { SerialBase::SerialBase(PinName tx, PinName rx, int baud) : #if DEVICE_SERIAL_ASYNCH - _thunk_irq(this), _tx_usage(DMA_USAGE_NEVER), - _rx_usage(DMA_USAGE_NEVER), _tx_callback(NULL), - _rx_callback(NULL), + _thunk_irq(this), _tx_usage(DMA_USAGE_NEVER), + _rx_usage(DMA_USAGE_NEVER), _tx_callback(NULL), + _rx_callback(NULL), #endif - _serial(), _baud(baud) { + _serial(), _baud(baud) +{ // No lock needed in the constructor for (size_t i = 0; i < sizeof _irq / sizeof _irq[0]; i++) { @@ -40,20 +41,23 @@ SerialBase::SerialBase(PinName tx, PinName rx, int baud) : serial_irq_handler(&_serial, SerialBase::_irq_handler, (uint32_t)this); } -void SerialBase::baud(int baudrate) { +void SerialBase::baud(int baudrate) +{ lock(); serial_baud(&_serial, baudrate); _baud = baudrate; unlock(); } -void SerialBase::format(int bits, Parity parity, int stop_bits) { +void SerialBase::format(int bits, Parity parity, int stop_bits) +{ lock(); serial_format(&_serial, bits, (SerialParity)parity, stop_bits); unlock(); } -int SerialBase::readable() { +int SerialBase::readable() +{ lock(); int ret = serial_readable(&_serial); unlock(); @@ -61,14 +65,16 @@ int SerialBase::readable() { } -int SerialBase::writeable() { +int SerialBase::writeable() +{ lock(); int ret = serial_writable(&_serial); unlock(); return ret; } -void SerialBase::attach(Callback func, IrqType type) { +void SerialBase::attach(Callback func, IrqType type) +{ lock(); // Disable interrupts when attaching interrupt handler core_util_critical_section_enter(); @@ -76,14 +82,14 @@ void SerialBase::attach(Callback func, IrqType type) { // lock deep sleep only the first time if (!_irq[type]) { sleep_manager_lock_deep_sleep(); - } + } _irq[type] = func; serial_irq_set(&_serial, (SerialIrq)type, 1); } else { // unlock deep sleep only the first time if (_irq[type]) { sleep_manager_unlock_deep_sleep(); - } + } _irq[type] = NULL; serial_irq_set(&_serial, (SerialIrq)type, 0); } @@ -91,45 +97,51 @@ void SerialBase::attach(Callback func, IrqType type) { unlock(); } -void SerialBase::_irq_handler(uint32_t id, SerialIrq irq_type) { - SerialBase *handler = (SerialBase*)id; +void SerialBase::_irq_handler(uint32_t id, SerialIrq irq_type) +{ + SerialBase *handler = (SerialBase *)id; if (handler->_irq[irq_type]) { handler->_irq[irq_type](); } } -int SerialBase::_base_getc() { +int SerialBase::_base_getc() +{ // Mutex is already held return serial_getc(&_serial); } -int SerialBase::_base_putc(int c) { +int SerialBase::_base_putc(int c) +{ // Mutex is already held serial_putc(&_serial, c); return c; } -void SerialBase::send_break() { +void SerialBase::send_break() +{ lock(); - // Wait for 1.5 frames before clearing the break condition - // This will have different effects on our platforms, but should - // ensure that we keep the break active for at least one frame. - // We consider a full frame (1 start bit + 8 data bits bits + - // 1 parity bit + 2 stop bits = 12 bits) for computation. - // One bit time (in us) = 1000000/_baud - // Twelve bits: 12000000/baud delay - // 1.5 frames: 18000000/baud delay - serial_break_set(&_serial); - wait_us(18000000/_baud); - serial_break_clear(&_serial); - unlock(); + // Wait for 1.5 frames before clearing the break condition + // This will have different effects on our platforms, but should + // ensure that we keep the break active for at least one frame. + // We consider a full frame (1 start bit + 8 data bits bits + + // 1 parity bit + 2 stop bits = 12 bits) for computation. + // One bit time (in us) = 1000000/_baud + // Twelve bits: 12000000/baud delay + // 1.5 frames: 18000000/baud delay + serial_break_set(&_serial); + wait_us(18000000 / _baud); + serial_break_clear(&_serial); + unlock(); } -void SerialBase::lock() { +void SerialBase::lock() +{ // Stub } -void SerialBase:: unlock() { +void SerialBase:: unlock() +{ // Stub } @@ -144,10 +156,11 @@ SerialBase::~SerialBase() } #if DEVICE_SERIAL_FC -void SerialBase::set_flow_control(Flow type, PinName flow1, PinName flow2) { +void SerialBase::set_flow_control(Flow type, PinName flow1, PinName flow2) +{ lock(); FlowControl flow_type = (FlowControl)type; - switch(type) { + switch (type) { case RTS: serial_set_flow_control(&_serial, flow_type, flow1, NC); break; @@ -170,7 +183,7 @@ void SerialBase::set_flow_control(Flow type, PinName flow1, PinName flow2) { #if DEVICE_SERIAL_ASYNCH -int SerialBase::write(const uint8_t *buffer, int length, const event_callback_t& callback, int event) +int SerialBase::write(const uint8_t *buffer, int length, const event_callback_t &callback, int event) { if (serial_tx_active(&_serial)) { return -1; // transaction ongoing @@ -179,7 +192,7 @@ int SerialBase::write(const uint8_t *buffer, int length, const event_callback_t& return 0; } -int SerialBase::write(const uint16_t *buffer, int length, const event_callback_t& callback, int event) +int SerialBase::write(const uint16_t *buffer, int length, const event_callback_t &callback, int event) { if (serial_tx_active(&_serial)) { return -1; // transaction ongoing @@ -188,7 +201,7 @@ int SerialBase::write(const uint16_t *buffer, int length, const event_callback_t return 0; } -void SerialBase::start_write(const void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event) +void SerialBase::start_write(const void *buffer, int buffer_size, char buffer_width, const event_callback_t &callback, int event) { _tx_callback = callback; @@ -235,27 +248,27 @@ int SerialBase::set_dma_usage_rx(DMAUsage usage) return 0; } -int SerialBase::read(uint8_t *buffer, int length, const event_callback_t& callback, int event, unsigned char char_match) +int SerialBase::read(uint8_t *buffer, int length, const event_callback_t &callback, int event, unsigned char char_match) { if (serial_rx_active(&_serial)) { return -1; // transaction ongoing } - start_read((void*)buffer, length, 8, callback, event, char_match); + start_read((void *)buffer, length, 8, callback, event, char_match); return 0; } -int SerialBase::read(uint16_t *buffer, int length, const event_callback_t& callback, int event, unsigned char char_match) +int SerialBase::read(uint16_t *buffer, int length, const event_callback_t &callback, int event, unsigned char char_match) { if (serial_rx_active(&_serial)) { return -1; // transaction ongoing } - start_read((void*)buffer, length, 16, callback, event, char_match); + start_read((void *)buffer, length, 16, callback, event, char_match); return 0; } -void SerialBase::start_read(void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event, unsigned char char_match) +void SerialBase::start_read(void *buffer, int buffer_size, char buffer_width, const event_callback_t &callback, int event, unsigned char char_match) { _rx_callback = callback; _thunk_irq.callback(&SerialBase::interrupt_handler_asynch); diff --git a/drivers/SerialBase.h b/drivers/SerialBase.h index 970cf4d19ce..9fe5ddef25a 100644 --- a/drivers/SerialBase.h +++ b/drivers/SerialBase.h @@ -76,7 +76,7 @@ class SerialBase : private NonCopyable { * @param parity The parity used (SerialBase::None, SerialBase::Odd, SerialBase::Even, SerialBase::Forced1, SerialBase::Forced0; default = SerialBase::None) * @param stop_bits The number of stop bits (1 or 2; default = 1) */ - void format(int bits=8, Parity parity=SerialBase::None, int stop_bits=1); + void format(int bits = 8, Parity parity = SerialBase::None, int stop_bits = 1); /** Determine if there is a character available to read * @@ -99,7 +99,7 @@ class SerialBase : private NonCopyable { * @param func A pointer to a void function, or 0 to set as none * @param type Which serial interrupt to attach the member function to (Seriall::RxIrq for receive, TxIrq for transmit buffer empty) */ - void attach(Callback func, IrqType type=RxIrq); + void attach(Callback func, IrqType type = RxIrq); /** Attach a member function to call whenever a serial interrupt is generated * @@ -112,9 +112,10 @@ class SerialBase : private NonCopyable { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "The attach function does not support cv-qualifiers. Replaced by " - "attach(callback(obj, method), type).") - void attach(T *obj, void (T::*method)(), IrqType type=RxIrq) { + "The attach function does not support cv-qualifiers. Replaced by " + "attach(callback(obj, method), type).") + void attach(T *obj, void (T::*method)(), IrqType type = RxIrq) + { attach(callback(obj, method), type); } @@ -129,9 +130,10 @@ class SerialBase : private NonCopyable { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "The attach function does not support cv-qualifiers. Replaced by " - "attach(callback(obj, method), type).") - void attach(T *obj, void (*method)(T*), IrqType type=RxIrq) { + "The attach function does not support cv-qualifiers. Replaced by " + "attach(callback(obj, method), type).") + void attach(T *obj, void (*method)(T *), IrqType type = RxIrq) + { attach(callback(obj, method), type); } @@ -158,7 +160,7 @@ class SerialBase : private NonCopyable { * @param flow1 the first flow control pin (RTS for RTS or RTSCTS, CTS for CTS) * @param flow2 the second flow control pin (CTS for RTSCTS) */ - void set_flow_control(Flow type, PinName flow1=NC, PinName flow2=NC); + void set_flow_control(Flow type, PinName flow1 = NC, PinName flow2 = NC); #endif static void _irq_handler(uint32_t id, SerialIrq irq_type); @@ -168,24 +170,24 @@ class SerialBase : private NonCopyable { /** Begin asynchronous write using 8bit buffer. The completition invokes registered TX event callback * * This function locks the deep sleep until any event has occurred - * + * * @param buffer The buffer where received data will be stored * @param length The buffer length in bytes * @param callback The event callback function * @param event The logical OR of TX events */ - int write(const uint8_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_TX_COMPLETE); + int write(const uint8_t *buffer, int length, const event_callback_t &callback, int event = SERIAL_EVENT_TX_COMPLETE); /** Begin asynchronous write using 16bit buffer. The completition invokes registered TX event callback * * This function locks the deep sleep until any event has occurred - * + * * @param buffer The buffer where received data will be stored * @param length The buffer length in bytes * @param callback The event callback function * @param event The logical OR of TX events */ - int write(const uint16_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_TX_COMPLETE); + int write(const uint16_t *buffer, int length, const event_callback_t &callback, int event = SERIAL_EVENT_TX_COMPLETE); /** Abort the on-going write transfer */ @@ -194,26 +196,26 @@ class SerialBase : private NonCopyable { /** Begin asynchronous reading using 8bit buffer. The completition invokes registred RX event callback. * * This function locks the deep sleep until any event has occurred - * + * * @param buffer The buffer where received data will be stored * @param length The buffer length in bytes * @param callback The event callback function * @param event The logical OR of RX events * @param char_match The matching character */ - int read(uint8_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_RX_COMPLETE, unsigned char char_match = SERIAL_RESERVED_CHAR_MATCH); + int read(uint8_t *buffer, int length, const event_callback_t &callback, int event = SERIAL_EVENT_RX_COMPLETE, unsigned char char_match = SERIAL_RESERVED_CHAR_MATCH); /** Begin asynchronous reading using 16bit buffer. The completition invokes registred RX event callback. * * This function locks the deep sleep until any event has occurred - * + * * @param buffer The buffer where received data will be stored * @param length The buffer length in bytes * @param callback The event callback function * @param event The logical OR of RX events * @param char_match The matching character */ - int read(uint16_t *buffer, int length, const event_callback_t& callback, int event = SERIAL_EVENT_RX_COMPLETE, unsigned char char_match = SERIAL_RESERVED_CHAR_MATCH); + int read(uint16_t *buffer, int length, const event_callback_t &callback, int event = SERIAL_EVENT_RX_COMPLETE, unsigned char char_match = SERIAL_RESERVED_CHAR_MATCH); /** Abort the on-going read transfer */ @@ -234,8 +236,8 @@ class SerialBase : private NonCopyable { int set_dma_usage_rx(DMAUsage usage); protected: - void start_read(void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event, unsigned char char_match); - void start_write(const void *buffer, int buffer_size, char buffer_width, const event_callback_t& callback, int event); + void start_read(void *buffer, int buffer_size, char buffer_width, const event_callback_t &callback, int event, unsigned char char_match); + void start_write(const void *buffer, int buffer_size, char buffer_width, const event_callback_t &callback, int event); void interrupt_handler_asynch(void); #endif diff --git a/drivers/SerialWireOutput.h b/drivers/SerialWireOutput.h index 39f0c390894..ab3e38f3a19 100644 --- a/drivers/SerialWireOutput.h +++ b/drivers/SerialWireOutput.h @@ -20,7 +20,7 @@ #include "platform/FileHandle.h" namespace mbed { - + class SerialWireOutput : public FileHandle { public: @@ -33,12 +33,8 @@ class SerialWireOutput : public FileHandle { virtual ssize_t write(const void *buffer, size_t size) { - const unsigned char *buf = static_cast(buffer); + mbed_itm_send_block(ITM_PORT_SWO, buffer, size); - /* Send buffer one character at a time over the ITM SWO port */ - for (size_t i = 0; i < size; i++) { - mbed_itm_send(ITM_PORT_SWO, buf[i]); - } return size; } @@ -71,7 +67,7 @@ class SerialWireOutput : public FileHandle { return 0; } }; - + } // namespace mbed #endif diff --git a/drivers/Ticker.cpp b/drivers/Ticker.cpp index c2589c0d808..efa3efb9c00 100644 --- a/drivers/Ticker.cpp +++ b/drivers/Ticker.cpp @@ -22,11 +22,12 @@ namespace mbed { -void Ticker::detach() { +void Ticker::detach() +{ core_util_critical_section_enter(); remove(); // unlocked only if we were attached (we locked it) and this is not low power ticker - if(_function && _lock_deepsleep) { + if (_function && _lock_deepsleep) { sleep_manager_unlock_deep_sleep(); } @@ -34,7 +35,8 @@ void Ticker::detach() { core_util_critical_section_exit(); } -void Ticker::setup(us_timestamp_t t) { +void Ticker::setup(us_timestamp_t t) +{ core_util_critical_section_enter(); remove(); _delay = t; @@ -42,7 +44,8 @@ void Ticker::setup(us_timestamp_t t) { core_util_critical_section_exit(); } -void Ticker::handler() { +void Ticker::handler() +{ insert_absolute(event.timestamp + _delay); if (_function) { _function(); diff --git a/drivers/Ticker.h b/drivers/Ticker.h index 59a24dff436..e8bca7cbe97 100644 --- a/drivers/Ticker.h +++ b/drivers/Ticker.h @@ -66,11 +66,13 @@ namespace mbed { class Ticker : public TimerEvent, private NonCopyable { public: - Ticker() : TimerEvent(), _function(0), _lock_deepsleep(true) { + Ticker() : TimerEvent(), _function(0), _lock_deepsleep(true) + { } // 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) { + Ticker(const ticker_data_t *data) : TimerEvent(data), _function(0), _lock_deepsleep(true) + { #if DEVICE_LPTICKER _lock_deepsleep = (data != get_lp_ticker_data()); #endif @@ -81,7 +83,8 @@ class Ticker : public TimerEvent, private NonCopyable { * @param func pointer to the function to be called * @param t the time between calls in seconds */ - void attach(Callback func, float t) { + void attach(Callback func, float t) + { attach_us(func, t * 1000000.0f); } @@ -96,9 +99,10 @@ class Ticker : public TimerEvent, private NonCopyable { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "The attach function does not support cv-qualifiers. Replaced by " - "attach(callback(obj, method), t).") - void attach(T *obj, M method, float t) { + "The attach function does not support cv-qualifiers. Replaced by " + "attach(callback(obj, method), t).") + void attach(T *obj, M method, float t) + { attach(callback(obj, method), t); } @@ -112,10 +116,11 @@ class Ticker : public TimerEvent, private NonCopyable { * for threads scheduling. * */ - void attach_us(Callback func, us_timestamp_t t) { + void attach_us(Callback func, us_timestamp_t t) + { core_util_critical_section_enter(); // lock only for the initial callback setup and this is not low power ticker - if(!_function && _lock_deepsleep) { + if (!_function && _lock_deepsleep) { sleep_manager_lock_deep_sleep(); } _function = func; @@ -134,13 +139,15 @@ class Ticker : public TimerEvent, private NonCopyable { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "The attach_us function does not support cv-qualifiers. Replaced by " - "attach_us(callback(obj, method), t).") - void attach_us(T *obj, M method, us_timestamp_t t) { + "The attach_us function does not support cv-qualifiers. Replaced by " + "attach_us(callback(obj, method), t).") + void attach_us(T *obj, M method, us_timestamp_t t) + { attach_us(Callback(obj, method), t); } - virtual ~Ticker() { + virtual ~Ticker() + { detach(); } diff --git a/drivers/Timeout.cpp b/drivers/Timeout.cpp index 6fc4a7e69bf..159cc0d4b43 100644 --- a/drivers/Timeout.cpp +++ b/drivers/Timeout.cpp @@ -17,7 +17,8 @@ namespace mbed { -void Timeout::handler() { +void Timeout::handler() +{ Callback local = _function; detach(); local.call(); diff --git a/drivers/Timer.cpp b/drivers/Timer.cpp index b8af5dc3d8d..ccf75f60897 100644 --- a/drivers/Timer.cpp +++ b/drivers/Timer.cpp @@ -21,21 +21,24 @@ namespace mbed { -Timer::Timer() : _running(), _start(), _time(), _ticker_data(get_us_ticker_data()), _lock_deepsleep(true) { +Timer::Timer() : _running(), _start(), _time(), _ticker_data(get_us_ticker_data()), _lock_deepsleep(true) +{ reset(); } -Timer::Timer(const ticker_data_t *data) : _running(), _start(), _time(), _ticker_data(data), _lock_deepsleep(true) { +Timer::Timer(const ticker_data_t *data) : _running(), _start(), _time(), _ticker_data(data), _lock_deepsleep(true) +{ reset(); #if DEVICE_LPTICKER _lock_deepsleep = (data != get_lp_ticker_data()); #endif } -Timer::~Timer() { +Timer::~Timer() +{ core_util_critical_section_enter(); if (_running) { - if(_lock_deepsleep) { + if (_lock_deepsleep) { sleep_manager_unlock_deep_sleep(); } } @@ -43,10 +46,11 @@ Timer::~Timer() { core_util_critical_section_exit(); } -void Timer::start() { +void Timer::start() +{ core_util_critical_section_enter(); if (!_running) { - if(_lock_deepsleep) { + if (_lock_deepsleep) { sleep_manager_lock_deep_sleep(); } _start = ticker_read_us(_ticker_data); @@ -55,11 +59,12 @@ void Timer::start() { core_util_critical_section_exit(); } -void Timer::stop() { +void Timer::stop() +{ core_util_critical_section_enter(); _time += slicetime(); if (_running) { - if(_lock_deepsleep) { + if (_lock_deepsleep) { sleep_manager_unlock_deep_sleep(); } } @@ -67,26 +72,31 @@ void Timer::stop() { core_util_critical_section_exit(); } -int Timer::read_us() { +int Timer::read_us() +{ return read_high_resolution_us(); } -float Timer::read() { +float Timer::read() +{ return (float)read_us() / 1000000.0f; } -int Timer::read_ms() { +int Timer::read_ms() +{ return read_high_resolution_us() / 1000; } -us_timestamp_t Timer::read_high_resolution_us() { +us_timestamp_t Timer::read_high_resolution_us() +{ core_util_critical_section_enter(); us_timestamp_t time = _time + slicetime(); core_util_critical_section_exit(); return time; } -us_timestamp_t Timer::slicetime() { +us_timestamp_t Timer::slicetime() +{ us_timestamp_t ret = 0; core_util_critical_section_enter(); if (_running) { @@ -96,14 +106,16 @@ us_timestamp_t Timer::slicetime() { return ret; } -void Timer::reset() { +void Timer::reset() +{ core_util_critical_section_enter(); _start = ticker_read_us(_ticker_data); _time = 0; core_util_critical_section_exit(); } -Timer::operator float() { +Timer::operator float() +{ return read(); } diff --git a/drivers/TimerEvent.cpp b/drivers/TimerEvent.cpp index d7a7c1c2a44..ddf495f681a 100644 --- a/drivers/TimerEvent.cpp +++ b/drivers/TimerEvent.cpp @@ -22,33 +22,40 @@ namespace mbed { -TimerEvent::TimerEvent() : event(), _ticker_data(get_us_ticker_data()) { +TimerEvent::TimerEvent() : event(), _ticker_data(get_us_ticker_data()) +{ ticker_set_handler(_ticker_data, (&TimerEvent::irq)); } -TimerEvent::TimerEvent(const ticker_data_t *data) : event(), _ticker_data(data) { +TimerEvent::TimerEvent(const ticker_data_t *data) : event(), _ticker_data(data) +{ ticker_set_handler(_ticker_data, (&TimerEvent::irq)); } -void TimerEvent::irq(uint32_t id) { - TimerEvent *timer_event = (TimerEvent*)id; +void TimerEvent::irq(uint32_t id) +{ + TimerEvent *timer_event = (TimerEvent *)id; timer_event->handler(); } -TimerEvent::~TimerEvent() { +TimerEvent::~TimerEvent() +{ remove(); } // insert in to linked list -void TimerEvent::insert(timestamp_t timestamp) { +void TimerEvent::insert(timestamp_t timestamp) +{ ticker_insert_event(_ticker_data, &event, timestamp, (uint32_t)this); } -void TimerEvent::insert_absolute(us_timestamp_t timestamp) { +void TimerEvent::insert_absolute(us_timestamp_t timestamp) +{ ticker_insert_event_us(_ticker_data, &event, timestamp, (uint32_t)this); } -void TimerEvent::remove() { +void TimerEvent::remove() +{ ticker_remove_event(_ticker_data, &event); } diff --git a/drivers/UARTSerial.cpp b/drivers/UARTSerial.cpp index c6fd37efe7c..81a5913c522 100644 --- a/drivers/UARTSerial.cpp +++ b/drivers/UARTSerial.cpp @@ -29,11 +29,11 @@ namespace mbed { UARTSerial::UARTSerial(PinName tx, PinName rx, int baud) : - SerialBase(tx, rx, baud), - _blocking(true), - _tx_irq_enabled(false), - _rx_irq_enabled(true), - _dcd_irq(NULL) + SerialBase(tx, rx, baud), + _blocking(true), + _tx_irq_enabled(false), + _rx_irq_enabled(true), + _dcd_irq(NULL) { /* Attatch IRQ routines to the serial device. */ SerialBase::attach(callback(this, &UARTSerial::rx_irq), RxIrq); @@ -56,7 +56,7 @@ void UARTSerial::set_baud(int baud) void UARTSerial::set_data_carrier_detect(PinName dcd_pin, bool active_high) { - delete _dcd_irq; + delete _dcd_irq; _dcd_irq = NULL; if (dcd_pin != NC) { @@ -121,7 +121,8 @@ int UARTSerial::sync() return 0; } -void UARTSerial::sigio(Callback func) { +void UARTSerial::sigio(Callback func) +{ core_util_critical_section_enter(); _sigio_cb = func; if (_sigio_cb) { @@ -133,7 +134,7 @@ void UARTSerial::sigio(Callback func) { core_util_critical_section_exit(); } -ssize_t UARTSerial::write(const void* buffer, size_t length) +ssize_t UARTSerial::write(const void *buffer, size_t length) { size_t data_written = 0; const char *buf_ptr = static_cast(buffer); @@ -178,10 +179,10 @@ ssize_t UARTSerial::write(const void* buffer, size_t length) api_unlock(); - return data_written != 0 ? (ssize_t) data_written : (ssize_t) -EAGAIN; + return data_written != 0 ? (ssize_t) data_written : (ssize_t) - EAGAIN; } -ssize_t UARTSerial::read(void* buffer, size_t length) +ssize_t UARTSerial::read(void *buffer, size_t length) { size_t data_read = 0; @@ -235,7 +236,8 @@ void UARTSerial::wake() } } -short UARTSerial::poll(short events) const { +short UARTSerial::poll(short events) const +{ short revents = 0; /* Check the Circular Buffer if space available for writing out */ diff --git a/drivers/UARTSerial.h b/drivers/UARTSerial.h index 08c35e14455..c3a110fd653 100644 --- a/drivers/UARTSerial.h +++ b/drivers/UARTSerial.h @@ -42,7 +42,7 @@ namespace mbed { /** \addtogroup drivers */ /** Class providing buffered UART communication functionality using separate circular buffer for send and receive channels - * + * * @ingroup drivers */ @@ -81,7 +81,7 @@ class UARTSerial : private SerialBase, public FileHandle, private NonCopyabletest_ATHandler_read_string(); } +TEST(ATHandler, test_ATHandler_read_hex_string) +{ + unit->test_ATHandler_read_hex_string(); +} + TEST(ATHandler, test_ATHandler_read_int) { unit->test_ATHandler_read_int(); diff --git a/features/cellular/UNITTESTS/at/athandler/test_athandler.cpp b/features/cellular/UNITTESTS/at/athandler/test_athandler.cpp index 6c4751fc0ce..8df92210177 100644 --- a/features/cellular/UNITTESTS/at/athandler/test_athandler.cpp +++ b/features/cellular/UNITTESTS/at/athandler/test_athandler.cpp @@ -469,97 +469,314 @@ void Test_ATHandler::test_ATHandler_read_bytes() { EventQueue que; FileHandle_stub fh1; + filehandle_stub_table = NULL; + filehandle_stub_table_pos = 0; ATHandler at(&fh1, que, 0, ","); uint8_t buf[5]; - CHECK(-1 == at.read_bytes(buf, 25)); - CHECK(-1 == at.read_bytes(buf, 5)); + // TEST EMPTY BUFFER + // Shouldn't read any byte since buffer is empty + CHECK(-1 == at.read_bytes(buf, 1)); + CHECK(NSAPI_ERROR_DEVICE_ERROR == at.get_last_error()); + // Return error due to error set to at handler by the above call on empty buffer + CHECK(-1 == at.read_bytes(buf, 1)); - char table[] = "ssssssssssssssssssssssssssssOK\r\n\0"; - filehandle_stub_table = table; + // TEST DATA IN BUFFER + at.clear_error(); + char table1[] = "1234512345678OK\r\n\0"; + filehandle_stub_table = table1; filehandle_stub_table_pos = 0; mbed_poll_stub::revents_value = POLLIN; - mbed_poll_stub::int_value = strlen(table); - + mbed_poll_stub::int_value = 1;; - at.clear_error(); + // Read 5 bytes CHECK(5 == at.read_bytes(buf, 5)); + CHECK(!memcmp(buf, table1, 5)); + // get_char triggered above should have filled in the whole reading buffer(fill_buffer()) + CHECK(filehandle_stub_table_pos == (strlen(table1) - 1)); + // Read another 8 bytes + CHECK(8 == at.read_bytes(buf, 8) && !memcmp(buf, table1 + 5, 8)); + // Reading more than the 4 bytes left -> ERROR + CHECK(-1 == at.read_bytes(buf, 5)); + CHECK(NSAPI_ERROR_DEVICE_ERROR == at.get_last_error()); } void Test_ATHandler::test_ATHandler_read_string() { EventQueue que; FileHandle_stub fh1; + filehandle_stub_table = NULL; + filehandle_stub_table_pos = 0; ATHandler at(&fh1, que, 0, ","); + // *** EMPTY *** at.clear_error(); - char table[] = "\"s,\"OK\r\n\0"; - filehandle_stub_table = table; + char table1[] = ""; + at.flush(); + filehandle_stub_table = table1; filehandle_stub_table_pos = 0; mbed_poll_stub::revents_value = POLLIN; - mbed_poll_stub::int_value = strlen(table); - - char buf[5]; - uint8_t buf2[5]; + mbed_poll_stub::int_value = 1; + char buf1[1]; + // No _stop_tag set without resp_start + CHECK(-1 == at.read_string(buf1, 1)); + at.clear_error(); + // Set _stop_tag to resp_stop(OKCRLF) at.resp_start(); - at.read_bytes(buf2, 5); - CHECK(-1 == at.read_string(buf, 15)); - at.flush(); + // Device error because buffer is empty + CHECK(NSAPI_ERROR_DEVICE_ERROR == at.get_last_error()); at.clear_error(); + // Device error because empty buffer and attempt to fill_buffer by consume_char('\"') + CHECK(-1 == at.read_string(buf1, 1)); - filehandle_stub_table = table; + // *** 1 BYTE *** + at.clear_error(); + char table2[] = "s\0"; + at.flush(); + filehandle_stub_table = table2; filehandle_stub_table_pos = 0; - + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = 1; + char buf2[1]; + // Set _stop_tag to resp_stop(OKCRLF) at.resp_start(); - at.read_bytes(buf2, 1); - CHECK(1 == at.read_string(buf, 5, true)); - at.flush(); + // Device error because no CRLF and no more data to read + CHECK(NSAPI_ERROR_DEVICE_ERROR == at.get_last_error()); at.clear_error(); + CHECK(0 == at.read_string(buf2, 1)); - char table2[] = "\"s\"OK\r\n\0"; - filehandle_stub_table = table2; + // *** CRLF *** + at.clear_error(); + char table3[] = "\r\ns\r\n\0"; + at.flush(); + filehandle_stub_table = table3; filehandle_stub_table_pos = 0; mbed_poll_stub::revents_value = POLLIN; - mbed_poll_stub::int_value = strlen(table2); + mbed_poll_stub::int_value = 1; + char buf3[1]; + // Set _stop_tag to resp_stop(OKCRLF) + at.resp_start(); + // OK because after CRLF matched there is more data to read ending in CRLF + CHECK(NSAPI_ERROR_OK == at.get_last_error()); + // To read 0 bytes from: s\r\n + CHECK(0 == at.read_string(buf3, 0 + 1/*for NULL*/)); + // To read 1 byte from: s\r\n -> read s + CHECK(1 == at.read_string(buf3, 1 + 1/*for NULL*/)); + // *** Reading more than available in buffer *** + at.clear_error(); + char table4[] = "\"s,\"OK\r\n\0"; + at.flush(); + filehandle_stub_table = table4; + filehandle_stub_table_pos = 0; + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = 1; + char buf4[7]; + uint8_t buf5[5]; + // NO prefix, NO OK, NO ERROR and NO URC match, CRLF found -> return so buffer could be read at.resp_start(); - at.read_bytes(buf2, 1); - CHECK(1 == at.read_string(buf, 5, true)); + // TO read 5 bytes from: "s,"OK\r\n -> read "s,"O + at.read_bytes(buf5, 5); + // K\r\n left to be read -> reading more than 3 + 1(for NULL) -> ERROR + CHECK(-1 == at.read_string(buf4, 4 + 1/*for NULL*/)); + CHECK(NSAPI_ERROR_DEVICE_ERROR == at.get_last_error()); + + // *** Encountering delimiter after reading 1 byte *** + at.clear_error(); at.flush(); + filehandle_stub_table = table4; + filehandle_stub_table_pos = 0; + // NO prefix, NO OK, NO ERROR and NO URC match, CRLF found -> return so buffer could be read + at.resp_start(); + // TO read 1 byte from: "s,"OK\r\n -> read " + at.read_bytes(buf5, 1); + // TO read max 4 from: s,"OK\r\n -> read s and stop on , + CHECK(1 == at.read_string(buf4, 4 + 1/*for NULL*/)); + + // *** Encountering delimiter as first char in buffer *** at.clear_error(); + at.flush(); + filehandle_stub_table = table4; + filehandle_stub_table_pos = 0; + // NO prefix, NO OK, NO ERROR and NO URC match, CRLF found -> return so buffer could be read + at.resp_start(); + // TO read 2 bytes from: "s,"OK\r\n -> read "s + at.read_bytes(buf5, 2); + // TO read max 4 bytes from: ,"OK\r\n -> stop on , + CHECK(0 == at.read_string(buf4, 4 + 1/*for NULL*/)); - char table3[] = "sss\rsss\0"; - filehandle_stub_table = table3; + // *** Read as much as buffer size is without encountering any delimiter " or OKCRLF *** + at.clear_error(); + char table5[] = "\"s\"OK\r\nabcd\0"; + at.flush(); + filehandle_stub_table = table5; filehandle_stub_table_pos = 0; mbed_poll_stub::revents_value = POLLIN; - mbed_poll_stub::int_value = strlen(table); + mbed_poll_stub::int_value = 1; + // NO prefix, NO OK, NO ERROR and NO URC match, CRLF found -> return so buffer could be read + at.resp_start(); + // TO read 1 byte from: "s"OK\r\n -> read " + at.read_bytes(buf5, 1); + // TO read max 1 byte from: s"OK\r\n -> read s + CHECK(1 == at.read_string(buf4, 1 + 1/*for NULL*/)); + + // *** Consume " and run into OKCRLF *** + // TO read max 1 byte from: "OK\r\n -> consume " and find stop tag OKCRLF + CHECK(0 == at.read_string(buf4, 1 + 1/*for NULL*/)); + + // *** Try to read after stop tag was found *** + // stop tag found do not read further + CHECK(-1 == at.read_string(buf4, 1 + 1/*for NULL*/)); + + // *** Try to read after stop tag was found when parameter allows it *** + // stop tag found but flag indicates to read despite stop_tag found + CHECK(4 == at.read_string(buf4, 4 + 1/*for NULL*/, true)); + + // *** Read as much as buffer size is without encountering any delimiter " or OKCRLF *** + at.clear_error(); + char table6[] = "sss\rsss\0"; + at.flush(); + filehandle_stub_table = table6; + filehandle_stub_table_pos = 0; + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = 1; + at.resp_start("s"); + // TO read from: ss\rsss -> read all 6 chars ss\rsss + CHECK(6 == at.read_string(buf4, 6 + 1/*for NULL*/)); + // *** Reading when buffer only has " *** + at.clear_error(); + char table7[] = "s\"\0"; + at.flush(); + filehandle_stub_table = table7; + filehandle_stub_table_pos = 0; + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = 1; at.resp_start("s"); - at.read_string(buf, 5, true); + // TO read from buffer having only " -> consume " -> trying to read when nothing in buffer + CHECK(-1 == at.read_string(buf4, 5)); + CHECK(NSAPI_ERROR_DEVICE_ERROR == at.get_last_error()); + + // *** Reading through partially matching stop tag *** + at.clear_error(); + char table8[] = "\"s\"OK\rabcd\r\n\0"; at.flush(); + filehandle_stub_table = table8; + filehandle_stub_table_pos = 0; + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = 1; + char buf8[9]; + // NO prefix, NO OK, NO ERROR and NO URC match, CRLF found -> return so buffer could be read + at.resp_start(); + // TO read from + CHECK(8 == at.read_string(buf8, 8 + 1/*for NULL*/)); + + // *** Reading through partially matching stop tag *** at.clear_error(); + char table9[] = "\"s\"Oabcd\r\n\0"; + at.flush(); + filehandle_stub_table = table9; + filehandle_stub_table_pos = 0; + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = 1; + char buf9[5]; - char table4[] = "\"s\"\0"; - filehandle_stub_table = table4; + // NO prefix, NO OK, NO ERROR and NO URC match, CRLF found -> return so buffer could be read + at.resp_start(); + // TO read from + CHECK(6 == at.read_string(buf9, 6 + 1/*for NULL*/)); + + // *** CRLF part of the string *** + at.clear_error(); + char table10[] = "\"s\"\r\nOK\r\n\0"; + at.flush(); + filehandle_stub_table = table10; filehandle_stub_table_pos = 0; mbed_poll_stub::revents_value = POLLIN; - mbed_poll_stub::int_value = strlen(table); + mbed_poll_stub::int_value = 1; + char buf10[10]; - at.resp_start("s"); - at.read_string(buf, 5, true); + // NO prefix, NO OK, NO ERROR and NO URC match, CRLF found -> return so buffer could be read + at.resp_start(); + // TO read from + CHECK(3 == at.read_string(buf10, 9 + 1/*for NULL*/)); +} +void Test_ATHandler::test_ATHandler_read_hex_string() +{ + EventQueue que; + FileHandle_stub fh1; filehandle_stub_table = NULL; filehandle_stub_table_pos = 0; - mbed_poll_stub::revents_value = POLLOUT; - mbed_poll_stub::int_value = 0; + + ATHandler at(&fh1, que, 0, ","); + + // *** Read up to delimiter, even length *** + at.clear_error(); + char table1[] = "68656C6C6F,"; + at.flush(); + filehandle_stub_table = table1; + filehandle_stub_table_pos = 0; + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = 1; + char buf1[10]; + // Set _stop_tag to resp_stop(OKCRLF) + at.resp_start(); + CHECK(5 == at.read_hex_string(buf1, 5)); + CHECK(!strncmp(buf1, "hello", 5)); + + // *** Read up to delimiter, odd length *** + at.clear_error(); + char table2[] = "68656C6C6F7,"; + at.flush(); + filehandle_stub_table = table2; + filehandle_stub_table_pos = 0; + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = 1; + char buf2[10]; + // Set _stop_tag to resp_stop(OKCRLF) + at.resp_start(); + CHECK(5 == at.read_hex_string(buf2, 6)); + CHECK(!strncmp(buf2, "hello", 5)); + + // *** Read with stop tag, even length *** + at.clear_error(); + char table3[] = "6865OK\r\n"; + at.flush(); + filehandle_stub_table = table3; + filehandle_stub_table_pos = 0; + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = 1; + char buf3[6]; + // Set _stop_tag to resp_stop(OKCRLF) + at.resp_start(); + CHECK(2 == at.read_hex_string(buf3, 2 + 1/*get to stop tag match*/)); + CHECK(!strncmp(buf3, "he", 2)); + at.resp_stop(); + + // *** Read with stop tag, odd length *** + at.clear_error(); + char table4[] = "686OK\r\n"; + at.flush(); + filehandle_stub_table = table4; + filehandle_stub_table_pos = 0; + mbed_poll_stub::revents_value = POLLIN; + mbed_poll_stub::int_value = 1; + char buf4[6]; + // Set _stop_tag to resp_stop(OKCRLF) + at.resp_start(); + CHECK(1 == at.read_hex_string(buf4, 2 + 1/*get to stop tag match*/)); + CHECK(!strncmp(buf4, "h", 1)); } void Test_ATHandler::test_ATHandler_read_int() { EventQueue que; FileHandle_stub fh1; + filehandle_stub_table = NULL; + filehandle_stub_table_pos = 0; ATHandler at(&fh1, que, 0, ","); diff --git a/features/cellular/UNITTESTS/at/athandler/test_athandler.h b/features/cellular/UNITTESTS/at/athandler/test_athandler.h index f17e40084be..a1ee7dba550 100644 --- a/features/cellular/UNITTESTS/at/athandler/test_athandler.h +++ b/features/cellular/UNITTESTS/at/athandler/test_athandler.h @@ -80,6 +80,8 @@ class Test_ATHandler void test_ATHandler_read_string(); + void test_ATHandler_read_hex_string(); + void test_ATHandler_read_int(); void test_ATHandler_resp_start(); diff --git a/features/cellular/UNITTESTS/stubs/FileHandle_stub.h b/features/cellular/UNITTESTS/stubs/FileHandle_stub.h index 2bc9eed541e..5972a9a89ee 100644 --- a/features/cellular/UNITTESTS/stubs/FileHandle_stub.h +++ b/features/cellular/UNITTESTS/stubs/FileHandle_stub.h @@ -36,10 +36,13 @@ class FileHandle_stub : public FileHandle virtual ssize_t read(void *buffer, size_t size){ if (filehandle_stub_table) { ssize_t ret = strlen(filehandle_stub_table) - filehandle_stub_table_pos; - if (size < ret) { + if (ret >= 0 && size < ret) { ret = size; } - memcpy(buffer, filehandle_stub_table, ret); + if (ret >= 0) { + memcpy(buffer, filehandle_stub_table, ret); + } + filehandle_stub_table_pos += ret; return ret; } diff --git a/features/cellular/easy_cellular/EasyCellularConnection.cpp b/features/cellular/easy_cellular/EasyCellularConnection.cpp index c92eef3edfe..63bb930d41b 100644 --- a/features/cellular/easy_cellular/EasyCellularConnection.cpp +++ b/features/cellular/easy_cellular/EasyCellularConnection.cpp @@ -156,7 +156,7 @@ nsapi_error_t EasyCellularConnection::connect(const char *sim_pin, const char *a } if (sim_pin) { - _cellularConnectionFSM->set_sim_pin(sim_pin); + this->set_sim_pin(sim_pin); } return connect(); diff --git a/features/cellular/framework/AT/ATHandler.cpp b/features/cellular/framework/AT/ATHandler.cpp index 5dbc8346096..eaba46dfdc3 100644 --- a/features/cellular/framework/AT/ATHandler.cpp +++ b/features/cellular/framework/AT/ATHandler.cpp @@ -454,31 +454,88 @@ ssize_t ATHandler::read_bytes(uint8_t *buf, size_t len) return read_len; } -ssize_t ATHandler::read(char *buf, size_t size, bool read_even_stop_tag, bool hex) +ssize_t ATHandler::read_string(char *buf, size_t size, bool read_even_stop_tag) { if (_last_err || !_stop_tag || (_stop_tag->found && read_even_stop_tag == false)) { return -1; } + consume_char('\"'); + + if (_last_err) { + return -1; + } + + size_t len = 0; + size_t match_pos = 0; + + for (; len < (size - 1 + match_pos); len++) { + int c = get_char(); + if (c == -1) { + set_error(NSAPI_ERROR_DEVICE_ERROR); + return -1; + } else if (c == _delimiter) { + buf[len] = '\0'; + break; + } else if (c == '\"') { + match_pos = 0; + len--; + continue; + } else if (_stop_tag->len && c == _stop_tag->tag[match_pos]) { + match_pos++; + if (match_pos == _stop_tag->len) { + _stop_tag->found = true; + // remove tag from string if it was matched + len -= (_stop_tag->len - 1); + buf[len] = '\0'; + break; + } + } else if (match_pos) { + match_pos = 0; + } + + buf[len] = c; + } + + if (len && (len == size - 1 + match_pos)) { + buf[len] = '\0'; + } + + return len; +} + +ssize_t ATHandler::read_hex_string(char *buf, size_t size) +{ + if (_last_err || !_stop_tag || _stop_tag->found) { + return -1; + } + size_t match_pos = 0; - size_t read_size = hex ? size * 2 : size; consume_char('\"'); + if (_last_err) { + return -1; + } + size_t read_idx = 0; size_t buf_idx = 0; char hexbuf[2]; - for (; read_idx < (read_size + match_pos); read_idx++) { + for (; read_idx < size * 2 + match_pos; read_idx++) { int c = get_char(); - buf_idx = hex ? read_idx / 2 : read_idx; + + if (match_pos) { + buf_idx++; + } else { + buf_idx = read_idx / 2; + } + if (c == -1) { - buf[buf_idx] = '\0'; set_error(NSAPI_ERROR_DEVICE_ERROR); return -1; } if (c == _delimiter) { - buf[buf_idx] = '\0'; break; } else if (c == '\"') { match_pos = 0; @@ -490,14 +547,13 @@ ssize_t ATHandler::read(char *buf, size_t size, bool read_even_stop_tag, bool he _stop_tag->found = true; // remove tag from string if it was matched buf_idx -= (_stop_tag->len - 1); - buf[buf_idx] = '\0'; break; } } else if (match_pos) { match_pos = 0; } - if (!hex) { + if (match_pos) { buf[buf_idx] = c; } else { hexbuf[read_idx % 2] = c; @@ -507,17 +563,11 @@ ssize_t ATHandler::read(char *buf, size_t size, bool read_even_stop_tag, bool he } } - return buf_idx; -} - -ssize_t ATHandler::read_string(char *buf, size_t size, bool read_even_stop_tag) -{ - return read(buf, size, read_even_stop_tag, false); -} + if (read_idx && (read_idx == size * 2 + match_pos)) { + buf_idx++; + } -ssize_t ATHandler::read_hex_string(char *buf, size_t size) -{ - return read(buf, size, false, true); + return buf_idx; } int32_t ATHandler::read_int() diff --git a/features/cellular/framework/AT/ATHandler.h b/features/cellular/framework/AT/ATHandler.h index 93e5053598e..6ae417a3d68 100644 --- a/features/cellular/framework/AT/ATHandler.h +++ b/features/cellular/framework/AT/ATHandler.h @@ -302,7 +302,7 @@ class ATHandler { * Stops on delimiter or stop tag. * * @param str output buffer for the read - * @param size maximum number of chars to output + * @param size maximum number of chars to output including NULL * @param read_even_stop_tag if true then try to read even if the stop tag was found previously * @return length of output string or -1 in case of read timeout before delimiter or stop tag is found */ @@ -512,8 +512,6 @@ class ATHandler { // check is urc is already added bool find_urc_handler(const char *prefix, mbed::Callback callback); - ssize_t read(char *buf, size_t size, bool read_even_stop_tag, bool hex); - // print contents of a buffer to trace log void debug_print(char *p, int len); }; diff --git a/features/cellular/framework/AT/AT_CellularStack.cpp b/features/cellular/framework/AT/AT_CellularStack.cpp index df9753fa0a1..df6f1c9348e 100644 --- a/features/cellular/framework/AT/AT_CellularStack.cpp +++ b/features/cellular/framework/AT/AT_CellularStack.cpp @@ -257,11 +257,8 @@ nsapi_size_or_error_t AT_CellularStack::socket_sendto(nsapi_socket_t handle, con } } - unsigned max_packet_size = get_max_packet_size(); - /* Check parameters */ - if (addr.get_ip_version() == NSAPI_UNSPEC || - size > max_packet_size) { + if (addr.get_ip_version() == NSAPI_UNSPEC) { return NSAPI_ERROR_DEVICE_ERROR; } diff --git a/features/cellular/framework/AT/AT_CellularStack.h b/features/cellular/framework/AT/AT_CellularStack.h index 04682f26031..5f3cf5e1d31 100644 --- a/features/cellular/framework/AT/AT_CellularStack.h +++ b/features/cellular/framework/AT/AT_CellularStack.h @@ -105,11 +105,6 @@ class AT_CellularStack : public NetworkStack, public AT_CellularBase */ virtual int get_max_socket_count() = 0; - /** - * Gets maximum packet size - */ - virtual int get_max_packet_size() = 0; - /** * Checks if modem supports the given protocol * diff --git a/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95_CellularStack.cpp b/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95_CellularStack.cpp index ccdcb05a10e..b8c3bcc13ca 100644 --- a/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95_CellularStack.cpp +++ b/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95_CellularStack.cpp @@ -61,11 +61,6 @@ int QUECTEL_BC95_CellularStack::get_max_socket_count() return BC95_SOCKET_MAX; } -int QUECTEL_BC95_CellularStack::get_max_packet_size() -{ - return BC95_MAX_PACKET_SIZE; -} - bool QUECTEL_BC95_CellularStack::is_protocol_supported(nsapi_protocol_t protocol) { return (protocol == NSAPI_UDP); @@ -146,7 +141,7 @@ nsapi_size_or_error_t QUECTEL_BC95_CellularStack::socket_sendto_impl(CellularSoc { int sent_len = 0; - char *hexstr = new char[BC95_MAX_PACKET_SIZE*2+1]; + char *hexstr = new char[size*2+1]; int hexlen = char_str_to_hex_str((const char*)data, size, hexstr); // NULL terminated for write_string hexstr[hexlen] = 0; @@ -154,7 +149,7 @@ nsapi_size_or_error_t QUECTEL_BC95_CellularStack::socket_sendto_impl(CellularSoc _at.write_int(socket->id); _at.write_string(address.get_ip_address(), false); _at.write_int(address.get_port()); - _at.write_int(size <= BC95_MAX_PACKET_SIZE ? size : BC95_MAX_PACKET_SIZE); + _at.write_int(size); _at.write_string(hexstr, false); _at.cmd_stop(); _at.resp_start(); @@ -181,7 +176,7 @@ nsapi_size_or_error_t QUECTEL_BC95_CellularStack::socket_recvfrom_impl(CellularS _at.cmd_start("AT+NSORF="); _at.write_int(socket->id); - _at.write_int(size <= BC95_MAX_PACKET_SIZE ? size : BC95_MAX_PACKET_SIZE); + _at.write_int(size); _at.cmd_stop(); _at.resp_start(); // receiving socket id diff --git a/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95_CellularStack.h b/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95_CellularStack.h index 616240b41da..91dc7499a93 100644 --- a/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95_CellularStack.h +++ b/features/cellular/framework/targets/QUECTEL/BC95/QUECTEL_BC95_CellularStack.h @@ -21,7 +21,6 @@ #include "AT_CellularStack.h" #define BC95_SOCKET_MAX 7 -#define BC95_MAX_PACKET_SIZE 1358 namespace mbed { @@ -42,8 +41,6 @@ class QUECTEL_BC95_CellularStack : public AT_CellularStack virtual int get_max_socket_count(); - virtual int get_max_packet_size(); - virtual bool is_protocol_supported(nsapi_protocol_t protocol); virtual nsapi_error_t socket_close_impl(int sock_id); diff --git a/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularStack.cpp b/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularStack.cpp index 12120bb59c3..deb03b55e85 100644 --- a/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularStack.cpp +++ b/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularStack.cpp @@ -64,11 +64,6 @@ int QUECTEL_BG96_CellularStack::get_max_socket_count() return BG96_SOCKET_MAX; } -int QUECTEL_BG96_CellularStack::get_max_packet_size() -{ - return BG96_MAX_PACKET_SIZE; -} - bool QUECTEL_BG96_CellularStack::is_protocol_supported(nsapi_protocol_t protocol) { return (protocol == NSAPI_UDP); diff --git a/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularStack.h b/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularStack.h index af243ccfab7..1553e00153c 100644 --- a/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularStack.h +++ b/features/cellular/framework/targets/QUECTEL/BG96/QUECTEL_BG96_CellularStack.h @@ -23,7 +23,6 @@ namespace mbed { #define BG96_SOCKET_MAX 12 -#define BG96_MAX_PACKET_SIZE 1460 #define BG96_CREATE_SOCKET_TIMEOUT 150000 //150 seconds class QUECTEL_BG96_CellularStack : public AT_CellularStack @@ -43,8 +42,6 @@ class QUECTEL_BG96_CellularStack : public AT_CellularStack virtual int get_max_socket_count(); - virtual int get_max_packet_size(); - virtual bool is_protocol_supported(nsapi_protocol_t protocol); virtual nsapi_error_t socket_close_impl(int sock_id); diff --git a/features/filesystem/bd/MBRBlockDevice.cpp b/features/filesystem/bd/MBRBlockDevice.cpp index e83e4fbf076..bcea66f69b2 100644 --- a/features/filesystem/bd/MBRBlockDevice.cpp +++ b/features/filesystem/bd/MBRBlockDevice.cpp @@ -242,6 +242,7 @@ int MBRBlockDevice::init() // Check that block addresses are valid if (!_bd->is_valid_erase(_offset, _size)) { + delete[] buffer; return BD_ERROR_INVALID_PARTITION; } diff --git a/features/filesystem/fat/ChaN/ff.cpp b/features/filesystem/fat/ChaN/ff.cpp index cc04154a307..7e4561d8098 100644 --- a/features/filesystem/fat/ChaN/ff.cpp +++ b/features/filesystem/fat/ChaN/ff.cpp @@ -1740,7 +1740,8 @@ FRESULT dir_next ( /* FR_OK(0):succeeded, FR_NO_FILE:End of table, FR_DENIED:Cou ofs = dp->dptr + SZDIRE; /* Next entry */ - if (dp->sect == 0 || ofs >= (DWORD)((FF_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR)) return FR_NO_FILE; /* Report EOT when offset has reached max value */ + if (ofs >= (DWORD)((FF_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR)) dp->sect = 0; /* Disable it if the offset reached the max value */ + if (dp->sect == 0) return FR_NO_FILE; /* Report EOT if it has been disabled */ if (ofs % SS(fs) == 0) { /* Sector changed? */ dp->sect++; /* Next sector */ diff --git a/features/lorawan/LoRaRadio.h b/features/lorawan/LoRaRadio.h index c586d59fc7a..51b9dd10aca 100644 --- a/features/lorawan/LoRaRadio.h +++ b/features/lorawan/LoRaRadio.h @@ -281,7 +281,7 @@ class LoRaRadio * @param iq_inverted Inverts IQ signals (LoRa only) * FSK : N/A (set to 0). * LoRa: [0: not inverted, 1: inverted] - * @param timeout The transmission timeout [us]. + * @param timeout The transmission timeout [ms]. */ virtual void set_tx_config(radio_modems_t modem, int8_t power, uint32_t fdev, uint32_t bandwidth, uint32_t datarate, diff --git a/features/lorawan/LoRaWANBase.h b/features/lorawan/LoRaWANBase.h index 50a2b545498..959f43d6dd9 100644 --- a/features/lorawan/LoRaWANBase.h +++ b/features/lorawan/LoRaWANBase.h @@ -41,8 +41,14 @@ class LoRaWANBase { * Connect by Over The Air Activation or Activation By Personalization. * The connection type is selected at the setup. * - * @return LORAWAN_STATUS_OK on success, a negative error code on - * failure. + * @return For ABP: If everything goes well, LORAWAN_STATUS_OK is returned for first call followed by + * a 'CONNECTED' event. Otherwise a negative error code is returned. + * Any subsequent call will return LORAWAN_STATUS_ALREADY_CONNECTED and no event follows. + * + * For OTAA: When a JoinRequest is sent, LORAWAN_STATUS_CONNECT_IN_PROGRESS is returned for the first call. + * Any subsequent call will return either LORAWAN_STATUS_BUSY (if the previous request for connection + * is still underway) or LORAWAN_STATUS_ALREADY_CONNECTED (if a network was already joined successfully). + * A 'CONNECTED' event is sent to the application when the JoinAccept is received. */ virtual lorawan_status_t connect() = 0; @@ -53,8 +59,15 @@ class LoRaWANBase { * You need to define the parameters in the main application. * * @param connect Options how end-device will connect to gateway - * @return LORAWAN_STATUS_OK on success, negative error code - * on failure + * + * @return For ABP: If everything goes well, LORAWAN_STATUS_OK is returned for first call followed by + * a 'CONNECTED' event. Otherwise a negative error code is returned. + * Any subsequent call will return LORAWAN_STATUS_ALREADY_CONNECTED and no event follows. + * + * For OTAA: When a JoinRequest is sent, LORAWAN_STATUS_CONNECT_IN_PROGRESS is returned for the first call. + * Any subsequent call will return either LORAWAN_STATUS_BUSY (if the previous request for connection + * is still underway) or LORAWAN_STATUS_ALREADY_CONNECTED (if a network was already joined successfully). + * A 'CONNECTED' event is sent to the application when the JoinAccept is received. */ virtual lorawan_status_t connect(const lorawan_connect_t &connect) = 0; @@ -203,15 +216,9 @@ class LoRaWANBase { * MSG_CONFIRMED_FLAG = 0x02 * MSG_MULTICAST_FLAG = 0x04 * MSG_PROPRIETARY_FLAG = 0x08 - * MSG_MULTICAST_FLAG and MSG_PROPRIETARY_FLAG can be - * used in conjunction with MSG_UNCONFIRMED_FLAG and - * MSG_CONFIRMED_FLAG depending on the intended use. - * - * MSG_PROPRIETARY_FLAG|MSG_CONFIRMED_FLAG mask will set - * a confirmed message flag for a proprietary message. - * MSG_CONFIRMED_FLAG and MSG_UNCONFIRMED_FLAG are - * mutually exclusive. * + * All flags are mutually exclusive, and MSG_MULTICAST_FLAG + * cannot be set. * * @return The number of bytes sent, or * LORAWAN_STATUS_WOULD_BLOCK if another TX is @@ -240,14 +247,11 @@ class LoRaWANBase { * MSG_MULTICAST_FLAG = 0x04, * MSG_PROPRIETARY_FLAG = 0x08 * - * MSG_MULTICAST_FLAG and MSG_PROPRIETARY_FLAG can be - * used in conjunction with MSG_UNCONFIRMED_FLAG and - * MSG_CONFIRMED_FLAG depending on the intended use. - * - * MSG_PROPRIETARY_FLAG|MSG_CONFIRMED_FLAG mask will set - * a confirmed message flag for a proprietary message. + * All flags can be used in conjunction with + * one another depending on the intended use case or reception + * expectation. * - * MSG_CONFIRMED_FLAG and MSG_UNCONFIRMED_FLAG are + * e.g., MSG_CONFIRMED_FLAG and MSG_UNCONFIRMED_FLAG are * not mutually exclusive, i.e., the user can subscribe to * receive both CONFIRMED AND UNCONFIRMED messages at * the same time. diff --git a/features/lorawan/LoRaWANInterface.h b/features/lorawan/LoRaWANInterface.h index 03539dafd2d..2b6984531eb 100644 --- a/features/lorawan/LoRaWANInterface.h +++ b/features/lorawan/LoRaWANInterface.h @@ -61,7 +61,6 @@ class LoRaWANInterface: public LoRaWANBase { * all user-configured channels except the Join/Default channels. A CF-List can * configure a maximum of five channels other than the default channels. * - * In case of ABP, the CONNECTED event is posted before the call to `connect()` returns. * To configure more channels, we recommend that you use the `set_channel_plan()` API after the connection. * By default, the PHY layers configure only the mandatory Join channels. The retransmission back-off restrictions * on these channels are severe and you may experience long delays or even failures in the confirmed traffic. @@ -80,8 +79,14 @@ class LoRaWANInterface: public LoRaWANBase { * is important, at least for ABP. That's why we try to restore frame counters from * session information after a disconnection. * - * @return LORAWAN_STATUS_OK or LORAWAN_STATUS_CONNECT_IN_PROGRESS - * on success, or a negative error code on failure. + * @return For ABP: If everything goes well, LORAWAN_STATUS_OK is returned for first call followed by + * a 'CONNECTED' event. Otherwise a negative error code is returned. + * Any subsequent call will return LORAWAN_STATUS_ALREADY_CONNECTED and no event follows. + * + * For OTAA: When a JoinRequest is sent, LORAWAN_STATUS_CONNECT_IN_PROGRESS is returned for the first call. + * Any subsequent call will return either LORAWAN_STATUS_BUSY (if the previous request for connection + * is still underway) or LORAWAN_STATUS_ALREADY_CONNECTED (if a network was already joined successfully). + * A 'CONNECTED' event is sent to the application when the JoinAccept is received. */ virtual lorawan_status_t connect(); @@ -97,7 +102,6 @@ class LoRaWANInterface: public LoRaWANBase { * all user-configured channels except the Join/Default channels. A CF-List can * configure a maximum of five channels other than the default channels. * - * In case of ABP, the CONNECTED event is posted before the call to `connect()` returns. * To configure more channels, we recommend that you use the `set_channel_plan()` API after the connection. * By default, the PHY layers configure only the mandatory Join * channels. The retransmission back-off restrictions on these channels @@ -120,8 +124,14 @@ class LoRaWANInterface: public LoRaWANBase { * * @param connect Options for an end device connection to the gateway. * - * @return LORAWAN_STATUS_OK or LORAWAN_STATUS_CONNECT_IN_PROGRESS, - * a negative error code on failure. + * @return For ABP: If everything goes well, LORAWAN_STATUS_OK is returned for first call followed by + * a 'CONNECTED' event. Otherwise a negative error code is returned. + * Any subsequent call will return LORAWAN_STATUS_ALREADY_CONNECTED and no event follows. + * + * For OTAA: When a JoinRequest is sent, LORAWAN_STATUS_CONNECT_IN_PROGRESS is returned for the first call. + * Any subsequent call will return either LORAWAN_STATUS_BUSY (if the previous request for connection + * is still underway) or LORAWAN_STATUS_ALREADY_CONNECTED (if a network was already joined successfully). + * A 'CONNECTED' event is sent to the application when the JoinAccept is received. */ virtual lorawan_status_t connect(const lorawan_connect_t &connect); @@ -301,14 +311,9 @@ class LoRaWANInterface: public LoRaWANBase { * MSG_CONFIRMED_FLAG = 0x02 * MSG_MULTICAST_FLAG = 0x04 * MSG_PROPRIETARY_FLAG = 0x08 - * MSG_MULTICAST_FLAG and MSG_PROPRIETARY_FLAG can be - * used in conjunction with MSG_UNCONFIRMED_FLAG and - * MSG_CONFIRMED_FLAG depending on the intended use. * - * MSG_PROPRIETARY_FLAG|MSG_CONFIRMED_FLAG mask will set - * a confirmed message flag for a proprietary message. - * MSG_CONFIRMED_FLAG and MSG_UNCONFIRMED_FLAG are - * mutually exclusive. + * All flags are mutually exclusive, and MSG_MULTICAST_FLAG + * cannot be set. * * * @return The number of bytes sent, or @@ -338,14 +343,11 @@ class LoRaWANInterface: public LoRaWANBase { * MSG_MULTICAST_FLAG = 0x04, * MSG_PROPRIETARY_FLAG = 0x08 * - * MSG_MULTICAST_FLAG and MSG_PROPRIETARY_FLAG can be - * used in conjunction with MSG_UNCONFIRMED_FLAG and - * MSG_CONFIRMED_FLAG depending on the intended use. - * - * MSG_PROPRIETARY_FLAG|MSG_CONFIRMED_FLAG mask will set - * a confirmed message flag for a proprietary message. + * All flags can be used in conjunction with + * one another depending on the intended use case or reception + * expectation. * - * MSG_CONFIRMED_FLAG and MSG_UNCONFIRMED_FLAG are + * e.g., MSG_CONFIRMED_FLAG and MSG_UNCONFIRMED_FLAG are * not mutually exclusive, i.e., the user can subscribe to * receive both CONFIRMED AND UNCONFIRMED messages at * the same time. diff --git a/features/lorawan/LoRaWANStack.cpp b/features/lorawan/LoRaWANStack.cpp index 9e5bb1698ae..bda8454c45c 100644 --- a/features/lorawan/LoRaWANStack.cpp +++ b/features/lorawan/LoRaWANStack.cpp @@ -44,6 +44,7 @@ SPDX-License-Identifier: BSD-3-Clause #define CONNECTED_FLAG 0x00000004 #define USING_OTAA_FLAG 0x00000008 #define TX_DONE_FLAG 0x00000010 +#define CONN_IN_PROGRESS_FLAG 0x00000020 using namespace mbed; using namespace events; @@ -155,6 +156,14 @@ lorawan_status_t LoRaWANStack::connect() return LORAWAN_STATUS_NOT_INITIALIZED; } + if (_ctrl_flags & CONN_IN_PROGRESS_FLAG) { + return LORAWAN_STATUS_BUSY; + } + + if (_ctrl_flags & CONNECTED_FLAG) { + return LORAWAN_STATUS_ALREADY_CONNECTED; + } + lorawan_status_t status = _loramac.prepare_join(NULL, MBED_CONF_LORA_OVER_THE_AIR_ACTIVATION); if (LORAWAN_STATUS_OK != status) { @@ -170,6 +179,14 @@ lorawan_status_t LoRaWANStack::connect(const lorawan_connect_t &connect) return LORAWAN_STATUS_NOT_INITIALIZED; } + if (_ctrl_flags & CONN_IN_PROGRESS_FLAG) { + return LORAWAN_STATUS_BUSY; + } + + if (_ctrl_flags & CONNECTED_FLAG) { + return LORAWAN_STATUS_ALREADY_CONNECTED; + } + if (!(connect.connect_type == LORAWAN_CONNECTION_OTAA) && !(connect.connect_type == LORAWAN_CONNECTION_ABP)) { return LORAWAN_STATUS_PARAMETER_INVALID; @@ -824,6 +841,8 @@ int LoRaWANStack::convert_to_msg_flag(const mcps_type_t type) lorawan_status_t LoRaWANStack::handle_connect(bool is_otaa) { + _ctrl_flags |= CONN_IN_PROGRESS_FLAG; + if (is_otaa) { tr_debug("Initiating OTAA"); @@ -1149,30 +1168,23 @@ void LoRaWANStack::process_joining_state(lorawan_status_t &op_status) void LoRaWANStack::process_connected_state() { + _ctrl_flags |= CONNECTED_FLAG; + _ctrl_flags &= ~CONN_IN_PROGRESS_FLAG; + if (_ctrl_flags & USING_OTAA_FLAG) { tr_debug("OTAA Connection OK!"); } _lw_session.active = true; send_event_to_application(CONNECTED); - _ctrl_flags |= CONNECTED_FLAG; _device_current_state = DEVICE_STATE_IDLE; } void LoRaWANStack::process_connecting_state(lorawan_status_t &op_status) { - if (_device_current_state != DEVICE_STATE_IDLE - && _device_current_state != DEVICE_STATE_SHUTDOWN) { - op_status = LORAWAN_STATUS_BUSY; - return; - } - - if (_ctrl_flags & CONNECTED_FLAG) { - tr_debug("Already connected"); - op_status = LORAWAN_STATUS_OK; - return; - } + MBED_ASSERT(_device_current_state == DEVICE_STATE_IDLE || + _device_current_state == DEVICE_STATE_SHUTDOWN); _device_current_state = DEVICE_STATE_CONNECTING; diff --git a/features/lorawan/LoRaWANStack.h b/features/lorawan/LoRaWANStack.h index 21e85d752be..d32d6688584 100644 --- a/features/lorawan/LoRaWANStack.h +++ b/features/lorawan/LoRaWANStack.h @@ -84,78 +84,29 @@ class LoRaWANStack: private mbed::NonCopyable { /** Connect OTAA or ABP using Mbed-OS config system * - * Connect by Over The Air Activation or Activation By Personalization. - * You need to configure the connection properly via the Mbed OS configuration - * system. - * - * When connecting via OTAA, the return code for success (LORAWAN_STATUS_CONNECT_IN_PROGRESS) is negative. - * However, this is not a real error. It tells you that the connection is in progress and you will - * be notified of the completion via an event. By default, after the Join Accept message - * is received, base stations may provide the node with a CF-List that replaces - * all user-configured channels except the Join/Default channels. A CF-List can - * configure a maximum of five channels other than the default channels. - * - * In case of ABP, the CONNECTED event is posted before the call to `connect()` returns. - * To configure more channels, we recommend that you use the `set_channel_plan()` API after the connection. - * By default, the PHY layers configure only the mandatory Join channels. The retransmission back-off restrictions - * on these channels are severe and you may experience long delays or even failures in the confirmed traffic. - * If you add more channels, the aggregated duty cycle becomes much more relaxed as compared to the Join (default) channels only. - * - * **NOTES ON RECONNECTION:** - * Currently, the Mbed OS LoRaWAN implementation does not support non-volatile - * memory storage. Therefore, the state and frame counters cannot be restored after - * a power cycle. However, if you use the `disconnect()` API to shut down the LoRaWAN - * protocol, the state and frame counters are saved. Connecting again would try to - * restore the previous session. According to the LoRaWAN 1.0.2 specification, the frame counters are always reset - * to zero for OTAA and a new Join request lets the network server know - * that the counters need a reset. The same is said about the ABP but there - * is no way to convey this information to the network server. For a network - * server, an ABP device is always connected. That's why storing the frame counters - * is important, at least for ABP. That's why we try to restore frame counters from - * session information after a disconnection. - * - * @return LORAWAN_STATUS_OK or LORAWAN_STATUS_CONNECT_IN_PROGRESS - * on success, or a negative error code on failure. + * @return For ABP: If everything goes well, LORAWAN_STATUS_OK is returned for first call followed by + * a 'CONNECTED' event. Otherwise a negative error code is returned. + * Any subsequent call will return LORAWAN_STATUS_ALREADY_CONNECTED and no event follows. + * + * For OTAA: When a JoinRequest is sent, LORAWAN_STATUS_CONNECT_IN_PROGRESS is returned for the first call. + * Any subsequent call will return either LORAWAN_STATUS_BUSY (if the previous request for connection + * is still underway) or LORAWAN_STATUS_ALREADY_CONNECTED (if a network was already joined successfully). + * A 'CONNECTED' event is sent to the application when the JoinAccept is received. */ lorawan_status_t connect(); /** Connect OTAA or ABP with parameters - * - * All connection parameters are chosen by the user and provided in the - * data structure passed down. - * - * When connecting via OTAA, the return code for success (LORAWAN_STATUS_CONNECT_IN_PROGRESS) is negative. - * However, this is not a real error. It tells you that connection is in progress and you will - * be notified of completion via an event. By default, after Join Accept message - * is received, base stations may provide the node with a CF-List which replaces - * all user-configured channels except the Join/Default channels. A CF-List can - * configure a maximum of five channels other than the default channels. - * - * In case of ABP, the CONNECTED event is posted before the call to `connect()` returns. - * To configure more channels, we recommend that you use the `set_channel_plan()` API after the connection. - * By default, the PHY layers configure only the mandatory Join - * channels. The retransmission back-off restrictions on these channels - * are severe and you may experience long delays or even - * failures in the confirmed traffic. If you add more channels, the aggregated duty - * cycle becomes much more relaxed as compared to the Join (default) channels only. - * - * **NOTES ON RECONNECTION:** - * Currently, the Mbed OS LoRaWAN implementation does not support non-volatile - * memory storage. Therefore, the state and frame counters cannot be restored after - * a power cycle. However, if you use the `disconnect()` API to shut down the LoRaWAN - * protocol, the state and frame counters are saved. Connecting again would try to - * restore the previous session. According to the LoRaWAN 1.0.2 specification, the frame counters are always reset - * to zero for OTAA and a new Join request lets the network server know - * that the counters need a reset. The same is said about the ABP but there - * is no way to convey this information to the network server. For a network - * server, an ABP device is always connected. That's why storing the frame counters - * is important, at least for ABP. That's why we try to restore frame counters from - * session information after a disconnection. * * @param connect Options for an end device connection to the gateway. * - * @return LORAWAN_STATUS_OK or LORAWAN_STATUS_CONNECT_IN_PROGRESS, - * a negative error code on failure. + * @return For ABP: If everything goes well, LORAWAN_STATUS_OK is returned for first call followed by + * a 'CONNECTED' event. Otherwise a negative error code is returned. + * Any subsequent call will return LORAWAN_STATUS_ALREADY_CONNECTED and no event follows. + * + * For OTAA: When a JoinRequest is sent, LORAWAN_STATUS_CONNECT_IN_PROGRESS is returned for the first call. + * Any subsequent call will return either LORAWAN_STATUS_BUSY (if the previous request for connection + * is still underway) or LORAWAN_STATUS_ALREADY_CONNECTED (if a network was already joined successfully). + * A 'CONNECTED' event is sent to the application when the JoinAccept is received. */ lorawan_status_t connect(const lorawan_connect_t &connect); diff --git a/features/lorawan/lorastack/mac/LoRaMac.cpp b/features/lorawan/lorastack/mac/LoRaMac.cpp index b6f5edf2a8a..2d5231b6c0f 100644 --- a/features/lorawan/lorastack/mac/LoRaMac.cpp +++ b/features/lorawan/lorastack/mac/LoRaMac.cpp @@ -814,9 +814,11 @@ lorawan_status_t LoRaMac::send_join_request() status = prepare_frame(&mac_hdr, &fctrl, 0, NULL, 0); if (status == LORAWAN_STATUS_OK) { - status = schedule_tx(); + if (schedule_tx() == LORAWAN_STATUS_OK) { + status = LORAWAN_STATUS_CONNECT_IN_PROGRESS; + } } else { - tr_error("Retransmission: error %d", status); + tr_error("Couldn't send a JoinRequest: error %d", status); } return status; @@ -869,8 +871,8 @@ void LoRaMac::open_rx1_window(void) _mcps_indication.rx_datarate = _params.rx_window1_config.datarate; _lora_phy.rx_config(&_params.rx_window1_config); - _lora_phy.setup_rx_window(_params.rx_window1_config.is_rx_continuous, - _params.sys_params.max_rx_win_time); + _lora_phy.rx_config(&_params.rx_window1_config); + _lora_phy.handle_receive(); tr_debug("Opening RX1 Window"); } @@ -885,8 +887,6 @@ void LoRaMac::open_rx2_window() _params.rx_window2_config.frequency = _params.sys_params.rx2_channel.frequency; _params.rx_window2_config.dl_dwell_time = _params.sys_params.downlink_dwell_time; _params.rx_window2_config.is_repeater_supported = _params.is_repeater_supported; - _params.rx_window2_config.rx_slot = _params.rx_window2_config.is_rx_continuous ? - RX_SLOT_WIN_CLASS_C : RX_SLOT_WIN_2; if (get_device_class() == CLASS_C) { _params.rx_window2_config.is_rx_continuous = true; @@ -894,15 +894,14 @@ void LoRaMac::open_rx2_window() _params.rx_window2_config.is_rx_continuous = false; } - _mcps_indication.rx_datarate = _params.rx_window2_config.datarate; - - if (_lora_phy.rx_config(&_params.rx_window2_config)) { + _params.rx_window2_config.rx_slot = _params.rx_window2_config.is_rx_continuous ? + RX_SLOT_WIN_CLASS_C : RX_SLOT_WIN_2; - _lora_phy.setup_rx_window(_params.rx_window2_config.is_rx_continuous, - _params.sys_params.max_rx_win_time); + _mcps_indication.rx_datarate = _params.rx_window2_config.datarate; - _params.rx_slot = _params.rx_window2_config.rx_slot; - } + _lora_phy.rx_config(&_params.rx_window2_config); + _lora_phy.handle_receive(); + _params.rx_slot = _params.rx_window2_config.rx_slot; tr_debug("Opening RX2 Window, Frequency = %u", _params.rx_window2_config.frequency); } @@ -1037,6 +1036,7 @@ lorawan_status_t LoRaMac::schedule_tx() { channel_selection_params_t next_channel; lorawan_time_t backoff_time = 0; + uint8_t fopts_len = 0; if (_params.sys_params.max_duty_cycle == 255) { return LORAWAN_STATUS_DEVICE_OFF; @@ -1094,9 +1094,25 @@ lorawan_status_t LoRaMac::schedule_tx() _params.rx_window2_delay = _params.sys_params.join_accept_delay2 + _params.rx_window2_config.window_offset; } else { - if (validate_payload_length(_params.tx_buffer_len, + + // if the outgoing message is a proprietary message, it doesn't include any + // standard message formatting except port and MHDR. + if (_ongoing_tx_msg.type == MCPS_PROPRIETARY) { + fopts_len = 0; + } else { + fopts_len = _mac_commands.get_mac_cmd_length() + _mac_commands.get_repeat_commands_length(); + } + + // A check was performed for validity of FRMPayload in ::prepare_ongoing_tx() API. + // However, owing to the asynch nature of the send() API, we should check the + // validity again, as datarate may have changed since we last attempted to transmit. + if (validate_payload_length(_ongoing_tx_msg.f_buffer_size, _params.sys_params.channel_data_rate, - _mac_commands.get_mac_cmd_length()) == false) { + fopts_len) == false) { + tr_error("Allowed FRMPayload = %d, FRMPayload = %d, MAC commands pending = %d", + _lora_phy->get_max_payload(_params.sys_params.channel_data_rate, + _params.is_repeater_supported), + _ongoing_tx_msg.f_buffer_size, fopts_len); return LORAWAN_STATUS_LENGTH_ERROR; } _params.rx_window1_delay = _params.sys_params.recv_delay1 @@ -1219,27 +1235,9 @@ int16_t LoRaMac::prepare_ongoing_tx(const uint8_t port, uint8_t num_retries) { _ongoing_tx_msg.port = port; - - uint8_t max_possible_size = get_max_possible_tx_size(length); - - if (max_possible_size > MBED_CONF_LORA_TX_MAX_SIZE) { - max_possible_size = MBED_CONF_LORA_TX_MAX_SIZE; - } - - if (max_possible_size < length) { - tr_info("Cannot transmit %d bytes. Possible TX Size is %d bytes", - length, max_possible_size); - - _ongoing_tx_msg.pending_size = length - max_possible_size; - _ongoing_tx_msg.f_buffer_size = max_possible_size; - memcpy(_ongoing_tx_msg.f_buffer, data, _ongoing_tx_msg.f_buffer_size); - } else { - _ongoing_tx_msg.f_buffer_size = length; - _ongoing_tx_msg.pending_size = 0; - if (length > 0) { - memcpy(_ongoing_tx_msg.f_buffer, data, length); - } - } + uint8_t max_possible_size = 0; + uint8_t fopts_len = _mac_commands.get_mac_cmd_length() + + _mac_commands.get_repeat_commands_length(); // Handles unconfirmed messages if (flags & MSG_UNCONFIRMED_FLAG) { @@ -1260,6 +1258,30 @@ int16_t LoRaMac::prepare_ongoing_tx(const uint8_t port, _ongoing_tx_msg.type = MCPS_PROPRIETARY; _ongoing_tx_msg.fport = port; _ongoing_tx_msg.nb_trials = 1; + // a proprietary frame only includes an MHDR field which contains MTYPE field. + // Everything else is at the discretion of the implementer + fopts_len = 0; + } + + max_possible_size = get_max_possible_tx_size(fopts_len); + + if (max_possible_size > MBED_CONF_LORA_TX_MAX_SIZE) { + max_possible_size = MBED_CONF_LORA_TX_MAX_SIZE; + } + + if (max_possible_size < length) { + tr_info("Cannot transmit %d bytes. Possible TX Size is %d bytes", + length, max_possible_size); + + _ongoing_tx_msg.pending_size = length - max_possible_size; + _ongoing_tx_msg.f_buffer_size = max_possible_size; + memcpy(_ongoing_tx_msg.f_buffer, data, _ongoing_tx_msg.f_buffer_size); + } else { + _ongoing_tx_msg.f_buffer_size = length; + _ongoing_tx_msg.pending_size = 0; + if (length > 0) { + memcpy(_ongoing_tx_msg.f_buffer, data, length); + } } tr_info("RTS = %u bytes, PEND = %u, Port: %u", @@ -1570,8 +1592,10 @@ lorawan_status_t LoRaMac::prepare_frame(loramac_mhdr_t *machdr, _mac_commands.parse_mac_commands_to_repeat(); + // We always add Port Field. Spec leaves it optional. + _params.tx_buffer[pkt_header_len++] = frame_port; + if ((payload != NULL) && (_params.tx_buffer_len > 0)) { - _params.tx_buffer[pkt_header_len++] = frame_port; uint8_t *key = _params.keys.app_skey; uint32_t key_length = sizeof(_params.keys.app_skey) * 8; @@ -1762,12 +1786,10 @@ void LoRaMac::disconnect() reset_mcps_indication(); } -uint8_t LoRaMac::get_max_possible_tx_size(uint8_t size) +uint8_t LoRaMac::get_max_possible_tx_size(uint8_t fopts_len) { uint8_t max_possible_payload_size = 0; - uint8_t current_payload_size = 0; - uint8_t fopt_len = _mac_commands.get_mac_cmd_length() - + _mac_commands.get_repeat_commands_length(); + uint8_t allowed_frm_payload_size = 0; if (_params.sys_params.adr_on) { _lora_phy.get_next_ADR(false, _params.sys_params.channel_data_rate, @@ -1775,22 +1797,19 @@ uint8_t LoRaMac::get_max_possible_tx_size(uint8_t size) _params.adr_ack_counter); } - current_payload_size = _lora_phy.get_max_payload(_params.sys_params.channel_data_rate, _params.is_repeater_supported); + allowed_frm_payload_size = _lora_phy->get_max_payload(_params.sys_params.channel_data_rate, + _params.is_repeater_supported); - if (current_payload_size >= fopt_len) { - max_possible_payload_size = current_payload_size - fopt_len; + if (allowed_frm_payload_size >= fopts_len) { + max_possible_payload_size = allowed_frm_payload_size - fopts_len; } else { - max_possible_payload_size = current_payload_size; - fopt_len = 0; + max_possible_payload_size = allowed_frm_payload_size; + fopts_len = 0; _mac_commands.clear_command_buffer(); _mac_commands.clear_repeat_buffer(); } - if (validate_payload_length(size, _params.sys_params.channel_data_rate, - fopt_len) == false) { - return max_possible_payload_size; - } - return current_payload_size; + return max_possible_payload_size; } bool LoRaMac::nwk_joined() diff --git a/features/lorawan/lorastack/mac/LoRaMac.h b/features/lorawan/lorastack/mac/LoRaMac.h index 915cb5ce163..4b4698068e6 100644 --- a/features/lorawan/lorastack/mac/LoRaMac.h +++ b/features/lorawan/lorastack/mac/LoRaMac.h @@ -94,18 +94,18 @@ class LoRaMac { void disconnect(void); /** - * @brief Queries the LoRaMAC whether it is possible to send the next frame with - * a given payload size. The LoRaMAC takes the scheduled MAC commands into - * account and returns corresponding value. + * @brief Queries the LoRaMAC the maximum possible FRMPayload size to send. + * The LoRaMAC takes the scheduled MAC commands into account and returns + * corresponding value. * - * @param size [in] The size of the applicable payload to be sent next. + * @param fopts_len [in] Number of mac commands in the queue pending. * * @return Size of the biggest packet that can be sent. * Please note that if the size of the MAC commands in the queue do * not fit into the payload size on the related datarate, the LoRaMAC will * omit the MAC commands. */ - uint8_t get_max_possible_tx_size(uint8_t size); + uint8_t get_max_possible_tx_size(uint8_t fopts_len); /** * @brief nwk_joined Checks if device has joined to network @@ -324,13 +324,18 @@ class LoRaMac { /** * @brief prepare_ongoing_tx This will prepare (and override) ongoing_tx_msg. - * @param port The application port number. - * @param data A pointer to the data being sent. The ownership of the - * buffer is not transferred. - * @param length The size of data in bytes. - * @param flags A flag used to determine what type of - * message is being sent. - * @param num_retries Number of retries for a confirmed type message + * @param port The application port number. + * + * @param data A pointer to the data being sent. The ownership of the + * buffer is not transferred. + * + * @param length The size of data in bytes. + * + * @param flags A flag used to determine what type of + * message is being sent. + * + * @param num_retries Number of retries for a confirmed type message + * * @return The number of bytes prepared for sending. */ int16_t prepare_ongoing_tx(const uint8_t port, const uint8_t *data, diff --git a/features/lorawan/lorastack/phy/LoRaPHY.cpp b/features/lorawan/lorastack/phy/LoRaPHY.cpp index 61416a42a2a..f2c751c9fcc 100644 --- a/features/lorawan/lorastack/phy/LoRaPHY.cpp +++ b/features/lorawan/lorastack/phy/LoRaPHY.cpp @@ -817,15 +817,6 @@ bool LoRaPHY::rx_config(rx_config_params_t *rx_conf) uint8_t phy_dr = 0; uint32_t frequency = rx_conf->frequency; - _radio->lock(); - - if (_radio->get_status() != RF_IDLE) { - _radio->unlock(); - return false; - } - - _radio->unlock(); - if (rx_conf->rx_slot == RX_SLOT_WIN_1) { // Apply window 1 frequency frequency = phy_params.channels.channel_list[rx_conf->channel].frequency; diff --git a/features/lorawan/lorawan_types.h b/features/lorawan/lorawan_types.h index c6171d78ce3..72fb199fdd8 100644 --- a/features/lorawan/lorawan_types.h +++ b/features/lorawan/lorawan_types.h @@ -98,10 +98,11 @@ typedef enum lorawan_status { #if defined(LORAWAN_COMPLIANCE_TEST) LORAWAN_STATUS_COMPLIANCE_TEST_ON = -1019, /**< Compliance test - is on-going */ #endif - LORAWAN_STATUS_DUTYCYCLE_RESTRICTED = -1020, - LORAWAN_STATUS_NO_CHANNEL_FOUND = -1021, - LORAWAN_STATUS_NO_FREE_CHANNEL_FOUND = -1022, - LORAWAN_STATUS_METADATA_NOT_AVAILABLE = -1023 + LORAWAN_STATUS_DUTYCYCLE_RESTRICTED = -1020, /**< Transmission will continue after duty cycle backoff*/ + LORAWAN_STATUS_NO_CHANNEL_FOUND = -1021, /**< None of the channels is enabled at the moment*/ + LORAWAN_STATUS_NO_FREE_CHANNEL_FOUND = -1022, /**< None of the enabled channels is ready for another TX (duty cycle limited)*/ + LORAWAN_STATUS_METADATA_NOT_AVAILABLE = -1023, /**< Meta-data after an RX or TX is stale*/ + LORAWAN_STATUS_ALREADY_CONNECTED = -1024 /**< The device has already joined a network*/ } lorawan_status_t; /** The lorawan_connect_otaa structure. diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_interrupt.c b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_interrupt.c index fa13de658d0..21c352996c4 100644 --- a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_interrupt.c +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_interrupt.c @@ -1,5 +1,17 @@ /* - * Copyright (c) 2016 ARM Limited, All Rights Reserved + * Copyright (c) 2016-2018 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include "arm_hal_interrupt.h" diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_interrupt_private.h b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_interrupt_private.h index 4ef518b7c8d..586e2e96049 100644 --- a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_interrupt_private.h +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_interrupt_private.h @@ -1,5 +1,17 @@ /* - * Copyright (c) 2016 ARM Limited, All Rights Reserved + * Copyright (c) 2016-2018 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef ARM_HAL_INTERRUPT_PRIVATE_H_ diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_timer.cpp b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_timer.cpp index a6255c9d9f4..d5191f66bf5 100644 --- a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_timer.cpp +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/arm_hal_timer.cpp @@ -1,5 +1,17 @@ /* - * Copyright (c) 2016 ARM Limited, All Rights Reserved + * Copyright (c) 2016-2018 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ // Include before mbed.h to properly get UINT*_C() diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/mbed_lib.json b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/mbed_lib.json index 091fa46ae63..86e1c91c8c6 100644 --- a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/mbed_lib.json +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/mbed_lib.json @@ -12,11 +12,14 @@ "critical-section-usable-from-interrupt": { "help": "Make critical section API usable from interrupt context. Else a mutex is used as locking primitive. Consult arm_hal_interrupt.c for possible side effects on interrupt latency.", "value": false - } - , + }, "event-loop-dispatch-from-application": { "help": "Application is responsible of message dispatch loop. Else launch a separate thread for event-loop.", "value": false + }, + "event-loop-use-mbed-events": { + "help": "Use Mbed OS global event queue for Nanostack event loop, rather than our own thread.", + "value": false } } } diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop.c b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop.c index 5883fe623ec..35e0c3e25dd 100644 --- a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop.c +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop.c @@ -1,8 +1,20 @@ /* - * Copyright (c) 2016 ARM Limited, All Rights Reserved + * Copyright (c) 2016-2018 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ -#include +#include "mbed_assert.h" #include "cmsis.h" #include "cmsis_os2.h" #include "mbed_rtos_storage.h" @@ -10,10 +22,12 @@ #include "eventOS_scheduler.h" +#include "ns_event_loop_mutex.h" #include "ns_event_loop.h" #define TRACE_GROUP "evlp" +#if !MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_USE_MBED_EVENTS #if MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_DISPATCH_FROM_APPLICATION @@ -50,40 +64,6 @@ static const osThreadAttr_t event_thread_attr = { static osThreadId_t event_thread_id; #endif -static mbed_rtos_storage_mutex_t event_mutex; -static const osMutexAttr_t event_mutex_attr = { - .name = "nanostack_event_mutex", - .attr_bits = osMutexRecursive | osMutexPrioInherit | osMutexRobust, - .cb_mem = &event_mutex, - .cb_size = sizeof event_mutex, -}; -static osMutexId_t event_mutex_id; -static osThreadId_t event_mutex_owner_id = NULL; -static uint32_t owner_count = 0; - -void eventOS_scheduler_mutex_wait(void) -{ - osMutexAcquire(event_mutex_id, osWaitForever); - if (0 == owner_count) { - event_mutex_owner_id = osThreadGetId(); - } - owner_count++; -} - -void eventOS_scheduler_mutex_release(void) -{ - owner_count--; - if (0 == owner_count) { - event_mutex_owner_id = NULL; - } - osMutexRelease(event_mutex_id); -} - -uint8_t eventOS_scheduler_mutex_is_owner(void) -{ - return osThreadGetId() == event_mutex_owner_id ? 1 : 0; -} - void eventOS_scheduler_signal(void) { // XXX why does signal set lock if called with irqs disabled? @@ -124,8 +104,7 @@ static void event_loop_thread(void *arg) // if it is not ran in a separate thread. void ns_event_loop_init(void) { - event_mutex_id = osMutexNew(&event_mutex_attr); - MBED_ASSERT(event_mutex_id != NULL); + ns_event_loop_mutex_init(); // If a separate event loop thread is not used, the signaling // happens via event flags instead of thread flags. This allows one to @@ -148,3 +127,5 @@ void ns_event_loop_thread_start(void) { } #endif + +#endif // !MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_USE_MBED_EVENTS diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop.h b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop.h index a22ca7c752a..8dc55bd7378 100644 --- a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop.h +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop.h @@ -1,5 +1,17 @@ /* - * Copyright (c) 2016 ARM Limited, All Rights Reserved + * Copyright (c) 2016-2018 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifdef __cplusplus diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop_mbed.cpp b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop_mbed.cpp new file mode 100644 index 00000000000..6953cb660d4 --- /dev/null +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop_mbed.cpp @@ -0,0 +1,97 @@ +/* + * Copyright (c) 2018 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mbed_assert.h" +#include "platform/arm_hal_interrupt.h" +#include "cmsis.h" +#include "cmsis_os2.h" +#include "mbed_rtos_storage.h" +#include "ns_trace.h" + +#include "eventOS_scheduler.h" + +#include "mbed_error.h" +#include "mbed_shared_queues.h" +#include "events/Event.h" +#include "ns_event_loop_mutex.h" +#include "ns_event_loop.h" + +#define TRACE_GROUP "evlp" + +#if MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_USE_MBED_EVENTS + +using events::EventQueue; +using events::Event; + +static Event *event; +static volatile int event_pending; +static volatile bool started; + +void eventOS_scheduler_signal(void) +{ + platform_enter_critical(); + if (started && event_pending == 0) { + event_pending = event->post(); + MBED_ASSERT(event_pending != 0); + } + platform_exit_critical(); +} + +void eventOS_scheduler_idle(void) +{ + error("Shouldn't be called"); +} + +static void do_dispatch_with_mutex_held() +{ + platform_enter_critical(); + event_pending = 0; + platform_exit_critical(); + + /* Process only 1 Nanostack event at a time, to try to be nice to + * others on the global queue. + */ + eventOS_scheduler_mutex_wait(); + bool dispatched = eventOS_scheduler_dispatch_event(); + eventOS_scheduler_mutex_release(); + + /* Go round again if (potentially) more */ + if (dispatched) { + eventOS_scheduler_signal(); + } +} + +void ns_event_loop_init(void) +{ + ns_event_loop_mutex_init(); +} + +void ns_event_loop_thread_create(void) +{ + EventQueue *equeue = mbed::mbed_event_queue(); + MBED_ASSERT(equeue != NULL); + + event = new Event(equeue, do_dispatch_with_mutex_held); + MBED_ASSERT(event != NULL); +} + +void ns_event_loop_thread_start(void) +{ + started = true; + eventOS_scheduler_signal(); +} + +#endif // MBED_CONF_NANOSTACK_HAL_EVENT_LOOP_USE_MBED_EVENTS diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop_mutex.c b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop_mutex.c new file mode 100644 index 00000000000..f4d91236fa2 --- /dev/null +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop_mutex.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2018 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "mbed_assert.h" +#include "cmsis.h" +#include "cmsis_os2.h" +#include "mbed_rtos_storage.h" +#include "ns_trace.h" + +#include "eventOS_scheduler.h" + +#include "ns_event_loop_mutex.h" + +#define TRACE_GROUP "evlm" + +static mbed_rtos_storage_mutex_t event_mutex; +static const osMutexAttr_t event_mutex_attr = { + .name = "nanostack_event_mutex", + .attr_bits = osMutexRecursive | osMutexPrioInherit | osMutexRobust, + .cb_mem = &event_mutex, + .cb_size = sizeof event_mutex, +}; +static osMutexId_t event_mutex_id; +static osThreadId_t event_mutex_owner_id = NULL; +static uint32_t owner_count = 0; + +void eventOS_scheduler_mutex_wait(void) +{ + osMutexAcquire(event_mutex_id, osWaitForever); + if (0 == owner_count) { + event_mutex_owner_id = osThreadGetId(); + } + owner_count++; +} + +void eventOS_scheduler_mutex_release(void) +{ + owner_count--; + if (0 == owner_count) { + event_mutex_owner_id = NULL; + } + osMutexRelease(event_mutex_id); +} + +uint8_t eventOS_scheduler_mutex_is_owner(void) +{ + return osThreadGetId() == event_mutex_owner_id ? 1 : 0; +} + +void ns_event_loop_mutex_init(void) +{ + event_mutex_id = osMutexNew(&event_mutex_attr); + MBED_ASSERT(event_mutex_id != NULL); +} + diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop_mutex.h b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop_mutex.h new file mode 100644 index 00000000000..ce3ac9beb6f --- /dev/null +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_event_loop_mutex.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** \internal Initialise the scheduler mutex + * + * Initialises the mutex used by the implementation of + * eventOS_scheduler_mutex_wait(). Must be called before scheduler is used. + */ +void ns_event_loop_mutex_init(void); + +#ifdef __cplusplus +} +#endif + diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_hal_init.c b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_hal_init.c index 54838c28bfa..566472a0dc8 100644 --- a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_hal_init.c +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_hal_init.c @@ -1,5 +1,17 @@ /* - * Copyright (c) 2016 ARM Limited, All Rights Reserved + * Copyright (c) 2016-2018 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #include "ns_types.h" diff --git a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_hal_init.h b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_hal_init.h index 38425e117ee..10991ce4c70 100644 --- a/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_hal_init.h +++ b/features/nanostack/nanostack-hal-mbed-cmsis-rtos/ns_hal_init.h @@ -1,5 +1,17 @@ /* - * Copyright (c) 2016 ARM Limited, All Rights Reserved + * Copyright (c) 2016-2018 ARM Limited. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #ifndef NS_HAL_INIT_H_ diff --git a/features/netsocket/nsapi_dns.cpp b/features/netsocket/nsapi_dns.cpp index c38d9ac0a67..60bb10a0e7d 100644 --- a/features/netsocket/nsapi_dns.cpp +++ b/features/netsocket/nsapi_dns.cpp @@ -111,12 +111,15 @@ static nsapi_addr_t dns_servers[DNS_SERVERS_SIZE] = { 0,0, 0,0, 0x1c,0x04, 0xb1,0x2f}}, }; +#if (MBED_CONF_NSAPI_DNS_CACHE_SIZE > 0) static DNS_CACHE *dns_cache[MBED_CONF_NSAPI_DNS_CACHE_SIZE]; +// Protects cache shared between blocking and asynchronous calls +static SingletonPtr dns_cache_mutex; +#endif + static uint16_t dns_message_id = 1; static int dns_unique_id = 1; static DNS_QUERY *dns_query_queue[DNS_QUERY_QUEUE_SIZE]; -// Protects cache shared between blocking and asynchronous calls -static SingletonPtr dns_cache_mutex; // Protects from several threads running asynchronous DNS static SingletonPtr dns_mutex; static SingletonPtr dns_call_in; @@ -306,6 +309,7 @@ static int dns_scan_response(const uint8_t *ptr, uint16_t exp_id, uint32_t *ttl, static void nsapi_dns_cache_add(const char *host, nsapi_addr_t *address, uint32_t ttl) { +#if (MBED_CONF_NSAPI_DNS_CACHE_SIZE > 0) // RFC 1034: if TTL is zero, entry is not added to cache if (ttl == 0) { return; @@ -354,12 +358,14 @@ static void nsapi_dns_cache_add(const char *host, nsapi_addr_t *address, uint32_ } dns_cache_mutex->unlock(); +#endif } static nsapi_error_t nsapi_dns_cache_find(const char *host, nsapi_version_t version, nsapi_addr_t *address) { nsapi_error_t ret_val = NSAPI_ERROR_NO_ADDRESS; +#if (MBED_CONF_NSAPI_DNS_CACHE_SIZE > 0) dns_cache_mutex->lock(); for (int i = 0; i < MBED_CONF_NSAPI_DNS_CACHE_SIZE; i++) { @@ -382,6 +388,7 @@ static nsapi_error_t nsapi_dns_cache_find(const char *host, nsapi_version_t vers } dns_cache_mutex->unlock(); +#endif return ret_val; } diff --git a/hal/TARGET_FLASH_CMSIS_ALGO/flash_common_algo.c b/hal/TARGET_FLASH_CMSIS_ALGO/flash_common_algo.c index ebdad9e4f17..8fdc6443c67 100644 --- a/hal/TARGET_FLASH_CMSIS_ALGO/flash_common_algo.c +++ b/hal/TARGET_FLASH_CMSIS_ALGO/flash_common_algo.c @@ -97,7 +97,7 @@ static int32_t flash_algo_uninit(flash_t *obj, uint32_t address, uint32_t functi * @param end_addr End address to check. Could be the same as start_addr to just check start_addr * for e.g. flash_erase_sector. * @return 0 for success, -1 for error - */ + */ static int32_t flash_check_nonsecure(flash_t *obj, uint32_t start_addr, uint32_t end_addr) { /* Check if end address wraps around */ @@ -107,14 +107,14 @@ static int32_t flash_check_nonsecure(flash_t *obj, uint32_t start_addr, uint32_t /* Check if start address is in non-secure flash */ if ((start_addr < obj->target_config_ns->flash_start) || - (start_addr >= (obj->target_config_ns->flash_start + obj->target_config_ns->flash_size))) { + (start_addr >= (obj->target_config_ns->flash_start + obj->target_config_ns->flash_size))) { return -1; } /* Check if end address is in non-secure flash */ if (end_addr != start_addr) { if ((end_addr < obj->target_config_ns->flash_start) || - (end_addr >= (obj->target_config_ns->flash_start + obj->target_config_ns->flash_size))) { + (end_addr >= (obj->target_config_ns->flash_start + obj->target_config_ns->flash_size))) { return -1; } } diff --git a/hal/TARGET_FLASH_CMSIS_ALGO/flash_data.h b/hal/TARGET_FLASH_CMSIS_ALGO/flash_data.h index c36014aceee..fe6732a673f 100644 --- a/hal/TARGET_FLASH_CMSIS_ALGO/flash_data.h +++ b/hal/TARGET_FLASH_CMSIS_ALGO/flash_data.h @@ -74,7 +74,7 @@ typedef struct { uint32_t pc; } args_t; -typedef int32_t (*flash_algo_jump_t)(args_t*); +typedef int32_t (*flash_algo_jump_t)(args_t *); // prototypes for flash algo CMSIS API diff --git a/hal/can_api.h b/hal/can_api.h index 723342f0821..7fb63905115 100644 --- a/hal/can_api.h +++ b/hal/can_api.h @@ -57,23 +57,23 @@ typedef void (*can_irq_handler)(uint32_t id, CanIrqType type); typedef struct can_s can_t; -void can_init (can_t *obj, PinName rd, PinName td); -void can_init_freq (can_t *obj, PinName rd, PinName td, int hz); -void can_free (can_t *obj); -int can_frequency (can_t *obj, int hz); - -void can_irq_init (can_t *obj, can_irq_handler handler, uint32_t id); -void can_irq_free (can_t *obj); -void can_irq_set (can_t *obj, CanIrqType irq, uint32_t enable); - -int can_write (can_t *obj, CAN_Message, int cc); -int can_read (can_t *obj, CAN_Message *msg, int handle); -int can_mode (can_t *obj, CanMode mode); +void can_init(can_t *obj, PinName rd, PinName td); +void can_init_freq(can_t *obj, PinName rd, PinName td, int hz); +void can_free(can_t *obj); +int can_frequency(can_t *obj, int hz); + +void can_irq_init(can_t *obj, can_irq_handler handler, uint32_t id); +void can_irq_free(can_t *obj); +void can_irq_set(can_t *obj, CanIrqType irq, uint32_t enable); + +int can_write(can_t *obj, CAN_Message, int cc); +int can_read(can_t *obj, CAN_Message *msg, int handle); +int can_mode(can_t *obj, CanMode mode); int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle); -void can_reset (can_t *obj); -unsigned char can_rderror (can_t *obj); -unsigned char can_tderror (can_t *obj); -void can_monitor (can_t *obj, int silent); +void can_reset(can_t *obj); +unsigned char can_rderror(can_t *obj); +unsigned char can_tderror(can_t *obj); +void can_monitor(can_t *obj, int silent); #ifdef __cplusplus }; diff --git a/hal/crc_api.h b/hal/crc_api.h index fbd0820adb8..2421e46315e 100644 --- a/hal/crc_api.h +++ b/hal/crc_api.h @@ -145,7 +145,7 @@ extern "C" { * * \return True if running if the polynomial is supported, false if not. */ -bool hal_crc_is_supported(const crc_mbed_config_t* config); +bool hal_crc_is_supported(const crc_mbed_config_t *config); /** Initialize the hardware CRC module with the given polynomial * @@ -177,7 +177,7 @@ bool hal_crc_is_supported(const crc_mbed_config_t* config); * hardware CRC module. For example, polynomial and initial seed * values. */ -void hal_crc_compute_partial_start(const crc_mbed_config_t* config); +void hal_crc_compute_partial_start(const crc_mbed_config_t *config); /** Writes data to the current CRC module. * diff --git a/hal/gpio_api.h b/hal/gpio_api.h index a99fdec048e..9f11937be40 100644 --- a/hal/gpio_api.h +++ b/hal/gpio_api.h @@ -86,7 +86,7 @@ int gpio_read(gpio_t *obj); * @param gpio The GPIO object * @param pin The pin name */ -void gpio_init_in(gpio_t* gpio, PinName pin); +void gpio_init_in(gpio_t *gpio, PinName pin); /** Init the input pin and set the mode * @@ -94,7 +94,7 @@ void gpio_init_in(gpio_t* gpio, PinName pin); * @param pin The pin name * @param mode The pin mode to be set */ -void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode); +void gpio_init_in_ex(gpio_t *gpio, PinName pin, PinMode mode); /** Init the output pin as an output, with predefined output value 0 * @@ -102,7 +102,7 @@ void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode); * @param pin The pin name * @return An integer value 1 or 0 */ -void gpio_init_out(gpio_t* gpio, PinName pin); +void gpio_init_out(gpio_t *gpio, PinName pin); /** Init the pin as an output and set the output value * @@ -110,7 +110,7 @@ void gpio_init_out(gpio_t* gpio, PinName pin); * @param pin The pin name * @param value The value to be set */ -void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value); +void gpio_init_out_ex(gpio_t *gpio, PinName pin, int value); /** Init the pin to be in/out * @@ -120,7 +120,7 @@ void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value); * @param mode The pin mode to be set * @param value The value to be set for an output pin */ -void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value); +void gpio_init_inout(gpio_t *gpio, PinName pin, PinDirection direction, PinMode mode, int value); /**@}*/ diff --git a/hal/i2c_api.h b/hal/i2c_api.h index 70121930fe1..18f902369e2 100644 --- a/hal/i2c_api.h +++ b/hal/i2c_api.h @@ -58,8 +58,8 @@ typedef struct i2c_s i2c_t; #endif enum { - I2C_ERROR_NO_SLAVE = -1, - I2C_ERROR_BUS_BUSY = -2 + I2C_ERROR_NO_SLAVE = -1, + I2C_ERROR_BUS_BUSY = -2 }; #ifdef __cplusplus @@ -73,7 +73,7 @@ extern "C" { /** Initialize the I2C peripheral. It sets the default parameters for I2C * peripheral, and configures its specifieds pins. - * + * * @param obj The I2C object * @param sda The sda pin * @param scl The scl pin @@ -117,7 +117,7 @@ int i2c_read(i2c_t *obj, int address, char *data, int length, int stop); * @param data The buffer for sending * @param length Number of bytes to write * @param stop Stop to be generated after the transfer is done - * @return + * @return * zero or non-zero - Number of written bytes * negative - I2C_ERROR_XXX status */ diff --git a/hal/itm_api.h b/hal/itm_api.h index c773963fd2c..38607789cee 100644 --- a/hal/itm_api.h +++ b/hal/itm_api.h @@ -22,6 +22,7 @@ #if defined(DEVICE_ITM) #include +#include #ifdef __cplusplus extern "C" { @@ -38,15 +39,15 @@ enum { /** * @brief Target specific initialization function. - * This function is responsible for initializing and configuring - * the debug clock for the ITM and setting up the SWO pin for + * This function is responsible for initializing and configuring + * the debug clock for the ITM and setting up the SWO pin for * debug output. - * + * * The only Cortex-M register that should be modified is the clock * prescaler in TPI->ACPR. - * - * The generic mbed_itm_init initialization function will setup: - * + * + * The generic mbed_itm_init initialization function will setup: + * * ITM->LAR * ITM->TPR * ITM->TCR @@ -54,7 +55,7 @@ enum { * TPI->SPPR * TPI->FFCR * DWT->CTRL - * + * * for SWO output on stimulus port 0. */ void itm_init(void); @@ -68,12 +69,26 @@ void mbed_itm_init(void); * @brief Send data over ITM stimulus port. * * @param[in] port The stimulus port to send data over. - * @param[in] data The data to send. + * @param[in] data The 32-bit data to send. + * + * The data is written as a single 32-bit write to the port. * * @return value of data sent. */ uint32_t mbed_itm_send(uint32_t port, uint32_t data); +/** + * @brief Send a block of data over ITM stimulus port. + * + * @param[in] port The stimulus port to send data over. + * @param[in] data The block of data to send. + * @param[in] len The number of bytes of data to send. + * + * The data is written using multiple appropriately-sized port accesses for + * efficient transfer. + */ +void mbed_itm_send_block(uint32_t port, const void *data, size_t len); + /**@}*/ #ifdef __cplusplus diff --git a/hal/lp_ticker_api.h b/hal/lp_ticker_api.h index 30a243edebd..374990803cb 100644 --- a/hal/lp_ticker_api.h +++ b/hal/lp_ticker_api.h @@ -79,7 +79,7 @@ ticker_irq_handler_type set_lp_ticker_irq_handler(ticker_irq_handler_type ticker * * @return The low power ticker data */ -const ticker_data_t* get_lp_ticker_data(void); +const ticker_data_t *get_lp_ticker_data(void); /** The wrapper for ticker_irq_handler, to pass lp ticker's data * @@ -207,7 +207,7 @@ void lp_ticker_disable_interrupt(void); void lp_ticker_clear_interrupt(void); /** Set pending interrupt that should be fired right away. - * + * * Pseudo Code: * @code * void lp_ticker_fire_interrupt(void) @@ -232,7 +232,7 @@ void lp_ticker_fire_interrupt(void); * } * @endcode */ -const ticker_info_t* lp_ticker_get_info(void); +const ticker_info_t *lp_ticker_get_info(void); /**@}*/ diff --git a/hal/mbed_gpio.c b/hal/mbed_gpio.c index b9dda3f1b3b..7bf52dd76d1 100644 --- a/hal/mbed_gpio.c +++ b/hal/mbed_gpio.c @@ -15,7 +15,7 @@ */ #include "hal/gpio_api.h" -static inline void _gpio_init_in(gpio_t* gpio, PinName pin, PinMode mode) +static inline void _gpio_init_in(gpio_t *gpio, PinName pin, PinMode mode) { gpio_init(gpio, pin); if (pin != NC) { @@ -24,7 +24,7 @@ static inline void _gpio_init_in(gpio_t* gpio, PinName pin, PinMode mode) } } -static inline void _gpio_init_out(gpio_t* gpio, PinName pin, PinMode mode, int value) +static inline void _gpio_init_out(gpio_t *gpio, PinName pin, PinMode mode, int value) { gpio_init(gpio, pin); if (pin != NC) { @@ -34,27 +34,33 @@ static inline void _gpio_init_out(gpio_t* gpio, PinName pin, PinMode mode, int v } } -void gpio_init_in(gpio_t* gpio, PinName pin) { +void gpio_init_in(gpio_t *gpio, PinName pin) +{ gpio_init_in_ex(gpio, pin, PullDefault); } -void gpio_init_in_ex(gpio_t* gpio, PinName pin, PinMode mode) { +void gpio_init_in_ex(gpio_t *gpio, PinName pin, PinMode mode) +{ _gpio_init_in(gpio, pin, mode); } -void gpio_init_out(gpio_t* gpio, PinName pin) { +void gpio_init_out(gpio_t *gpio, PinName pin) +{ gpio_init_out_ex(gpio, pin, 0); } -void gpio_init_out_ex(gpio_t* gpio, PinName pin, int value) { +void gpio_init_out_ex(gpio_t *gpio, PinName pin, int value) +{ _gpio_init_out(gpio, pin, PullNone, value); } -void gpio_init_inout(gpio_t* gpio, PinName pin, PinDirection direction, PinMode mode, int value) { +void gpio_init_inout(gpio_t *gpio, PinName pin, PinDirection direction, PinMode mode, int value) +{ if (direction == PIN_INPUT) { _gpio_init_in(gpio, pin, mode); - if (pin != NC) - gpio_write(gpio, value); // we prepare the value in case it is switched later + if (pin != NC) { + gpio_write(gpio, value); // we prepare the value in case it is switched later + } } else { _gpio_init_out(gpio, pin, mode, value); } diff --git a/hal/mbed_itm_api.c b/hal/mbed_itm_api.c index 5826570be21..17afe5e1562 100644 --- a/hal/mbed_itm_api.c +++ b/hal/mbed_itm_api.c @@ -21,7 +21,11 @@ #include -#define ITM_ENABLE_WRITE 0xC5ACCE55 +#ifndef ITM_STIM_FIFOREADY_Msk +#define ITM_STIM_FIFOREADY_Msk 1 +#endif + +#define ITM_ENABLE_WRITE 0xC5ACCE55 #define SWO_NRZ 0x02 #define SWO_STIMULUS_PORT 0x01 @@ -56,32 +60,74 @@ void mbed_itm_init(void) ITM->TPR = 0x0; /* Trace Control Register */ - ITM->TCR = (1 << ITM_TCR_TraceBusID_Pos) | - (1 << ITM_TCR_DWTENA_Pos) | + ITM->TCR = (1 << ITM_TCR_TraceBusID_Pos) | + (1 << ITM_TCR_DWTENA_Pos) | (1 << ITM_TCR_SYNCENA_Pos) | (1 << ITM_TCR_ITMENA_Pos); /* Trace Enable Register */ - ITM->TER = SWO_STIMULUS_PORT; + ITM->TER = SWO_STIMULUS_PORT; + } +} + +static void itm_out8(uint32_t port, uint8_t data) +{ + /* Wait until port is available */ + while ((ITM->PORT[port].u32 & ITM_STIM_FIFOREADY_Msk) == 0) { + __NOP(); + } + + /* write data to port */ + ITM->PORT[port].u8 = data; +} + +static void itm_out32(uint32_t port, uint32_t data) +{ + /* Wait until port is available */ + while ((ITM->PORT[port].u32 & ITM_STIM_FIFOREADY_Msk) == 0) { + __NOP(); } + + /* write data to port */ + ITM->PORT[port].u32 = data; } uint32_t mbed_itm_send(uint32_t port, uint32_t data) { /* Check if ITM and port is enabled */ if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ - ((ITM->TER & (1UL << port) ) != 0UL) ) /* ITM Port enabled */ - { - /* write data to port */ - ITM->PORT[port].u32 = data; - - /* Wait until data has been clocked out */ - while (ITM->PORT[port].u32 == 0UL) { - __NOP(); - } + ((ITM->TER & (1UL << port)) != 0UL)) { /* ITM Port enabled */ + itm_out32(port, data); } return data; } +void mbed_itm_send_block(uint32_t port, const void *data, size_t len) +{ + const char *ptr = data; + + /* Check if ITM and port is enabled */ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & (1UL << port)) != 0UL)) { /* ITM Port enabled */ + /* Output single byte at a time until data is aligned */ + while ((((uintptr_t) ptr) & 3) && len != 0) { + itm_out8(port, *ptr++); + len--; + } + + /* Output bulk of data one word at a time */ + while (len >= 4) { + itm_out32(port, *(const uint32_t *) ptr); + ptr += 4; + len -= 4; + } + + /* Output any trailing bytes */ + while (len != 0) { + itm_out8(port, *ptr++); + len--; + } + } +} #endif // defined(DEVICE_ITM) diff --git a/hal/mbed_lp_ticker_api.c b/hal/mbed_lp_ticker_api.c index 020d36454e1..f9cf2b272ea 100644 --- a/hal/mbed_lp_ticker_api.c +++ b/hal/mbed_lp_ticker_api.c @@ -42,7 +42,7 @@ static const ticker_data_t lp_data = { .queue = &events, }; -const ticker_data_t* get_lp_ticker_data(void) +const ticker_data_t *get_lp_ticker_data(void) { return &lp_data; } diff --git a/hal/mbed_lp_ticker_wrapper.cpp b/hal/mbed_lp_ticker_wrapper.cpp index 53817bf1522..9c1a2b47289 100644 --- a/hal/mbed_lp_ticker_wrapper.cpp +++ b/hal/mbed_lp_ticker_wrapper.cpp @@ -43,7 +43,7 @@ static void init_local() { MBED_ASSERT(core_util_in_critical_section()); - const ticker_info_t* info = lp_ticker_get_info(); + const ticker_info_t *info = lp_ticker_get_info(); if (info->bits >= 32) { mask = 0xffffffff; } else { diff --git a/hal/mbed_pinmap_common.c b/hal/mbed_pinmap_common.c index 1cb369f7e71..18056075021 100644 --- a/hal/mbed_pinmap_common.c +++ b/hal/mbed_pinmap_common.c @@ -16,9 +16,11 @@ #include "hal/pinmap.h" #include "platform/mbed_error.h" -void pinmap_pinout(PinName pin, const PinMap *map) { - if (pin == NC) +void pinmap_pinout(PinName pin, const PinMap *map) +{ + if (pin == NC) { return; + } while (map->pin != NC) { if (map->pin == pin) { @@ -32,58 +34,72 @@ void pinmap_pinout(PinName pin, const PinMap *map) { MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_PINMAP_INVALID), "could not pinout", pin); } -uint32_t pinmap_merge(uint32_t a, uint32_t b) { +uint32_t pinmap_merge(uint32_t a, uint32_t b) +{ // both are the same (inc both NC) - if (a == b) + if (a == b) { return a; + } // one (or both) is not connected - if (a == (uint32_t)NC) + if (a == (uint32_t)NC) { return b; - if (b == (uint32_t)NC) + } + if (b == (uint32_t)NC) { return a; + } // mis-match error case MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_PINMAP_INVALID), "pinmap mis-match", a); return (uint32_t)NC; } -uint32_t pinmap_find_peripheral(PinName pin, const PinMap* map) { +uint32_t pinmap_find_peripheral(PinName pin, const PinMap *map) +{ while (map->pin != NC) { - if (map->pin == pin) + if (map->pin == pin) { return map->peripheral; + } map++; } return (uint32_t)NC; } -uint32_t pinmap_peripheral(PinName pin, const PinMap* map) { +uint32_t pinmap_peripheral(PinName pin, const PinMap *map) +{ uint32_t peripheral = (uint32_t)NC; - if (pin == (PinName)NC) + if (pin == (PinName)NC) { return (uint32_t)NC; + } peripheral = pinmap_find_peripheral(pin, map); - if ((uint32_t)NC == peripheral) // no mapping available + if ((uint32_t)NC == peripheral) { // no mapping available MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_PINMAP_INVALID), "pinmap not found for peripheral", peripheral); + } return peripheral; } -uint32_t pinmap_find_function(PinName pin, const PinMap* map) { +uint32_t pinmap_find_function(PinName pin, const PinMap *map) +{ while (map->pin != NC) { - if (map->pin == pin) + if (map->pin == pin) { return map->function; + } map++; } return (uint32_t)NC; } -uint32_t pinmap_function(PinName pin, const PinMap* map) { +uint32_t pinmap_function(PinName pin, const PinMap *map) +{ uint32_t function = (uint32_t)NC; - if (pin == (PinName)NC) + if (pin == (PinName)NC) { return (uint32_t)NC; + } function = pinmap_find_function(pin, map); - if ((uint32_t)NC == function) // no mapping available + if ((uint32_t)NC == function) { // no mapping available MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_PINMAP_INVALID), "pinmap not found for function", function); + } return function; } diff --git a/hal/mbed_sleep_manager.c b/hal/mbed_sleep_manager.c index 12cd7cfb000..d485965da67 100644 --- a/hal/mbed_sleep_manager.c +++ b/hal/mbed_sleep_manager.c @@ -82,7 +82,7 @@ typedef struct sleep_statistic { static sleep_statistic_t sleep_stats[STATISTIC_COUNT]; -static sleep_statistic_t* sleep_tracker_find(const char *const filename) +static sleep_statistic_t *sleep_tracker_find(const char *const filename) { for (int i = 0; i < STATISTIC_COUNT; ++i) { if (sleep_stats[i].identifier == filename) { @@ -93,7 +93,7 @@ static sleep_statistic_t* sleep_tracker_find(const char *const filename) return NULL; } -static sleep_statistic_t* sleep_tracker_add(const char* const filename) +static sleep_statistic_t *sleep_tracker_add(const char *const filename) { for (int i = 0; i < STATISTIC_COUNT; ++i) { if (sleep_stats[i].identifier == NULL) { @@ -121,7 +121,7 @@ static void sleep_tracker_print_stats(void) } debug("[id: %s, count: %u]\r\n", sleep_stats[i].identifier, - sleep_stats[i].count); + sleep_stats[i].count); } } @@ -139,7 +139,7 @@ void sleep_tracker_lock(const char *const filename, int line) debug("LOCK: %s, ln: %i, lock count: %u\r\n", filename, line, deep_sleep_lock); } -void sleep_tracker_unlock(const char* const filename, int line) +void sleep_tracker_unlock(const char *const filename, int line) { sleep_statistic_t *stat = sleep_tracker_find(filename); diff --git a/hal/mbed_ticker_api.c b/hal/mbed_ticker_api.c index 2fdf280b345..c9bf84e6827 100644 --- a/hal/mbed_ticker_api.c +++ b/hal/mbed_ticker_api.c @@ -23,13 +23,13 @@ static void schedule_interrupt(const ticker_data_t *const ticker); static void update_present_time(const ticker_data_t *const ticker); /* - * Initialize a ticker instance. + * Initialize a ticker instance. */ static void initialize(const ticker_data_t *ticker) { - // return if the queue has already been initialized, in that case the + // return if the queue has already been initialized, in that case the // interface used by the queue is already initialized. - if (ticker->queue->initialized) { + if (ticker->queue->initialized) { return; } @@ -57,7 +57,7 @@ static void initialize(const ticker_data_t *ticker) } uint32_t max_delta = 0x7 << (bits - 4); // 7/16th uint64_t max_delta_us = - ((uint64_t)max_delta * 1000000 + frequency - 1) / frequency; + ((uint64_t)max_delta * 1000000 + frequency - 1) / frequency; ticker->queue->event_handler = NULL; ticker->queue->head = NULL; @@ -70,13 +70,13 @@ static void initialize(const ticker_data_t *ticker) ticker->queue->max_delta_us = max_delta_us; ticker->queue->present_time = 0; ticker->queue->initialized = true; - + update_present_time(ticker); schedule_interrupt(ticker); } /** - * Set the event handler function of a ticker instance. + * Set the event handler function of a ticker instance. */ static void set_handler(const ticker_data_t *const ticker, ticker_event_handler handler) { @@ -86,18 +86,18 @@ static void set_handler(const ticker_data_t *const ticker, ticker_event_handler /* * Convert a 32 bit timestamp into a 64 bit timestamp. * - * A 64 bit timestamp is used as the point of time of reference while the - * timestamp to convert is relative to this point of time. + * A 64 bit timestamp is used as the point of time of reference while the + * timestamp to convert is relative to this point of time. + * + * The lower 32 bits of the timestamp returned will be equal to the timestamp to + * convert. * - * The lower 32 bits of the timestamp returned will be equal to the timestamp to - * convert. - * - * If the timestamp to convert is less than the lower 32 bits of the time - * reference then the timestamp to convert is seen as an overflowed value and - * the upper 32 bit of the timestamp returned will be equal to the upper 32 bit - * of the reference point + 1. - * Otherwise, the upper 32 bit returned will be equal to the upper 32 bit of the - * reference point. + * If the timestamp to convert is less than the lower 32 bits of the time + * reference then the timestamp to convert is seen as an overflowed value and + * the upper 32 bit of the timestamp returned will be equal to the upper 32 bit + * of the reference point + 1. + * Otherwise, the upper 32 bit returned will be equal to the upper 32 bit of the + * reference point. * * @param ref: The 64 bit timestamp of reference. * @param timestamp: The timestamp to convert. @@ -107,8 +107,8 @@ static us_timestamp_t convert_timestamp(us_timestamp_t ref, timestamp_t timestam bool overflow = timestamp < ((timestamp_t) ref) ? true : false; us_timestamp_t result = (ref & ~((us_timestamp_t)UINT32_MAX)) | timestamp; - if (overflow) { - result += (1ULL<<32); + if (overflow) { + result += (1ULL << 32); } return result; @@ -214,15 +214,15 @@ int _ticker_match_interval_passed(timestamp_t prev_tick, timestamp_t cur_tick, t } /** - * Compute the time when the interrupt has to be triggered and schedule it. - * - * If there is no event in the queue or the next event to execute is in more + * Compute the time when the interrupt has to be triggered and schedule it. + * + * If there is no event in the queue or the next event to execute is in more * than ticker.queue.max_delta ticks from now then the ticker irq will be * scheduled in ticker.queue.max_delta ticks. Otherwise the irq will be * scheduled to happen when the running counter reach the timestamp of the * first event in the queue. - * - * @note If there is no event in the queue then the interrupt is scheduled to + * + * @note If there is no event in the queue then the interrupt is scheduled to * in ticker.queue.max_delta. This is necessary to keep track * of the timer overflow. */ @@ -259,7 +259,7 @@ static void schedule_interrupt(const ticker_data_t *const ticker) } } else { uint32_t match_tick = - (queue->tick_last_read + queue->max_delta) & queue->bitmask; + (queue->tick_last_read + queue->max_delta) & queue->bitmask; ticker->interface->set_interrupt(match_tick); } } @@ -285,10 +285,10 @@ void ticker_irq_handler(const ticker_data_t *const ticker) break; } - // update the current timestamp used by the queue + // update the current timestamp used by the queue update_present_time(ticker); - if (ticker->queue->head->timestamp <= ticker->queue->present_time) { + if (ticker->queue->head->timestamp <= ticker->queue->present_time) { // This event was in the past: // point to the following one and execute its handler ticker_event_t *p = ticker->queue->head; @@ -300,7 +300,7 @@ void ticker_irq_handler(const ticker_data_t *const ticker) * event handler may have altered the chain of pending events. */ } else { break; - } + } } schedule_interrupt(ticker); @@ -315,13 +315,13 @@ void ticker_insert_event(const ticker_data_t *const ticker, ticker_event_t *obj, // update the current timestamp update_present_time(ticker); us_timestamp_t absolute_timestamp = convert_timestamp( - ticker->queue->present_time, - timestamp - ); + ticker->queue->present_time, + timestamp + ); // defer to ticker_insert_event_us ticker_insert_event_us( - ticker, + ticker, obj, absolute_timestamp, id ); @@ -352,7 +352,7 @@ void ticker_insert_event_us(const ticker_data_t *const ticker, ticker_event_t *o prev = p; p = p->next; } - + /* if we're at the end p will be NULL, which is correct */ obj->next = p; @@ -378,7 +378,7 @@ void ticker_remove_event(const ticker_data_t *const ticker, ticker_event_t *obj) schedule_interrupt(ticker); } else { // find the object before me, then drop me - ticker_event_t* p = ticker->queue->head; + ticker_event_t *p = ticker->queue->head; while (p != NULL) { if (p->next == obj) { p->next = obj->next; diff --git a/hal/mbed_us_ticker_api.c b/hal/mbed_us_ticker_api.c index 69b533482bd..9b025fa3f84 100644 --- a/hal/mbed_us_ticker_api.c +++ b/hal/mbed_us_ticker_api.c @@ -34,7 +34,7 @@ static const ticker_data_t us_data = { .queue = &events }; -const ticker_data_t* get_us_ticker_data(void) +const ticker_data_t *get_us_ticker_data(void) { return &us_data; } diff --git a/hal/pinmap.h b/hal/pinmap.h index 844a4cbbec1..4b3db4afa4b 100644 --- a/hal/pinmap.h +++ b/hal/pinmap.h @@ -32,14 +32,14 @@ typedef struct { } PinMap; void pin_function(PinName pin, int function); -void pin_mode (PinName pin, PinMode mode); - -uint32_t pinmap_peripheral(PinName pin, const PinMap* map); -uint32_t pinmap_function(PinName pin, const PinMap* map); -uint32_t pinmap_merge (uint32_t a, uint32_t b); -void pinmap_pinout (PinName pin, const PinMap *map); -uint32_t pinmap_find_peripheral(PinName pin, const PinMap* map); -uint32_t pinmap_find_function(PinName pin, const PinMap* map); +void pin_mode(PinName pin, PinMode mode); + +uint32_t pinmap_peripheral(PinName pin, const PinMap *map); +uint32_t pinmap_function(PinName pin, const PinMap *map); +uint32_t pinmap_merge(uint32_t a, uint32_t b); +void pinmap_pinout(PinName pin, const PinMap *map); +uint32_t pinmap_find_peripheral(PinName pin, const PinMap *map); +uint32_t pinmap_find_function(PinName pin, const PinMap *map); #ifdef __cplusplus } diff --git a/hal/sleep_api.h b/hal/sleep_api.h index 88c38750052..bc484d6f1bf 100644 --- a/hal/sleep_api.h +++ b/hal/sleep_api.h @@ -73,7 +73,7 @@ extern "C" { * The processor can be woken up by any internal peripheral interrupt or external pin interrupt. * * The wake-up time shall be less than 10 us. - * + * */ void hal_sleep(void); diff --git a/hal/ticker_api.h b/hal/ticker_api.h index 8b2c9ffccb0..661bd809955 100644 --- a/hal/ticker_api.h +++ b/hal/ticker_api.h @@ -80,7 +80,7 @@ typedef struct { uint64_t tick_remainder; /**< Ticks that have not been added to base_time */ us_timestamp_t present_time; /**< Store the timestamp used for present time */ bool initialized; /**< Indicate if the instance is initialized */ - uint8_t frequency_shifts; /**< If frequency is a value of 2^n, this is n, otherwise 0 */ + uint8_t frequency_shifts; /**< If frequency is a value of 2^n, this is n, otherwise 0 */ } ticker_event_queue_t; /** Ticker's data structure diff --git a/hal/us_ticker_api.h b/hal/us_ticker_api.h index 3b40805b9be..77f43580f0e 100644 --- a/hal/us_ticker_api.h +++ b/hal/us_ticker_api.h @@ -102,7 +102,7 @@ extern "C" { * @ingroup hal_lp_ticker */ - + typedef void (*ticker_irq_handler_type)(const ticker_data_t *const); /** Set ticker IRQ handler @@ -121,7 +121,7 @@ ticker_irq_handler_type set_us_ticker_irq_handler(ticker_irq_handler_type ticker * * @return The microsecond ticker data */ -const ticker_data_t* get_us_ticker_data(void); +const ticker_data_t *get_us_ticker_data(void); /** The wrapper for ticker_irq_handler, to pass us ticker's data @@ -269,7 +269,7 @@ void us_ticker_fire_interrupt(void); * } * @endcode */ -const ticker_info_t* us_ticker_get_info(void); +const ticker_info_t *us_ticker_get_info(void); /**@}*/ diff --git a/mbed.h b/mbed.h index 84f276b6d85..a1553b7d840 100644 --- a/mbed.h +++ b/mbed.h @@ -16,23 +16,8 @@ #ifndef MBED_H #define MBED_H -#define MBED_LIBRARY_VERSION 163 +#include "platform/mbed_version.h" -#if MBED_CONF_RTOS_PRESENT -// RTOS present, this is valid only for mbed OS 5 -#define MBED_MAJOR_VERSION 5 -#define MBED_MINOR_VERSION 9 -#define MBED_PATCH_VERSION 2 - -#else -// mbed 2 -#define MBED_MAJOR_VERSION 2 -#define MBED_MINOR_VERSION 0 -#define MBED_PATCH_VERSION MBED_LIBRARY_VERSION -#endif - -#define MBED_ENCODE_VERSION(major, minor, patch) ((major)*10000 + (minor)*100 + (patch)) -#define MBED_VERSION MBED_ENCODE_VERSION(MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION) #if MBED_CONF_RTOS_PRESENT #include "rtos/rtos.h" #endif diff --git a/platform/ATCmdParser.cpp b/platform/ATCmdParser.cpp index 30a4b8fa2b8..9c422b3438d 100644 --- a/platform/ATCmdParser.cpp +++ b/platform/ATCmdParser.cpp @@ -79,7 +79,7 @@ void ATCmdParser::flush() int ATCmdParser::write(const char *data, int size) { int i = 0; - for ( ; i < size; i++) { + for (; i < size; i++) { if (putc(data[i]) < 0) { return -1; } @@ -90,7 +90,7 @@ int ATCmdParser::write(const char *data, int size) int ATCmdParser::read(char *data, int size) { int i = 0; - for ( ; i < size; i++) { + for (; i < size; i++) { int c = getc(); if (c < 0) { return -1; @@ -110,7 +110,7 @@ int ATCmdParser::vprintf(const char *format, va_list args) } int i = 0; - for ( ; _buffer[i]; i++) { + for (; _buffer[i]; i++) { if (putc(_buffer[i]) < 0) { return -1; } @@ -128,7 +128,7 @@ int ATCmdParser::vscanf(const char *format, va_list args) int offset = 0; while (format[i]) { - if (format[i] == '%' && format[i+1] != '%' && format[i+1] != '*') { + if (format[i] == '%' && format[i + 1] != '%' && format[i + 1] != '*') { _buffer[offset++] = '%'; _buffer[offset++] = '*'; i++; @@ -155,7 +155,7 @@ int ATCmdParser::vscanf(const char *format, va_list args) while (true) { // Ran out of space - if (j+1 >= _buffer_size - offset) { + if (j + 1 >= _buffer_size - offset) { return false; } // Receive next character @@ -168,12 +168,12 @@ int ATCmdParser::vscanf(const char *format, va_list args) // Check for match int count = -1; - sscanf(_buffer+offset, _buffer, &count); + sscanf(_buffer + offset, _buffer, &count); // We only succeed if all characters in the response are matched if (count == j) { // Store the found results - vsscanf(_buffer+offset, format, args); + vsscanf(_buffer + offset, format, args); return j; } } @@ -220,14 +220,14 @@ bool ATCmdParser::vrecv(const char *response, va_list args) bool whole_line_wanted = false; while (response[i]) { - if (response[i] == '%' && response[i+1] != '%' && response[i+1] != '*') { + if (response[i] == '%' && response[i + 1] != '%' && response[i + 1] != '*') { _buffer[offset++] = '%'; _buffer[offset++] = '*'; i++; } else { _buffer[offset++] = response[i++]; // Find linebreaks, taking care not to be fooled if they're in a %[^\n] conversion specification - if (response[i - 1] == '\n' && !(i >= 3 && response[i-3] == '[' && response[i-2] == '^')) { + if (response[i - 1] == '\n' && !(i >= 3 && response[i - 3] == '[' && response[i - 2] == '^')) { whole_line_wanted = true; break; } @@ -260,7 +260,7 @@ bool ATCmdParser::vrecv(const char *response, va_list args) } // Simplify newlines (borrowed from retarget.cpp) if ((c == CR && _in_prev != LF) || - (c == LF && _in_prev != CR)) { + (c == LF && _in_prev != CR)) { _in_prev = c; c = '\n'; } else if ((c == CR && _in_prev == LF) || @@ -277,7 +277,7 @@ bool ATCmdParser::vrecv(const char *response, va_list args) // Check for oob data for (struct oob *oob = _oobs; oob; oob = oob->next) { if ((unsigned)j == oob->len && memcmp( - oob->prefix, _buffer+offset, oob->len) == 0) { + oob->prefix, _buffer + offset, oob->len) == 0) { debug_if(_dbg_on, "AT! %s\n", oob->prefix); oob->cb(); @@ -298,18 +298,18 @@ bool ATCmdParser::vrecv(const char *response, va_list args) // This allows recv("Foo: %s\n") to work, and not match with just the first character of a string // (scanf does not itself match whitespace in its format string, so \n is not significant to it) } else { - sscanf(_buffer+offset, _buffer, &count); + sscanf(_buffer + offset, _buffer, &count); } // We only succeed if all characters in the response are matched if (count == j) { - debug_if(_dbg_on, "AT= %s\n", _buffer+offset); + debug_if(_dbg_on, "AT= %s\n", _buffer + offset); // Reuse the front end of the buffer memcpy(_buffer, response, i); _buffer[i] = 0; // Store the found results - vsscanf(_buffer+offset, _buffer, args); + vsscanf(_buffer + offset, _buffer, args); // Jump to next line and continue parsing response += i; @@ -318,8 +318,8 @@ bool ATCmdParser::vrecv(const char *response, va_list args) // Clear the buffer when we hit a newline or ran out of space // running out of space usually means we ran into binary data - if (c == '\n' || j+1 >= _buffer_size - offset) { - debug_if(_dbg_on, "AT< %s", _buffer+offset); + if (c == '\n' || j + 1 >= _buffer_size - offset) { + debug_if(_dbg_on, "AT< %s", _buffer + offset); j = 0; } } @@ -396,7 +396,7 @@ bool ATCmdParser::process_oob() } // Simplify newlines (borrowed from retarget.cpp) if ((c == CR && _in_prev != LF) || - (c == LF && _in_prev != CR)) { + (c == LF && _in_prev != CR)) { _in_prev = c; c = '\n'; } else if ((c == CR && _in_prev == LF) || @@ -414,17 +414,17 @@ bool ATCmdParser::process_oob() struct oob *oob = _oobs; while (oob) { if (i == (int)oob->len && memcmp( - oob->prefix, _buffer, oob->len) == 0) { + oob->prefix, _buffer, oob->len) == 0) { debug_if(_dbg_on, "AT! %s\r\n", oob->prefix); oob->cb(); return true; } oob = oob->next; } - + // Clear the buffer when we hit a newline or ran out of space // running out of space usually means we ran into binary data - if (((i+1) >= _buffer_size) || (c == '\n')) { + if (((i + 1) >= _buffer_size) || (c == '\n')) { debug_if(_dbg_on, "AT< %s", _buffer); i = 0; } diff --git a/platform/ATCmdParser.h b/platform/ATCmdParser.h index 47e1badf9fa..40adea9c84a 100644 --- a/platform/ATCmdParser.h +++ b/platform/ATCmdParser.h @@ -52,8 +52,7 @@ namespace mbed { * @endcode */ -class ATCmdParser : private NonCopyable -{ +class ATCmdParser : private NonCopyable { private: // File handle // Not owned by ATCmdParser @@ -90,8 +89,8 @@ class ATCmdParser : private NonCopyable * @param debug turns on/off debug output for AT commands */ ATCmdParser(FileHandle *fh, const char *output_delimiter = "\r", - int buffer_size = 256, int timeout = 8000, bool debug = false) - : _fh(fh), _buffer_size(buffer_size), _in_prev(0), _oobs(NULL) + int buffer_size = 256, int timeout = 8000, bool debug = false) + : _fh(fh), _buffer_size(buffer_size), _in_prev(0), _oobs(NULL) { _buffer = new char[buffer_size]; set_timeout(timeout); @@ -198,7 +197,7 @@ class ATCmdParser : private NonCopyable * @param ... all printf-like arguments to insert into command * @return true only if command is successfully sent */ - bool send(const char *command, ...) MBED_PRINTF_METHOD(1,2); + bool send(const char *command, ...) MBED_PRINTF_METHOD(1, 2); bool vsend(const char *command, va_list args); @@ -216,7 +215,7 @@ class ATCmdParser : private NonCopyable * @param ... all scanf-like arguments to extract from response * @return true only if response is successfully matched */ - bool recv(const char *response, ...) MBED_SCANF_METHOD(1,2); + bool recv(const char *response, ...) MBED_SCANF_METHOD(1, 2); bool vrecv(const char *response, va_list args); @@ -261,7 +260,7 @@ class ATCmdParser : private NonCopyable * @param ... arguments to printf * @return number of bytes written or -1 on failure */ - int printf(const char *format, ...) MBED_PRINTF_METHOD(1,2); + int printf(const char *format, ...) MBED_PRINTF_METHOD(1, 2); int vprintf(const char *format, va_list args); @@ -273,7 +272,7 @@ class ATCmdParser : private NonCopyable * @param ... arguments to scanf * @return number of bytes read or -1 on failure */ - int scanf(const char *format, ...) MBED_SCANF_METHOD(1,2); + int scanf(const char *format, ...) MBED_SCANF_METHOD(1, 2); int vscanf(const char *format, va_list args); @@ -298,7 +297,7 @@ class ATCmdParser : private NonCopyable * recv operation. */ void abort(); - + /** * Process out-of-band data * diff --git a/platform/CThunk.h b/platform/CThunk.h index 5e5cccb7f08..0b4e685eaf7 100644 --- a/platform/CThunk.h +++ b/platform/CThunk.h @@ -84,165 +84,163 @@ typedef void (*CThunkEntry)(void); * @note Synchronization level: Not protected */ template -class CThunk -{ - public: - typedef void (T::*CCallbackSimple)(void); - typedef void (T::*CCallback)(void* context); - - inline CThunk(T *instance) - { - init(instance, NULL, NULL); - } - - inline CThunk(T *instance, CCallback callback) - { - init(instance, callback, NULL); - } - - ~CThunk() { - - } - - inline CThunk(T *instance, CCallbackSimple callback) - { - init(instance, (CCallback)callback, NULL); - } - - inline CThunk(T &instance, CCallback callback) - { - init(instance, callback, NULL); - } - - inline CThunk(T &instance, CCallbackSimple callback) - { - init(instance, (CCallback)callback, NULL); - } - - inline CThunk(T &instance, CCallback callback, void* context) - { - init(instance, callback, context); - } - - inline void callback(CCallback callback) - { - m_callback = callback; - } - - inline void callback(CCallbackSimple callback) - { - m_callback = (CCallback)callback; - } - - inline void context(void* context) - { - m_thunk.context = (uint32_t)context; - } - - inline void context(uint32_t context) - { - m_thunk.context = context; - } - - inline uint32_t entry(void) - { - return (((uint32_t)&m_thunk)|CTHUNK_ADDRESS); - } - - /* get thunk entry point for connecting rhunk to an IRQ table */ - inline operator CThunkEntry(void) - { - return (CThunkEntry)entry(); - } - - /* get thunk entry point for connecting rhunk to an IRQ table */ - inline operator uint32_t(void) - { - return entry(); - } - - /* simple test function */ - inline void call(void) - { - (((CThunkEntry)(entry()))()); - } - - private: - T* m_instance; - volatile CCallback m_callback; +class CThunk { +public: + typedef void (T::*CCallbackSimple)(void); + typedef void (T::*CCallback)(void *context); + + inline CThunk(T *instance) + { + init(instance, NULL, NULL); + } + + inline CThunk(T *instance, CCallback callback) + { + init(instance, callback, NULL); + } + + ~CThunk() + { + + } + + inline CThunk(T *instance, CCallbackSimple callback) + { + init(instance, (CCallback)callback, NULL); + } + + inline CThunk(T &instance, CCallback callback) + { + init(instance, callback, NULL); + } + + inline CThunk(T &instance, CCallbackSimple callback) + { + init(instance, (CCallback)callback, NULL); + } + + inline CThunk(T &instance, CCallback callback, void *context) + { + init(instance, callback, context); + } + + inline void callback(CCallback callback) + { + m_callback = callback; + } + + inline void callback(CCallbackSimple callback) + { + m_callback = (CCallback)callback; + } + + inline void context(void *context) + { + m_thunk.context = (uint32_t)context; + } + + inline void context(uint32_t context) + { + m_thunk.context = context; + } + + inline uint32_t entry(void) + { + return (((uint32_t)&m_thunk) | CTHUNK_ADDRESS); + } + + /* get thunk entry point for connecting rhunk to an IRQ table */ + inline operator CThunkEntry(void) + { + return (CThunkEntry)entry(); + } + + /* get thunk entry point for connecting rhunk to an IRQ table */ + inline operator uint32_t(void) + { + return entry(); + } + + /* simple test function */ + inline void call(void) + { + (((CThunkEntry)(entry()))()); + } + +private: + T *m_instance; + volatile CCallback m_callback; // TODO: this needs proper fix, to refactor toolchain header file and all its use // PACKED there is not defined properly for IAR #if defined (__ICCARM__) - typedef __packed struct - { - CTHUNK_VARIABLES; - volatile uint32_t instance; - volatile uint32_t context; - volatile uint32_t callback; - volatile uint32_t trampoline; - } CThunkTrampoline; + typedef __packed struct { + CTHUNK_VARIABLES; + volatile uint32_t instance; + volatile uint32_t context; + volatile uint32_t callback; + volatile uint32_t trampoline; + } CThunkTrampoline; #else - typedef struct - { - CTHUNK_VARIABLES; - volatile uint32_t instance; - volatile uint32_t context; - volatile uint32_t callback; - volatile uint32_t trampoline; - } __attribute__((__packed__)) CThunkTrampoline; + typedef struct { + CTHUNK_VARIABLES; + volatile uint32_t instance; + volatile uint32_t context; + volatile uint32_t callback; + volatile uint32_t trampoline; + } __attribute__((__packed__)) CThunkTrampoline; #endif - static void trampoline(T* instance, void* context, CCallback* callback) - { - if(instance && *callback) { - (static_cast(instance)->**callback)(context); - } + static void trampoline(T *instance, void *context, CCallback *callback) + { + if (instance && *callback) { + (static_cast(instance)->**callback)(context); } + } - volatile CThunkTrampoline m_thunk; + volatile CThunkTrampoline m_thunk; - inline void init(T *instance, CCallback callback, void* context) - { - /* remember callback - need to add this level of redirection - as pointer size for member functions differs between platforms */ - m_callback = callback; + inline void init(T *instance, CCallback callback, void *context) + { + /* remember callback - need to add this level of redirection + as pointer size for member functions differs between platforms */ + m_callback = callback; - /* populate thunking trampoline */ - CTHUNK_ASSIGMENT; - m_thunk.context = (uint32_t)context; - m_thunk.instance = (uint32_t)instance; - m_thunk.callback = (uint32_t)&m_callback; - m_thunk.trampoline = (uint32_t)&trampoline; + /* populate thunking trampoline */ + CTHUNK_ASSIGMENT; + m_thunk.context = (uint32_t)context; + m_thunk.instance = (uint32_t)instance; + m_thunk.callback = (uint32_t)&m_callback; + m_thunk.trampoline = (uint32_t)&trampoline; #if defined(__CORTEX_A9) - /* Data cache clean */ - /* Cache control */ - { - uint32_t start_addr = (uint32_t)&m_thunk & 0xFFFFFFE0; - uint32_t end_addr = (uint32_t)&m_thunk + sizeof(m_thunk); - uint32_t addr; - - /* Data cache clean and invalid */ - for (addr = start_addr; addr < end_addr; addr += 0x20) { - L1C_CleanInvalidateDCacheMVA((void *)addr); - } - /* Instruction cache invalid */ - L1C_InvalidateICacheAll(); - MMU_InvalidateTLB(); - L1C_InvalidateBTAC(); + /* Data cache clean */ + /* Cache control */ + { + uint32_t start_addr = (uint32_t)&m_thunk & 0xFFFFFFE0; + uint32_t end_addr = (uint32_t)&m_thunk + sizeof(m_thunk); + uint32_t addr; + + /* Data cache clean and invalid */ + for (addr = start_addr; addr < end_addr; addr += 0x20) { + L1C_CleanInvalidateDCacheMVA((void *)addr); } + /* Instruction cache invalid */ + L1C_InvalidateICacheAll(); + MMU_InvalidateTLB(); + L1C_InvalidateBTAC(); + } #endif #if defined(__CORTEX_M7) - /* Data cache clean and invalid */ - SCB_CleanInvalidateDCache(); + /* Data cache clean and invalid */ + SCB_CleanInvalidateDCache(); - /* Instruction cache invalid */ - SCB_InvalidateICache(); + /* Instruction cache invalid */ + SCB_InvalidateICache(); #endif - __ISB(); - __DSB(); - } + __ISB(); + __DSB(); + } }; /**@}*/ diff --git a/platform/CallChain.cpp b/platform/CallChain.cpp index ebddc0fedcb..6a72d932a40 100644 --- a/platform/CallChain.cpp +++ b/platform/CallChain.cpp @@ -13,26 +13,31 @@ namespace mbed { class CallChainLink { public: - CallChainLink(): cb(), next(NULL) { + CallChainLink(): cb(), next(NULL) + { // No work to do } - CallChainLink(Callback &callback): cb(callback), next(NULL) { + CallChainLink(Callback &callback): cb(callback), next(NULL) + { // No work to do } Callback cb; - CallChainLink * next; + CallChainLink *next; }; -CallChain::CallChain(int size) : _chain(NULL) { +CallChain::CallChain(int size) : _chain(NULL) +{ // No work to do } -CallChain::~CallChain() { +CallChain::~CallChain() +{ clear(); } -pFunctionPointer_t CallChain::add(Callback func) { +pFunctionPointer_t CallChain::add(Callback func) +{ CallChainLink *new_link = new CallChainLink(func); if (NULL == _chain) { _chain = new_link; @@ -49,14 +54,16 @@ pFunctionPointer_t CallChain::add(Callback func) { } } -pFunctionPointer_t CallChain::add_front(Callback func) { +pFunctionPointer_t CallChain::add_front(Callback func) +{ CallChainLink *link = new CallChainLink(func); link->next = _chain; _chain = link; return &link->cb; } -int CallChain::size() const { +int CallChain::size() const +{ CallChainLink *link = _chain; int elements = 0; while (link != NULL) { @@ -66,7 +73,8 @@ int CallChain::size() const { return elements; } -pFunctionPointer_t CallChain::get(int idx) const { +pFunctionPointer_t CallChain::get(int idx) const +{ CallChainLink *link = _chain; for (int i = 0; i < idx; i++) { if (NULL == link) { @@ -77,7 +85,8 @@ pFunctionPointer_t CallChain::get(int idx) const { return &link->cb; } -int CallChain::find(pFunctionPointer_t f) const { +int CallChain::find(pFunctionPointer_t f) const +{ CallChainLink *link = _chain; int i = 0; while (link != NULL) { @@ -90,7 +99,8 @@ int CallChain::find(pFunctionPointer_t f) const { return -1; } -void CallChain::clear() { +void CallChain::clear() +{ CallChainLink *link = _chain; _chain = NULL; while (link != NULL) { @@ -100,7 +110,8 @@ void CallChain::clear() { } } -bool CallChain::remove(pFunctionPointer_t f) { +bool CallChain::remove(pFunctionPointer_t f) +{ CallChainLink *link = _chain; while (link != NULL) { if (f == &link->cb) { @@ -112,7 +123,8 @@ bool CallChain::remove(pFunctionPointer_t f) { return false; } -void CallChain::call() { +void CallChain::call() +{ CallChainLink *link = _chain; while (link != NULL) { link->cb.call(); diff --git a/platform/CallChain.h b/platform/CallChain.h index 60f3894bee4..85682102d35 100644 --- a/platform/CallChain.h +++ b/platform/CallChain.h @@ -75,26 +75,26 @@ class CallChainLink; class CallChain : private NonCopyable { public: /** Create an empty chain - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @param size (optional) Initial size of the chain */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") CallChain(int size = 4); /** Create an empty chain - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") virtual ~CallChain(); /** Add a function at the end of the chain * - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @param func A pointer to a void function @@ -103,7 +103,7 @@ class CallChain : private NonCopyable { * The function object created for 'func' */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") pFunctionPointer_t add(Callback func); /** Add a function at the end of the chain @@ -120,14 +120,15 @@ class CallChain : private NonCopyable { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "The add function does not support cv-qualifiers. Replaced by " - "add(callback(obj, method)).") - pFunctionPointer_t add(T *obj, M method) { + "The add function does not support cv-qualifiers. Replaced by " + "add(callback(obj, method)).") + pFunctionPointer_t add(T *obj, M method) + { return add(callback(obj, method)); } /** Add a function at the beginning of the chain - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @@ -137,7 +138,7 @@ class CallChain : private NonCopyable { * The function object created for 'func' */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") pFunctionPointer_t add_front(Callback func); /** Add a function at the beginning of the chain @@ -154,23 +155,24 @@ class CallChain : private NonCopyable { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "The add_front function does not support cv-qualifiers. Replaced by " - "add_front(callback(obj, method)).") - pFunctionPointer_t add_front(T *obj, M method) { + "The add_front function does not support cv-qualifiers. Replaced by " + "add_front(callback(obj, method)).") + pFunctionPointer_t add_front(T *obj, M method) + { return add_front(callback(obj, method)); } /** Get the number of functions in the chain - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") int size() const; /** Get a function object from the chain - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @param i function object index @@ -179,11 +181,11 @@ class CallChain : private NonCopyable { * The function object at position 'i' in the chain */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") pFunctionPointer_t get(int i) const; /** Look for a function object in the call chain - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @param f the function object to search @@ -192,18 +194,18 @@ class CallChain : private NonCopyable { * The index of the function object if found, -1 otherwise. */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") int find(pFunctionPointer_t f) const; /** Clear the call chain (remove all functions in the chain). * @deprecated Do not use this function. This class is not part of the public API of mbed-os and is being removed in the future. */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") void clear(); /** Remove a function object from the chain - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * * @arg f the function object to remove @@ -212,37 +214,39 @@ class CallChain : private NonCopyable { * true if the function object was found and removed, false otherwise. */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") bool remove(pFunctionPointer_t f); /** Call all the functions in the chain in sequence - * @deprecated + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") + "public API of mbed-os and is being removed in the future.") void call(); - /** - * @deprecated + /** + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") - void operator ()(void) { + "public API of mbed-os and is being removed in the future.") + void operator()(void) + { call(); } - /** - * @deprecated + /** + * @deprecated * Do not use this function, this class is not part of the public API of mbed-os and is being removed in the future. * */ MBED_DEPRECATED_SINCE("mbed-os-5.6", "This class is not part of the " - "public API of mbed-os and is being removed in the future.") - pFunctionPointer_t operator [](int i) const { + "public API of mbed-os and is being removed in the future.") + pFunctionPointer_t operator [](int i) const + { return get(i); } diff --git a/platform/Callback.h b/platform/Callback.h index b2f06e42fdb..bf3d66114b6 100644 --- a/platform/Callback.h +++ b/platform/Callback.h @@ -47,18 +47,20 @@ class Callback; // massive and misleading error messages when confronted with an // invalid type (or worse, runtime failures) namespace detail { - struct nil {}; +struct nil {}; - template - struct enable_if { typedef R type; }; +template +struct enable_if { + typedef R type; +}; - template - struct enable_if {}; +template +struct enable_if {}; - template - struct is_type { - static const bool value = true; - }; +template +struct is_type { + static const bool value = true; +}; } #define MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, M) \ @@ -77,7 +79,8 @@ class Callback { /** Create a Callback with a static function * @param func Static function to attach */ - Callback(R (*func)() = 0) { + Callback(R(*func)() = 0) + { if (!func) { memset(this, 0, sizeof(Callback)); } else { @@ -88,7 +91,8 @@ class Callback { /** Attach a Callback * @param func The Callback to attach */ - Callback(const Callback &func) { + Callback(const Callback &func) + { if (func._ops) { func._ops->move(this, &func); } @@ -100,8 +104,9 @@ class Callback { * @param method Member function to attach */ template - Callback(U *obj, R (T::*method)()) { - generate(method_context(obj, method)); + Callback(U *obj, R(T::*method)()) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -109,8 +114,9 @@ class Callback { * @param method Member function to attach */ template - Callback(const U *obj, R (T::*method)() const) { - generate(method_context(obj, method)); + Callback(const U *obj, R(T::*method)() const) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -118,8 +124,9 @@ class Callback { * @param method Member function to attach */ template - Callback(volatile U *obj, R (T::*method)() volatile) { - generate(method_context(obj, method)); + Callback(volatile U *obj, R(T::*method)() volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -127,44 +134,49 @@ class Callback { * @param method Member function to attach */ template - Callback(const volatile U *obj, R (T::*method)() const volatile) { - generate(method_context(obj, method)); + Callback(const volatile U *obj, R(T::*method)() const volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(T*), U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(T *), U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const T*), const U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const T *), const U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(volatile T*), volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(volatile T *), volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const volatile T*), const volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const volatile T *), const volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a function object @@ -172,7 +184,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)())) { + Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)())) + { generate(f); } @@ -181,7 +194,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const)) { + Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)() const)) + { generate(f); } @@ -190,7 +204,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() volatile)) { + Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)() volatile)) + { generate(f); } @@ -199,7 +214,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const volatile)) { + Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)() const volatile)) + { generate(f); } @@ -211,8 +227,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(U *obj, R (*func)(T*)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(U *obj, R(*func)(T *)) + { new (this) Callback(func, obj); } @@ -224,8 +241,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const U *obj, R (*func)(const T*)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const U *obj, R(*func)(const T *)) + { new (this) Callback(func, obj); } @@ -237,8 +255,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(volatile U *obj, R (*func)(volatile T*)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(volatile U *obj, R(*func)(volatile T *)) + { new (this) Callback(func, obj); } @@ -250,14 +269,16 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const volatile U *obj, R (*func)(const volatile T*)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const volatile U *obj, R(*func)(const volatile T *)) + { new (this) Callback(func, obj); } /** Destroy a callback */ - ~Callback() { + ~Callback() + { if (_ops) { _ops->dtor(this); } @@ -269,8 +290,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)()) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)()) + { this->~Callback(); new (this) Callback(func); } @@ -281,8 +303,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const Callback &func) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const Callback &func) + { this->~Callback(); new (this) Callback(func); } @@ -295,8 +318,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(U *obj, R (T::*method)()) { + "Replaced by simple assignment 'Callback cb = func") + void attach(U *obj, R(T::*method)()) + { this->~Callback(); new (this) Callback(obj, method); } @@ -309,8 +333,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const U *obj, R (T::*method)() const) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const U *obj, R(T::*method)() const) + { this->~Callback(); new (this) Callback(obj, method); } @@ -323,8 +348,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile U *obj, R (T::*method)() volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile U *obj, R(T::*method)() volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -337,8 +363,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile U *obj, R (T::*method)() const volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile U *obj, R(T::*method)() const volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -351,8 +378,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(T*), U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(T *), U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -365,8 +393,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const T*), const U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const T *), const U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -379,8 +408,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(volatile T*), volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(volatile T *), volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -393,8 +423,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const volatile T*), const volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const volatile T *), const volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -407,8 +438,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)())) { + "Replaced by simple assignment 'Callback cb = func") + void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)())) + { this->~Callback(); new (this) Callback(f); } @@ -421,8 +453,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)() const)) + { this->~Callback(); new (this) Callback(f); } @@ -435,8 +468,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)() volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -449,8 +483,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)() const volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)() const volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -463,8 +498,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(U *obj, R (*func)(T*)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(U *obj, R(*func)(T *)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -477,8 +513,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const U *obj, R (*func)(const T*)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const U *obj, R(*func)(const T *)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -491,8 +528,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(volatile U *obj, R (*func)(volatile T*)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(volatile U *obj, R(*func)(volatile T *)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -505,15 +543,17 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const volatile U *obj, R (*func)(const volatile T*)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const volatile U *obj, R(*func)(const volatile T *)) + { this->~Callback(); new (this) Callback(func, obj); } /** Assign a callback */ - Callback &operator=(const Callback &that) { + Callback &operator=(const Callback &that) + { if (this != &that) { this->~Callback(); new (this) Callback(that); @@ -524,42 +564,48 @@ class Callback { /** Call the attached function */ - R call() const { + R call() const + { MBED_ASSERT(_ops); return _ops->call(this); } /** Call the attached function */ - R operator()() const { + R operator()() const + { return call(); } /** Test if function has been attached */ - operator bool() const { + operator bool() const + { return _ops; } /** Test for equality */ - friend bool operator==(const Callback &l, const Callback &r) { + friend bool operator==(const Callback &l, const Callback &r) + { return memcmp(&l, &r, sizeof(Callback)) == 0; } /** Test for inequality */ - friend bool operator!=(const Callback &l, const Callback &r) { + friend bool operator!=(const Callback &l, const Callback &r) + { return !(l == r); } /** Static thunk for passing as C-style function * @param func Callback to call passed as void pointer - * @return the value as determined by func which is of + * @return the value as determined by func which is of * type and determined by the signiture of func */ - static R thunk(void *func) { - return static_cast(func)->call(); + static R thunk(void *func) + { + return static_cast(func)->call(); } private: @@ -569,21 +615,22 @@ class Callback { struct _class; union { void (*_staticfunc)(); - void (*_boundfunc)(_class*); + void (*_boundfunc)(_class *); void (_class::*_methodfunc)(); } _func; void *_obj; // Dynamically dispatched operations const struct ops { - R (*call)(const void*); - void (*move)(void*, const void*); - void (*dtor)(void*); + R(*call)(const void *); + void (*move)(void *, const void *); + void (*dtor)(void *); } *_ops; // Generate operations for function object template - void generate(const F &f) { + void generate(const F &f) + { static const ops ops = { &Callback::function_call, &Callback::function_move, @@ -591,7 +638,7 @@ class Callback { }; MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - "Type F must not exceed the size of the Callback class"); + "Type F must not exceed the size of the Callback class"); memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; @@ -599,18 +646,21 @@ class Callback { // Function attributes template - static R function_call(const void *p) { - return (*(F*)p)(); + static R function_call(const void *p) + { + return (*(F *)p)(); } template - static void function_move(void *d, const void *p) { - new (d) F(*(F*)p); + static void function_move(void *d, const void *p) + { + new (d) F(*(F *)p); } template - static void function_dtor(void *p) { - ((F*)p)->~F(); + static void function_dtor(void *p) + { + ((F *)p)->~F(); } // Wrappers for functions with context @@ -622,7 +672,8 @@ class Callback { method_context(O *obj, M method) : method(method), obj(obj) {} - R operator()() const { + R operator()() const + { return (obj->*method)(); } }; @@ -635,7 +686,8 @@ class Callback { function_context(F func, A *arg) : func(func), arg(arg) {} - R operator()() const { + R operator()() const + { return func(arg); } }; @@ -651,7 +703,8 @@ class Callback { /** Create a Callback with a static function * @param func Static function to attach */ - Callback(R (*func)(A0) = 0) { + Callback(R(*func)(A0) = 0) + { if (!func) { memset(this, 0, sizeof(Callback)); } else { @@ -662,7 +715,8 @@ class Callback { /** Attach a Callback * @param func The Callback to attach */ - Callback(const Callback &func) { + Callback(const Callback &func) + { if (func._ops) { func._ops->move(this, &func); } @@ -674,8 +728,9 @@ class Callback { * @param method Member function to attach */ template - Callback(U *obj, R (T::*method)(A0)) { - generate(method_context(obj, method)); + Callback(U *obj, R(T::*method)(A0)) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -683,8 +738,9 @@ class Callback { * @param method Member function to attach */ template - Callback(const U *obj, R (T::*method)(A0) const) { - generate(method_context(obj, method)); + Callback(const U *obj, R(T::*method)(A0) const) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -692,8 +748,9 @@ class Callback { * @param method Member function to attach */ template - Callback(volatile U *obj, R (T::*method)(A0) volatile) { - generate(method_context(obj, method)); + Callback(volatile U *obj, R(T::*method)(A0) volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -701,44 +758,49 @@ class Callback { * @param method Member function to attach */ template - Callback(const volatile U *obj, R (T::*method)(A0) const volatile) { - generate(method_context(obj, method)); + Callback(const volatile U *obj, R(T::*method)(A0) const volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(T*, A0), U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(T *, A0), U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const T*, A0), const U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const T *, A0), const U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(volatile T*, A0), volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(volatile T *, A0), volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const volatile T*, A0), const volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const volatile T *, A0), const volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a function object @@ -746,7 +808,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0))) { + Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0))) + { generate(f); } @@ -755,7 +818,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const)) { + Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0) const)) + { generate(f); } @@ -764,7 +828,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) volatile)) { + Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0) volatile)) + { generate(f); } @@ -773,7 +838,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const volatile)) { + Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0) const volatile)) + { generate(f); } @@ -785,8 +851,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(U *obj, R (*func)(T*, A0)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(U *obj, R(*func)(T *, A0)) + { new (this) Callback(func, obj); } @@ -798,8 +865,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const U *obj, R (*func)(const T*, A0)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const U *obj, R(*func)(const T *, A0)) + { new (this) Callback(func, obj); } @@ -811,8 +879,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(volatile U *obj, R (*func)(volatile T*, A0)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(volatile U *obj, R(*func)(volatile T *, A0)) + { new (this) Callback(func, obj); } @@ -824,14 +893,16 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const volatile U *obj, R (*func)(const volatile T*, A0)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const volatile U *obj, R(*func)(const volatile T *, A0)) + { new (this) Callback(func, obj); } /** Destroy a callback */ - ~Callback() { + ~Callback() + { if (_ops) { _ops->dtor(this); } @@ -843,8 +914,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(A0)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(A0)) + { this->~Callback(); new (this) Callback(func); } @@ -855,8 +927,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const Callback &func) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const Callback &func) + { this->~Callback(); new (this) Callback(func); } @@ -869,8 +942,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(U *obj, R (T::*method)(A0)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(U *obj, R(T::*method)(A0)) + { this->~Callback(); new (this) Callback(obj, method); } @@ -883,8 +957,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const U *obj, R (T::*method)(A0) const) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const U *obj, R(T::*method)(A0) const) + { this->~Callback(); new (this) Callback(obj, method); } @@ -897,8 +972,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile U *obj, R (T::*method)(A0) volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile U *obj, R(T::*method)(A0) volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -911,8 +987,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile U *obj, R (T::*method)(A0) const volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile U *obj, R(T::*method)(A0) const volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -925,8 +1002,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(T*, A0), U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(T *, A0), U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -939,8 +1017,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const T*, A0), const U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const T *, A0), const U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -953,8 +1032,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(volatile T*, A0), volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(volatile T *, A0), volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -967,8 +1047,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const volatile T*, A0), const volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const volatile T *, A0), const volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -981,8 +1062,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0))) { + "Replaced by simple assignment 'Callback cb = func") + void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0))) + { this->~Callback(); new (this) Callback(f); } @@ -995,8 +1077,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0) const)) + { this->~Callback(); new (this) Callback(f); } @@ -1009,8 +1092,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0) volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -1023,8 +1107,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0) const volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0) const volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -1037,8 +1122,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(U *obj, R (*func)(T*, A0)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(U *obj, R(*func)(T *, A0)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -1051,8 +1137,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const U *obj, R (*func)(const T*, A0)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const U *obj, R(*func)(const T *, A0)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -1065,8 +1152,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(volatile U *obj, R (*func)(volatile T*, A0)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(volatile U *obj, R(*func)(volatile T *, A0)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -1079,15 +1167,17 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const volatile U *obj, R (*func)(const volatile T*, A0)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const volatile U *obj, R(*func)(const volatile T *, A0)) + { this->~Callback(); new (this) Callback(func, obj); } /** Assign a callback */ - Callback &operator=(const Callback &that) { + Callback &operator=(const Callback &that) + { if (this != &that) { this->~Callback(); new (this) Callback(that); @@ -1098,43 +1188,49 @@ class Callback { /** Call the attached function */ - R call(A0 a0) const { + R call(A0 a0) const + { MBED_ASSERT(_ops); return _ops->call(this, a0); } /** Call the attached function */ - R operator()(A0 a0) const { + R operator()(A0 a0) const + { return call(a0); } /** Test if function has been attached */ - operator bool() const { + operator bool() const + { return _ops; } /** Test for equality */ - friend bool operator==(const Callback &l, const Callback &r) { + friend bool operator==(const Callback &l, const Callback &r) + { return memcmp(&l, &r, sizeof(Callback)) == 0; } /** Test for inequality */ - friend bool operator!=(const Callback &l, const Callback &r) { + friend bool operator!=(const Callback &l, const Callback &r) + { return !(l == r); } /** Static thunk for passing as C-style function * @param func Callback to call passed as void pointer * @param a0 An argument to be called with function func - * @return the value as determined by func which is of + * @return the value as determined by func which is of * type and determined by the signiture of func */ - static R thunk(void *func, A0 a0) { - return static_cast(func)->call(a0); + static R thunk(void *func, A0 a0) + { + return static_cast(func)->call(a0); } private: @@ -1144,21 +1240,22 @@ class Callback { struct _class; union { void (*_staticfunc)(A0); - void (*_boundfunc)(_class*, A0); + void (*_boundfunc)(_class *, A0); void (_class::*_methodfunc)(A0); } _func; void *_obj; // Dynamically dispatched operations const struct ops { - R (*call)(const void*, A0); - void (*move)(void*, const void*); - void (*dtor)(void*); + R(*call)(const void *, A0); + void (*move)(void *, const void *); + void (*dtor)(void *); } *_ops; // Generate operations for function object template - void generate(const F &f) { + void generate(const F &f) + { static const ops ops = { &Callback::function_call, &Callback::function_move, @@ -1166,7 +1263,7 @@ class Callback { }; MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - "Type F must not exceed the size of the Callback class"); + "Type F must not exceed the size of the Callback class"); memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; @@ -1174,18 +1271,21 @@ class Callback { // Function attributes template - static R function_call(const void *p, A0 a0) { - return (*(F*)p)(a0); + static R function_call(const void *p, A0 a0) + { + return (*(F *)p)(a0); } template - static void function_move(void *d, const void *p) { - new (d) F(*(F*)p); + static void function_move(void *d, const void *p) + { + new (d) F(*(F *)p); } template - static void function_dtor(void *p) { - ((F*)p)->~F(); + static void function_dtor(void *p) + { + ((F *)p)->~F(); } // Wrappers for functions with context @@ -1197,7 +1297,8 @@ class Callback { method_context(O *obj, M method) : method(method), obj(obj) {} - R operator()(A0 a0) const { + R operator()(A0 a0) const + { return (obj->*method)(a0); } }; @@ -1210,7 +1311,8 @@ class Callback { function_context(F func, A *arg) : func(func), arg(arg) {} - R operator()(A0 a0) const { + R operator()(A0 a0) const + { return func(arg, a0); } }; @@ -1226,7 +1328,8 @@ class Callback { /** Create a Callback with a static function * @param func Static function to attach */ - Callback(R (*func)(A0, A1) = 0) { + Callback(R(*func)(A0, A1) = 0) + { if (!func) { memset(this, 0, sizeof(Callback)); } else { @@ -1237,7 +1340,8 @@ class Callback { /** Attach a Callback * @param func The Callback to attach */ - Callback(const Callback &func) { + Callback(const Callback &func) + { if (func._ops) { func._ops->move(this, &func); } @@ -1249,8 +1353,9 @@ class Callback { * @param method Member function to attach */ template - Callback(U *obj, R (T::*method)(A0, A1)) { - generate(method_context(obj, method)); + Callback(U *obj, R(T::*method)(A0, A1)) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -1258,8 +1363,9 @@ class Callback { * @param method Member function to attach */ template - Callback(const U *obj, R (T::*method)(A0, A1) const) { - generate(method_context(obj, method)); + Callback(const U *obj, R(T::*method)(A0, A1) const) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -1267,8 +1373,9 @@ class Callback { * @param method Member function to attach */ template - Callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { - generate(method_context(obj, method)); + Callback(volatile U *obj, R(T::*method)(A0, A1) volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -1276,44 +1383,49 @@ class Callback { * @param method Member function to attach */ template - Callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { - generate(method_context(obj, method)); + Callback(const volatile U *obj, R(T::*method)(A0, A1) const volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(T*, A0, A1), U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(T *, A0, A1), U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const T*, A0, A1), const U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const T *, A0, A1), const U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(volatile T*, A0, A1), volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(volatile T *, A0, A1), volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const volatile T *, A0, A1), const volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a function object @@ -1321,7 +1433,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1))) { + Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1))) + { generate(f); } @@ -1330,7 +1443,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const)) { + Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1) const)) + { generate(f); } @@ -1339,7 +1453,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) volatile)) { + Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1) volatile)) + { generate(f); } @@ -1348,7 +1463,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const volatile)) { + Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1) const volatile)) + { generate(f); } @@ -1360,8 +1476,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(U *obj, R (*func)(T*, A0, A1)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(U *obj, R(*func)(T *, A0, A1)) + { new (this) Callback(func, obj); } @@ -1373,8 +1490,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const U *obj, R (*func)(const T*, A0, A1)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const U *obj, R(*func)(const T *, A0, A1)) + { new (this) Callback(func, obj); } @@ -1386,8 +1504,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(volatile U *obj, R (*func)(volatile T*, A0, A1)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(volatile U *obj, R(*func)(volatile T *, A0, A1)) + { new (this) Callback(func, obj); } @@ -1399,14 +1518,16 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const volatile U *obj, R(*func)(const volatile T *, A0, A1)) + { new (this) Callback(func, obj); } /** Destroy a callback */ - ~Callback() { + ~Callback() + { if (_ops) { _ops->dtor(this); } @@ -1418,8 +1539,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(A0, A1)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(A0, A1)) + { this->~Callback(); new (this) Callback(func); } @@ -1430,8 +1552,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const Callback &func) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const Callback &func) + { this->~Callback(); new (this) Callback(func); } @@ -1444,8 +1567,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(U *obj, R (T::*method)(A0, A1)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(U *obj, R(T::*method)(A0, A1)) + { this->~Callback(); new (this) Callback(obj, method); } @@ -1458,8 +1582,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const U *obj, R (T::*method)(A0, A1) const) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const U *obj, R(T::*method)(A0, A1) const) + { this->~Callback(); new (this) Callback(obj, method); } @@ -1472,8 +1597,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile U *obj, R (T::*method)(A0, A1) volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile U *obj, R(T::*method)(A0, A1) volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -1486,8 +1612,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile U *obj, R(T::*method)(A0, A1) const volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -1500,8 +1627,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(T*, A0, A1), U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(T *, A0, A1), U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -1514,8 +1642,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const T*, A0, A1), const U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const T *, A0, A1), const U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -1528,8 +1657,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(volatile T*, A0, A1), volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(volatile T *, A0, A1), volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -1542,8 +1672,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const volatile T *, A0, A1), const volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -1556,8 +1687,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1))) { + "Replaced by simple assignment 'Callback cb = func") + void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1))) + { this->~Callback(); new (this) Callback(f); } @@ -1570,8 +1702,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1) const)) + { this->~Callback(); new (this) Callback(f); } @@ -1584,8 +1717,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1) volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -1598,8 +1732,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1) const volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1) const volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -1612,8 +1747,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(U *obj, R (*func)(T*, A0, A1)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(U *obj, R(*func)(T *, A0, A1)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -1626,8 +1762,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const U *obj, R (*func)(const T*, A0, A1)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const U *obj, R(*func)(const T *, A0, A1)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -1640,8 +1777,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(volatile U *obj, R (*func)(volatile T*, A0, A1)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(volatile U *obj, R(*func)(volatile T *, A0, A1)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -1654,15 +1792,17 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const volatile U *obj, R(*func)(const volatile T *, A0, A1)) + { this->~Callback(); new (this) Callback(func, obj); } /** Assign a callback */ - Callback &operator=(const Callback &that) { + Callback &operator=(const Callback &that) + { if (this != &that) { this->~Callback(); new (this) Callback(that); @@ -1673,32 +1813,37 @@ class Callback { /** Call the attached function */ - R call(A0 a0, A1 a1) const { + R call(A0 a0, A1 a1) const + { MBED_ASSERT(_ops); return _ops->call(this, a0, a1); } /** Call the attached function */ - R operator()(A0 a0, A1 a1) const { + R operator()(A0 a0, A1 a1) const + { return call(a0, a1); } /** Test if function has been attached */ - operator bool() const { + operator bool() const + { return _ops; } /** Test for equality */ - friend bool operator==(const Callback &l, const Callback &r) { + friend bool operator==(const Callback &l, const Callback &r) + { return memcmp(&l, &r, sizeof(Callback)) == 0; } /** Test for inequality */ - friend bool operator!=(const Callback &l, const Callback &r) { + friend bool operator!=(const Callback &l, const Callback &r) + { return !(l == r); } @@ -1706,11 +1851,12 @@ class Callback { * @param func Callback to call passed as void pointer * @param a0 An argument to be called with function func * @param a1 An argument to be called with function func - * @return the value as determined by func which is of + * @return the value as determined by func which is of * type and determined by the signiture of func */ - static R thunk(void *func, A0 a0, A1 a1) { - return static_cast(func)->call(a0, a1); + static R thunk(void *func, A0 a0, A1 a1) + { + return static_cast(func)->call(a0, a1); } private: @@ -1720,21 +1866,22 @@ class Callback { struct _class; union { void (*_staticfunc)(A0, A1); - void (*_boundfunc)(_class*, A0, A1); + void (*_boundfunc)(_class *, A0, A1); void (_class::*_methodfunc)(A0, A1); } _func; void *_obj; // Dynamically dispatched operations const struct ops { - R (*call)(const void*, A0, A1); - void (*move)(void*, const void*); - void (*dtor)(void*); + R(*call)(const void *, A0, A1); + void (*move)(void *, const void *); + void (*dtor)(void *); } *_ops; // Generate operations for function object template - void generate(const F &f) { + void generate(const F &f) + { static const ops ops = { &Callback::function_call, &Callback::function_move, @@ -1742,7 +1889,7 @@ class Callback { }; MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - "Type F must not exceed the size of the Callback class"); + "Type F must not exceed the size of the Callback class"); memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; @@ -1750,18 +1897,21 @@ class Callback { // Function attributes template - static R function_call(const void *p, A0 a0, A1 a1) { - return (*(F*)p)(a0, a1); + static R function_call(const void *p, A0 a0, A1 a1) + { + return (*(F *)p)(a0, a1); } template - static void function_move(void *d, const void *p) { - new (d) F(*(F*)p); + static void function_move(void *d, const void *p) + { + new (d) F(*(F *)p); } template - static void function_dtor(void *p) { - ((F*)p)->~F(); + static void function_dtor(void *p) + { + ((F *)p)->~F(); } // Wrappers for functions with context @@ -1773,7 +1923,8 @@ class Callback { method_context(O *obj, M method) : method(method), obj(obj) {} - R operator()(A0 a0, A1 a1) const { + R operator()(A0 a0, A1 a1) const + { return (obj->*method)(a0, a1); } }; @@ -1786,7 +1937,8 @@ class Callback { function_context(F func, A *arg) : func(func), arg(arg) {} - R operator()(A0 a0, A1 a1) const { + R operator()(A0 a0, A1 a1) const + { return func(arg, a0, a1); } }; @@ -1802,7 +1954,8 @@ class Callback { /** Create a Callback with a static function * @param func Static function to attach */ - Callback(R (*func)(A0, A1, A2) = 0) { + Callback(R(*func)(A0, A1, A2) = 0) + { if (!func) { memset(this, 0, sizeof(Callback)); } else { @@ -1813,7 +1966,8 @@ class Callback { /** Attach a Callback * @param func The Callback to attach */ - Callback(const Callback &func) { + Callback(const Callback &func) + { if (func._ops) { func._ops->move(this, &func); } @@ -1825,8 +1979,9 @@ class Callback { * @param method Member function to attach */ template - Callback(U *obj, R (T::*method)(A0, A1, A2)) { - generate(method_context(obj, method)); + Callback(U *obj, R(T::*method)(A0, A1, A2)) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -1834,8 +1989,9 @@ class Callback { * @param method Member function to attach */ template - Callback(const U *obj, R (T::*method)(A0, A1, A2) const) { - generate(method_context(obj, method)); + Callback(const U *obj, R(T::*method)(A0, A1, A2) const) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -1843,8 +1999,9 @@ class Callback { * @param method Member function to attach */ template - Callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { - generate(method_context(obj, method)); + Callback(volatile U *obj, R(T::*method)(A0, A1, A2) volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -1852,44 +2009,49 @@ class Callback { * @param method Member function to attach */ template - Callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { - generate(method_context(obj, method)); + Callback(const volatile U *obj, R(T::*method)(A0, A1, A2) const volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(T*, A0, A1, A2), U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(T *, A0, A1, A2), U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const T*, A0, A1, A2), const U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const T *, A0, A1, A2), const U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(volatile T *, A0, A1, A2), volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const volatile T *, A0, A1, A2), const volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a function object @@ -1897,7 +2059,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2))) { + Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2))) + { generate(f); } @@ -1906,7 +2069,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const)) { + Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2) const)) + { generate(f); } @@ -1915,7 +2079,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) volatile)) { + Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2) volatile)) + { generate(f); } @@ -1924,7 +2089,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const volatile)) { + Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2) const volatile)) + { generate(f); } @@ -1936,8 +2102,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(U *obj, R (*func)(T*, A0, A1, A2)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(U *obj, R(*func)(T *, A0, A1, A2)) + { new (this) Callback(func, obj); } @@ -1949,8 +2116,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const U *obj, R (*func)(const T*, A0, A1, A2)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const U *obj, R(*func)(const T *, A0, A1, A2)) + { new (this) Callback(func, obj); } @@ -1962,8 +2130,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(volatile U *obj, R(*func)(volatile T *, A0, A1, A2)) + { new (this) Callback(func, obj); } @@ -1975,14 +2144,16 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const volatile U *obj, R(*func)(const volatile T *, A0, A1, A2)) + { new (this) Callback(func, obj); } /** Destroy a callback */ - ~Callback() { + ~Callback() + { if (_ops) { _ops->dtor(this); } @@ -1994,8 +2165,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(A0, A1, A2)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(A0, A1, A2)) + { this->~Callback(); new (this) Callback(func); } @@ -2006,8 +2178,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const Callback &func) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const Callback &func) + { this->~Callback(); new (this) Callback(func); } @@ -2020,8 +2193,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(U *obj, R (T::*method)(A0, A1, A2)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(U *obj, R(T::*method)(A0, A1, A2)) + { this->~Callback(); new (this) Callback(obj, method); } @@ -2034,8 +2208,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const U *obj, R (T::*method)(A0, A1, A2) const) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const U *obj, R(T::*method)(A0, A1, A2) const) + { this->~Callback(); new (this) Callback(obj, method); } @@ -2048,8 +2223,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile U *obj, R(T::*method)(A0, A1, A2) volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -2062,8 +2238,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile U *obj, R(T::*method)(A0, A1, A2) const volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -2076,8 +2253,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(T*, A0, A1, A2), U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(T *, A0, A1, A2), U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -2090,8 +2268,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const T*, A0, A1, A2), const U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const T *, A0, A1, A2), const U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -2104,8 +2283,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(volatile T *, A0, A1, A2), volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -2118,8 +2298,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const volatile T *, A0, A1, A2), const volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -2132,8 +2313,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2))) { + "Replaced by simple assignment 'Callback cb = func") + void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2))) + { this->~Callback(); new (this) Callback(f); } @@ -2146,8 +2328,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2) const)) + { this->~Callback(); new (this) Callback(f); } @@ -2160,8 +2343,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2) volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -2174,8 +2358,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2) const volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2) const volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -2188,8 +2373,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(U *obj, R (*func)(T*, A0, A1, A2)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(U *obj, R(*func)(T *, A0, A1, A2)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -2202,8 +2388,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const U *obj, R (*func)(const T*, A0, A1, A2)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const U *obj, R(*func)(const T *, A0, A1, A2)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -2216,8 +2403,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(volatile U *obj, R(*func)(volatile T *, A0, A1, A2)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -2230,15 +2418,17 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const volatile U *obj, R(*func)(const volatile T *, A0, A1, A2)) + { this->~Callback(); new (this) Callback(func, obj); } /** Assign a callback */ - Callback &operator=(const Callback &that) { + Callback &operator=(const Callback &that) + { if (this != &that) { this->~Callback(); new (this) Callback(that); @@ -2249,32 +2439,37 @@ class Callback { /** Call the attached function */ - R call(A0 a0, A1 a1, A2 a2) const { + R call(A0 a0, A1 a1, A2 a2) const + { MBED_ASSERT(_ops); return _ops->call(this, a0, a1, a2); } /** Call the attached function */ - R operator()(A0 a0, A1 a1, A2 a2) const { + R operator()(A0 a0, A1 a1, A2 a2) const + { return call(a0, a1, a2); } /** Test if function has been attached */ - operator bool() const { + operator bool() const + { return _ops; } /** Test for equality */ - friend bool operator==(const Callback &l, const Callback &r) { + friend bool operator==(const Callback &l, const Callback &r) + { return memcmp(&l, &r, sizeof(Callback)) == 0; } /** Test for inequality */ - friend bool operator!=(const Callback &l, const Callback &r) { + friend bool operator!=(const Callback &l, const Callback &r) + { return !(l == r); } @@ -2283,11 +2478,12 @@ class Callback { * @param a0 An argument to be called with function func * @param a1 An argument to be called with function func * @param a2 An argument to be called with function func - * @return the value as determined by func which is of + * @return the value as determined by func which is of * type and determined by the signiture of func */ - static R thunk(void *func, A0 a0, A1 a1, A2 a2) { - return static_cast(func)->call(a0, a1, a2); + static R thunk(void *func, A0 a0, A1 a1, A2 a2) + { + return static_cast(func)->call(a0, a1, a2); } private: @@ -2297,21 +2493,22 @@ class Callback { struct _class; union { void (*_staticfunc)(A0, A1, A2); - void (*_boundfunc)(_class*, A0, A1, A2); + void (*_boundfunc)(_class *, A0, A1, A2); void (_class::*_methodfunc)(A0, A1, A2); } _func; void *_obj; // Dynamically dispatched operations const struct ops { - R (*call)(const void*, A0, A1, A2); - void (*move)(void*, const void*); - void (*dtor)(void*); + R(*call)(const void *, A0, A1, A2); + void (*move)(void *, const void *); + void (*dtor)(void *); } *_ops; // Generate operations for function object template - void generate(const F &f) { + void generate(const F &f) + { static const ops ops = { &Callback::function_call, &Callback::function_move, @@ -2319,7 +2516,7 @@ class Callback { }; MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - "Type F must not exceed the size of the Callback class"); + "Type F must not exceed the size of the Callback class"); memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; @@ -2327,18 +2524,21 @@ class Callback { // Function attributes template - static R function_call(const void *p, A0 a0, A1 a1, A2 a2) { - return (*(F*)p)(a0, a1, a2); + static R function_call(const void *p, A0 a0, A1 a1, A2 a2) + { + return (*(F *)p)(a0, a1, a2); } template - static void function_move(void *d, const void *p) { - new (d) F(*(F*)p); + static void function_move(void *d, const void *p) + { + new (d) F(*(F *)p); } template - static void function_dtor(void *p) { - ((F*)p)->~F(); + static void function_dtor(void *p) + { + ((F *)p)->~F(); } // Wrappers for functions with context @@ -2350,7 +2550,8 @@ class Callback { method_context(O *obj, M method) : method(method), obj(obj) {} - R operator()(A0 a0, A1 a1, A2 a2) const { + R operator()(A0 a0, A1 a1, A2 a2) const + { return (obj->*method)(a0, a1, a2); } }; @@ -2363,7 +2564,8 @@ class Callback { function_context(F func, A *arg) : func(func), arg(arg) {} - R operator()(A0 a0, A1 a1, A2 a2) const { + R operator()(A0 a0, A1 a1, A2 a2) const + { return func(arg, a0, a1, a2); } }; @@ -2379,7 +2581,8 @@ class Callback { /** Create a Callback with a static function * @param func Static function to attach */ - Callback(R (*func)(A0, A1, A2, A3) = 0) { + Callback(R(*func)(A0, A1, A2, A3) = 0) + { if (!func) { memset(this, 0, sizeof(Callback)); } else { @@ -2390,7 +2593,8 @@ class Callback { /** Attach a Callback * @param func The Callback to attach */ - Callback(const Callback &func) { + Callback(const Callback &func) + { if (func._ops) { func._ops->move(this, &func); } @@ -2402,8 +2606,9 @@ class Callback { * @param method Member function to attach */ template - Callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { - generate(method_context(obj, method)); + Callback(U *obj, R(T::*method)(A0, A1, A2, A3)) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -2411,8 +2616,9 @@ class Callback { * @param method Member function to attach */ template - Callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { - generate(method_context(obj, method)); + Callback(const U *obj, R(T::*method)(A0, A1, A2, A3) const) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -2420,8 +2626,9 @@ class Callback { * @param method Member function to attach */ template - Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { - generate(method_context(obj, method)); + Callback(volatile U *obj, R(T::*method)(A0, A1, A2, A3) volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -2429,44 +2636,49 @@ class Callback { * @param method Member function to attach */ template - Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { - generate(method_context(obj, method)); + Callback(const volatile U *obj, R(T::*method)(A0, A1, A2, A3) const volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(T*, A0, A1, A2, A3), U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(T *, A0, A1, A2, A3), U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const T *, A0, A1, A2, A3), const U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(volatile T *, A0, A1, A2, A3), volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const volatile T *, A0, A1, A2, A3), const volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a function object @@ -2474,7 +2686,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3))) { + Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3))) + { generate(f); } @@ -2483,7 +2696,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const)) { + Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) const)) + { generate(f); } @@ -2492,7 +2706,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) volatile)) { + Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) volatile)) + { generate(f); } @@ -2501,7 +2716,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const volatile)) { + Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) const volatile)) + { generate(f); } @@ -2513,8 +2729,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(U *obj, R (*func)(T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(U *obj, R(*func)(T *, A0, A1, A2, A3)) + { new (this) Callback(func, obj); } @@ -2526,8 +2743,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const U *obj, R(*func)(const T *, A0, A1, A2, A3)) + { new (this) Callback(func, obj); } @@ -2539,8 +2757,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(volatile U *obj, R(*func)(volatile T *, A0, A1, A2, A3)) + { new (this) Callback(func, obj); } @@ -2552,14 +2771,16 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const volatile U *obj, R(*func)(const volatile T *, A0, A1, A2, A3)) + { new (this) Callback(func, obj); } /** Destroy a callback */ - ~Callback() { + ~Callback() + { if (_ops) { _ops->dtor(this); } @@ -2571,8 +2792,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(A0, A1, A2, A3)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(A0, A1, A2, A3)) + { this->~Callback(); new (this) Callback(func); } @@ -2583,8 +2805,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const Callback &func) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const Callback &func) + { this->~Callback(); new (this) Callback(func); } @@ -2597,8 +2820,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(U *obj, R (T::*method)(A0, A1, A2, A3)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(U *obj, R(T::*method)(A0, A1, A2, A3)) + { this->~Callback(); new (this) Callback(obj, method); } @@ -2611,8 +2835,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const U *obj, R(T::*method)(A0, A1, A2, A3) const) + { this->~Callback(); new (this) Callback(obj, method); } @@ -2625,8 +2850,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile U *obj, R(T::*method)(A0, A1, A2, A3) volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -2639,8 +2865,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile U *obj, R(T::*method)(A0, A1, A2, A3) const volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -2653,8 +2880,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(T*, A0, A1, A2, A3), U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(T *, A0, A1, A2, A3), U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -2667,8 +2895,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const T *, A0, A1, A2, A3), const U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -2681,8 +2910,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(volatile T *, A0, A1, A2, A3), volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -2695,8 +2925,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const volatile T *, A0, A1, A2, A3), const volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -2709,8 +2940,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3))) { + "Replaced by simple assignment 'Callback cb = func") + void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3))) + { this->~Callback(); new (this) Callback(f); } @@ -2723,8 +2955,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) const)) + { this->~Callback(); new (this) Callback(f); } @@ -2737,8 +2970,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -2751,8 +2985,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3) const volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3) const volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -2765,8 +3000,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(U *obj, R (*func)(T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(U *obj, R(*func)(T *, A0, A1, A2, A3)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -2779,8 +3015,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const U *obj, R(*func)(const T *, A0, A1, A2, A3)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -2793,8 +3030,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(volatile U *obj, R(*func)(volatile T *, A0, A1, A2, A3)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -2807,15 +3045,17 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const volatile U *obj, R(*func)(const volatile T *, A0, A1, A2, A3)) + { this->~Callback(); new (this) Callback(func, obj); } /** Assign a callback */ - Callback &operator=(const Callback &that) { + Callback &operator=(const Callback &that) + { if (this != &that) { this->~Callback(); new (this) Callback(that); @@ -2826,32 +3066,37 @@ class Callback { /** Call the attached function */ - R call(A0 a0, A1 a1, A2 a2, A3 a3) const { + R call(A0 a0, A1 a1, A2 a2, A3 a3) const + { MBED_ASSERT(_ops); return _ops->call(this, a0, a1, a2, a3); } /** Call the attached function */ - R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { + R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const + { return call(a0, a1, a2, a3); } /** Test if function has been attached */ - operator bool() const { + operator bool() const + { return _ops; } /** Test for equality */ - friend bool operator==(const Callback &l, const Callback &r) { + friend bool operator==(const Callback &l, const Callback &r) + { return memcmp(&l, &r, sizeof(Callback)) == 0; } /** Test for inequality */ - friend bool operator!=(const Callback &l, const Callback &r) { + friend bool operator!=(const Callback &l, const Callback &r) + { return !(l == r); } @@ -2861,11 +3106,12 @@ class Callback { * @param a1 An argument to be called with function func * @param a2 An argument to be called with function func * @param a3 An argument to be called with function func - * @return the value as determined by func which is of + * @return the value as determined by func which is of * type and determined by the signiture of func */ - static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3) { - return static_cast(func)->call(a0, a1, a2, a3); + static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3) + { + return static_cast(func)->call(a0, a1, a2, a3); } private: @@ -2875,21 +3121,22 @@ class Callback { struct _class; union { void (*_staticfunc)(A0, A1, A2, A3); - void (*_boundfunc)(_class*, A0, A1, A2, A3); + void (*_boundfunc)(_class *, A0, A1, A2, A3); void (_class::*_methodfunc)(A0, A1, A2, A3); } _func; void *_obj; // Dynamically dispatched operations const struct ops { - R (*call)(const void*, A0, A1, A2, A3); - void (*move)(void*, const void*); - void (*dtor)(void*); + R(*call)(const void *, A0, A1, A2, A3); + void (*move)(void *, const void *); + void (*dtor)(void *); } *_ops; // Generate operations for function object template - void generate(const F &f) { + void generate(const F &f) + { static const ops ops = { &Callback::function_call, &Callback::function_move, @@ -2897,7 +3144,7 @@ class Callback { }; MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - "Type F must not exceed the size of the Callback class"); + "Type F must not exceed the size of the Callback class"); memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; @@ -2905,18 +3152,21 @@ class Callback { // Function attributes template - static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3) { - return (*(F*)p)(a0, a1, a2, a3); + static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3) + { + return (*(F *)p)(a0, a1, a2, a3); } template - static void function_move(void *d, const void *p) { - new (d) F(*(F*)p); + static void function_move(void *d, const void *p) + { + new (d) F(*(F *)p); } template - static void function_dtor(void *p) { - ((F*)p)->~F(); + static void function_dtor(void *p) + { + ((F *)p)->~F(); } // Wrappers for functions with context @@ -2928,7 +3178,8 @@ class Callback { method_context(O *obj, M method) : method(method), obj(obj) {} - R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { + R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const + { return (obj->*method)(a0, a1, a2, a3); } }; @@ -2941,7 +3192,8 @@ class Callback { function_context(F func, A *arg) : func(func), arg(arg) {} - R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const { + R operator()(A0 a0, A1 a1, A2 a2, A3 a3) const + { return func(arg, a0, a1, a2, a3); } }; @@ -2957,7 +3209,8 @@ class Callback { /** Create a Callback with a static function * @param func Static function to attach */ - Callback(R (*func)(A0, A1, A2, A3, A4) = 0) { + Callback(R(*func)(A0, A1, A2, A3, A4) = 0) + { if (!func) { memset(this, 0, sizeof(Callback)); } else { @@ -2968,7 +3221,8 @@ class Callback { /** Attach a Callback * @param func The Callback to attach */ - Callback(const Callback &func) { + Callback(const Callback &func) + { if (func._ops) { func._ops->move(this, &func); } @@ -2980,8 +3234,9 @@ class Callback { * @param method Member function to attach */ template - Callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { - generate(method_context(obj, method)); + Callback(U *obj, R(T::*method)(A0, A1, A2, A3, A4)) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -2989,8 +3244,9 @@ class Callback { * @param method Member function to attach */ template - Callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { - generate(method_context(obj, method)); + Callback(const U *obj, R(T::*method)(A0, A1, A2, A3, A4) const) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -2998,8 +3254,9 @@ class Callback { * @param method Member function to attach */ template - Callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { - generate(method_context(obj, method)); + Callback(volatile U *obj, R(T::*method)(A0, A1, A2, A3, A4) volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a member function @@ -3007,44 +3264,49 @@ class Callback { * @param method Member function to attach */ template - Callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { - generate(method_context(obj, method)); + Callback(const volatile U *obj, R(T::*method)(A0, A1, A2, A3, A4) const volatile) + { + generate(method_context(obj, method)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(T *, A0, A1, A2, A3, A4), U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const T *, A0, A1, A2, A3, A4), const U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(volatile T *, A0, A1, A2, A3, A4), volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a static function and bound pointer * @param func Static function to attach - * @param arg Pointer argument to function + * @param arg Pointer argument to function */ template - Callback(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { - generate(function_context(func, arg)); + Callback(R(*func)(const volatile T *, A0, A1, A2, A3, A4), const volatile U *arg) + { + generate(function_context(func, arg)); } /** Create a Callback with a function object @@ -3052,7 +3314,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4))) { + Callback(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3, A4))) + { generate(f); } @@ -3061,7 +3324,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const)) { + Callback(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3, A4) const)) + { generate(f); } @@ -3070,7 +3334,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) volatile)) { + Callback(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3, A4) volatile)) + { generate(f); } @@ -3079,7 +3344,8 @@ class Callback { * @note The function object is limited to a single word of storage */ template - Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const volatile)) { + Callback(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3, A4) const volatile)) + { generate(f); } @@ -3091,8 +3357,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(U *obj, R(*func)(T *, A0, A1, A2, A3, A4)) + { new (this) Callback(func, obj); } @@ -3104,8 +3371,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const U *obj, R(*func)(const T *, A0, A1, A2, A3, A4)) + { new (this) Callback(func, obj); } @@ -3117,8 +3385,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(volatile U *obj, R(*func)(volatile T *, A0, A1, A2, A3, A4)) + { new (this) Callback(func, obj); } @@ -3130,14 +3399,16 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to Callback(func, arg)") - Callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to Callback(func, arg)") + Callback(const volatile U *obj, R(*func)(const volatile T *, A0, A1, A2, A3, A4)) + { new (this) Callback(func, obj); } /** Destroy a callback */ - ~Callback() { + ~Callback() + { if (_ops) { _ops->dtor(this); } @@ -3149,8 +3420,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(A0, A1, A2, A3, A4)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(A0, A1, A2, A3, A4)) + { this->~Callback(); new (this) Callback(func); } @@ -3161,8 +3433,9 @@ class Callback { * Replaced by simple assignment 'Callback cb = func' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const Callback &func) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const Callback &func) + { this->~Callback(); new (this) Callback(func); } @@ -3175,8 +3448,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(U *obj, R(T::*method)(A0, A1, A2, A3, A4)) + { this->~Callback(); new (this) Callback(obj, method); } @@ -3189,8 +3463,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const U *obj, R(T::*method)(A0, A1, A2, A3, A4) const) + { this->~Callback(); new (this) Callback(obj, method); } @@ -3203,8 +3478,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile U *obj, R(T::*method)(A0, A1, A2, A3, A4) volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -3217,8 +3493,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile U *obj, R(T::*method)(A0, A1, A2, A3, A4) const volatile) + { this->~Callback(); new (this) Callback(obj, method); } @@ -3231,8 +3508,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(T *, A0, A1, A2, A3, A4), U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -3245,8 +3523,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const T *, A0, A1, A2, A3, A4), const U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -3259,8 +3538,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(volatile T *, A0, A1, A2, A3, A4), volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -3273,8 +3553,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { + "Replaced by simple assignment 'Callback cb = func") + void attach(R(*func)(const volatile T *, A0, A1, A2, A3, A4), const volatile U *arg) + { this->~Callback(); new (this) Callback(func, arg); } @@ -3287,8 +3568,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4))) { + "Replaced by simple assignment 'Callback cb = func") + void attach(F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3, A4))) + { this->~Callback(); new (this) Callback(f); } @@ -3301,8 +3583,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3, A4) const)) + { this->~Callback(); new (this) Callback(f); } @@ -3315,8 +3598,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3, A4) volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -3329,8 +3613,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.4", - "Replaced by simple assignment 'Callback cb = func") - void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R (F::*)(A0, A1, A2, A3, A4) const volatile)) { + "Replaced by simple assignment 'Callback cb = func") + void attach(const volatile F f, MBED_ENABLE_IF_CALLBACK_COMPATIBLE(F, R(F::*)(A0, A1, A2, A3, A4) const volatile)) + { this->~Callback(); new (this) Callback(f); } @@ -3343,8 +3628,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(U *obj, R(*func)(T *, A0, A1, A2, A3, A4)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -3357,8 +3643,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const U *obj, R(*func)(const T *, A0, A1, A2, A3, A4)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -3371,8 +3658,9 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(volatile U *obj, R(*func)(volatile T *, A0, A1, A2, A3, A4)) + { this->~Callback(); new (this) Callback(func, obj); } @@ -3385,15 +3673,17 @@ class Callback { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to attach(func, arg)") - void attach(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to attach(func, arg)") + void attach(const volatile U *obj, R(*func)(const volatile T *, A0, A1, A2, A3, A4)) + { this->~Callback(); new (this) Callback(func, obj); } /** Assign a callback */ - Callback &operator=(const Callback &that) { + Callback &operator=(const Callback &that) + { if (this != &that) { this->~Callback(); new (this) Callback(that); @@ -3404,32 +3694,37 @@ class Callback { /** Call the attached function */ - R call(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { + R call(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const + { MBED_ASSERT(_ops); return _ops->call(this, a0, a1, a2, a3, a4); } /** Call the attached function */ - R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { + R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const + { return call(a0, a1, a2, a3, a4); } /** Test if function has been attached */ - operator bool() const { + operator bool() const + { return _ops; } /** Test for equality */ - friend bool operator==(const Callback &l, const Callback &r) { + friend bool operator==(const Callback &l, const Callback &r) + { return memcmp(&l, &r, sizeof(Callback)) == 0; } /** Test for inequality */ - friend bool operator!=(const Callback &l, const Callback &r) { + friend bool operator!=(const Callback &l, const Callback &r) + { return !(l == r); } @@ -3440,11 +3735,12 @@ class Callback { * @param a2 An argument to be called with function func * @param a3 An argument to be called with function func * @param a4 An argument to be called with function func - * @return the value as determined by func which is of + * @return the value as determined by func which is of * type and determined by the signiture of func */ - static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - return static_cast(func)->call(a0, a1, a2, a3, a4); + static R thunk(void *func, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) + { + return static_cast(func)->call(a0, a1, a2, a3, a4); } private: @@ -3454,21 +3750,22 @@ class Callback { struct _class; union { void (*_staticfunc)(A0, A1, A2, A3, A4); - void (*_boundfunc)(_class*, A0, A1, A2, A3, A4); + void (*_boundfunc)(_class *, A0, A1, A2, A3, A4); void (_class::*_methodfunc)(A0, A1, A2, A3, A4); } _func; void *_obj; // Dynamically dispatched operations const struct ops { - R (*call)(const void*, A0, A1, A2, A3, A4); - void (*move)(void*, const void*); - void (*dtor)(void*); + R(*call)(const void *, A0, A1, A2, A3, A4); + void (*move)(void *, const void *); + void (*dtor)(void *); } *_ops; // Generate operations for function object template - void generate(const F &f) { + void generate(const F &f) + { static const ops ops = { &Callback::function_call, &Callback::function_move, @@ -3476,7 +3773,7 @@ class Callback { }; MBED_STATIC_ASSERT(sizeof(Callback) - sizeof(_ops) >= sizeof(F), - "Type F must not exceed the size of the Callback class"); + "Type F must not exceed the size of the Callback class"); memset(this, 0, sizeof(Callback)); new (this) F(f); _ops = &ops; @@ -3484,18 +3781,21 @@ class Callback { // Function attributes template - static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) { - return (*(F*)p)(a0, a1, a2, a3, a4); + static R function_call(const void *p, A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) + { + return (*(F *)p)(a0, a1, a2, a3, a4); } template - static void function_move(void *d, const void *p) { - new (d) F(*(F*)p); + static void function_move(void *d, const void *p) + { + new (d) F(*(F *)p); } template - static void function_dtor(void *p) { - ((F*)p)->~F(); + static void function_dtor(void *p) + { + ((F *)p)->~F(); } // Wrappers for functions with context @@ -3507,7 +3807,8 @@ class Callback { method_context(O *obj, M method) : method(method), obj(obj) {} - R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { + R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const + { return (obj->*method)(a0, a1, a2, a3, a4); } }; @@ -3520,7 +3821,8 @@ class Callback { function_context(F func, A *arg) : func(func), arg(arg) {} - R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const { + R operator()(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const + { return func(arg, a0, a1, a2, a3, a4); } }; @@ -3536,7 +3838,8 @@ typedef Callback event_callback_t; * @return Callback with infered type */ template -Callback callback(R (*func)() = 0) { +Callback callback(R(*func)() = 0) +{ return Callback(func); } @@ -3546,7 +3849,8 @@ Callback callback(R (*func)() = 0) { * @return Callback with infered type */ template -Callback callback(const Callback &func) { +Callback callback(const Callback &func) +{ return Callback(func); } @@ -3557,7 +3861,8 @@ Callback callback(const Callback &func) { * @return Callback with infered type */ template -Callback callback(U *obj, R (T::*method)()) { +Callback callback(U *obj, R(T::*method)()) +{ return Callback(obj, method); } @@ -3568,7 +3873,8 @@ Callback callback(U *obj, R (T::*method)()) { * @return Callback with infered type */ template -Callback callback(const U *obj, R (T::*method)() const) { +Callback callback(const U *obj, R(T::*method)() const) +{ return Callback(obj, method); } @@ -3579,7 +3885,8 @@ Callback callback(const U *obj, R (T::*method)() const) { * @return Callback with infered type */ template -Callback callback(volatile U *obj, R (T::*method)() volatile) { +Callback callback(volatile U *obj, R(T::*method)() volatile) +{ return Callback(obj, method); } @@ -3590,7 +3897,8 @@ Callback callback(volatile U *obj, R (T::*method)() volatile) { * @return Callback with infered type */ template -Callback callback(const volatile U *obj, R (T::*method)() const volatile) { +Callback callback(const volatile U *obj, R(T::*method)() const volatile) +{ return Callback(obj, method); } @@ -3601,7 +3909,8 @@ Callback callback(const volatile U *obj, R (T::*method)() const volatile) { * @return Callback with infered type */ template -Callback callback(R (*func)(T*), U *arg) { +Callback callback(R(*func)(T *), U *arg) +{ return Callback(func, arg); } @@ -3612,7 +3921,8 @@ Callback callback(R (*func)(T*), U *arg) { * @return Callback with infered type */ template -Callback callback(R (*func)(const T*), const U *arg) { +Callback callback(R(*func)(const T *), const U *arg) +{ return Callback(func, arg); } @@ -3623,7 +3933,8 @@ Callback callback(R (*func)(const T*), const U *arg) { * @return Callback with infered type */ template -Callback callback(R (*func)(volatile T*), volatile U *arg) { +Callback callback(R(*func)(volatile T *), volatile U *arg) +{ return Callback(func, arg); } @@ -3634,7 +3945,8 @@ Callback callback(R (*func)(volatile T*), volatile U *arg) { * @return Callback with infered type */ template -Callback callback(R (*func)(const volatile T*), const volatile U *arg) { +Callback callback(R(*func)(const volatile T *), const volatile U *arg) +{ return Callback(func, arg); } @@ -3648,8 +3960,9 @@ Callback callback(R (*func)(const volatile T*), const volatile U *arg) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(U *obj, R (*func)(T*)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(U *obj, R(*func)(T *)) +{ return Callback(func, obj); } @@ -3663,8 +3976,9 @@ Callback callback(U *obj, R (*func)(T*)) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const U *obj, R (*func)(const T*)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const U *obj, R(*func)(const T *)) +{ return Callback(func, obj); } @@ -3678,8 +3992,9 @@ Callback callback(const U *obj, R (*func)(const T*)) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(volatile U *obj, R (*func)(volatile T*)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(volatile U *obj, R(*func)(volatile T *)) +{ return Callback(func, obj); } @@ -3693,8 +4008,9 @@ Callback callback(volatile U *obj, R (*func)(volatile T*)) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const volatile U *obj, R (*func)(const volatile T*)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const volatile U *obj, R(*func)(const volatile T *)) +{ return Callback(func, obj); } @@ -3705,7 +4021,8 @@ Callback callback(const volatile U *obj, R (*func)(const volatile T*)) { * @return Callback with infered type */ template -Callback callback(R (*func)(A0) = 0) { +Callback callback(R(*func)(A0) = 0) +{ return Callback(func); } @@ -3715,7 +4032,8 @@ Callback callback(R (*func)(A0) = 0) { * @return Callback with infered type */ template -Callback callback(const Callback &func) { +Callback callback(const Callback &func) +{ return Callback(func); } @@ -3726,7 +4044,8 @@ Callback callback(const Callback &func) { * @return Callback with infered type */ template -Callback callback(U *obj, R (T::*method)(A0)) { +Callback callback(U *obj, R(T::*method)(A0)) +{ return Callback(obj, method); } @@ -3737,7 +4056,8 @@ Callback callback(U *obj, R (T::*method)(A0)) { * @return Callback with infered type */ template -Callback callback(const U *obj, R (T::*method)(A0) const) { +Callback callback(const U *obj, R(T::*method)(A0) const) +{ return Callback(obj, method); } @@ -3748,7 +4068,8 @@ Callback callback(const U *obj, R (T::*method)(A0) const) { * @return Callback with infered type */ template -Callback callback(volatile U *obj, R (T::*method)(A0) volatile) { +Callback callback(volatile U *obj, R(T::*method)(A0) volatile) +{ return Callback(obj, method); } @@ -3759,7 +4080,8 @@ Callback callback(volatile U *obj, R (T::*method)(A0) volatile) { * @return Callback with infered type */ template -Callback callback(const volatile U *obj, R (T::*method)(A0) const volatile) { +Callback callback(const volatile U *obj, R(T::*method)(A0) const volatile) +{ return Callback(obj, method); } @@ -3770,7 +4092,8 @@ Callback callback(const volatile U *obj, R (T::*method)(A0) const volatil * @return Callback with infered type */ template -Callback callback(R (*func)(T*, A0), U *arg) { +Callback callback(R(*func)(T *, A0), U *arg) +{ return Callback(func, arg); } @@ -3781,7 +4104,8 @@ Callback callback(R (*func)(T*, A0), U *arg) { * @return Callback with infered type */ template -Callback callback(R (*func)(const T*, A0), const U *arg) { +Callback callback(R(*func)(const T *, A0), const U *arg) +{ return Callback(func, arg); } @@ -3792,7 +4116,8 @@ Callback callback(R (*func)(const T*, A0), const U *arg) { * @return Callback with infered type */ template -Callback callback(R (*func)(volatile T*, A0), volatile U *arg) { +Callback callback(R(*func)(volatile T *, A0), volatile U *arg) +{ return Callback(func, arg); } @@ -3803,7 +4128,8 @@ Callback callback(R (*func)(volatile T*, A0), volatile U *arg) { * @return Callback with infered type */ template -Callback callback(R (*func)(const volatile T*, A0), const volatile U *arg) { +Callback callback(R(*func)(const volatile T *, A0), const volatile U *arg) +{ return Callback(func, arg); } @@ -3817,8 +4143,9 @@ Callback callback(R (*func)(const volatile T*, A0), const volatile U *arg */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(U *obj, R (*func)(T*, A0)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(U *obj, R(*func)(T *, A0)) +{ return Callback(func, obj); } @@ -3832,8 +4159,9 @@ Callback callback(U *obj, R (*func)(T*, A0)) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const U *obj, R (*func)(const T*, A0)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const U *obj, R(*func)(const T *, A0)) +{ return Callback(func, obj); } @@ -3847,8 +4175,9 @@ Callback callback(const U *obj, R (*func)(const T*, A0)) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(volatile U *obj, R (*func)(volatile T*, A0)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(volatile U *obj, R(*func)(volatile T *, A0)) +{ return Callback(func, obj); } @@ -3862,8 +4191,9 @@ Callback callback(volatile U *obj, R (*func)(volatile T*, A0)) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const volatile U *obj, R(*func)(const volatile T *, A0)) +{ return Callback(func, obj); } @@ -3874,7 +4204,8 @@ Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0) * @return Callback with infered type */ template -Callback callback(R (*func)(A0, A1) = 0) { +Callback callback(R(*func)(A0, A1) = 0) +{ return Callback(func); } @@ -3884,7 +4215,8 @@ Callback callback(R (*func)(A0, A1) = 0) { * @return Callback with infered type */ template -Callback callback(const Callback &func) { +Callback callback(const Callback &func) +{ return Callback(func); } @@ -3895,7 +4227,8 @@ Callback callback(const Callback &func) { * @return Callback with infered type */ template -Callback callback(U *obj, R (T::*method)(A0, A1)) { +Callback callback(U *obj, R(T::*method)(A0, A1)) +{ return Callback(obj, method); } @@ -3906,7 +4239,8 @@ Callback callback(U *obj, R (T::*method)(A0, A1)) { * @return Callback with infered type */ template -Callback callback(const U *obj, R (T::*method)(A0, A1) const) { +Callback callback(const U *obj, R(T::*method)(A0, A1) const) +{ return Callback(obj, method); } @@ -3917,7 +4251,8 @@ Callback callback(const U *obj, R (T::*method)(A0, A1) const) { * @return Callback with infered type */ template -Callback callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { +Callback callback(volatile U *obj, R(T::*method)(A0, A1) volatile) +{ return Callback(obj, method); } @@ -3928,7 +4263,8 @@ Callback callback(volatile U *obj, R (T::*method)(A0, A1) volatile) { * @return Callback with infered type */ template -Callback callback(const volatile U *obj, R (T::*method)(A0, A1) const volatile) { +Callback callback(const volatile U *obj, R(T::*method)(A0, A1) const volatile) +{ return Callback(obj, method); } @@ -3939,7 +4275,8 @@ Callback callback(const volatile U *obj, R (T::*method)(A0, A1) const * @return Callback with infered type */ template -Callback callback(R (*func)(T*, A0, A1), U *arg) { +Callback callback(R(*func)(T *, A0, A1), U *arg) +{ return Callback(func, arg); } @@ -3950,7 +4287,8 @@ Callback callback(R (*func)(T*, A0, A1), U *arg) { * @return Callback with infered type */ template -Callback callback(R (*func)(const T*, A0, A1), const U *arg) { +Callback callback(R(*func)(const T *, A0, A1), const U *arg) +{ return Callback(func, arg); } @@ -3961,7 +4299,8 @@ Callback callback(R (*func)(const T*, A0, A1), const U *arg) { * @return Callback with infered type */ template -Callback callback(R (*func)(volatile T*, A0, A1), volatile U *arg) { +Callback callback(R(*func)(volatile T *, A0, A1), volatile U *arg) +{ return Callback(func, arg); } @@ -3972,7 +4311,8 @@ Callback callback(R (*func)(volatile T*, A0, A1), volatile U *arg) { * @return Callback with infered type */ template -Callback callback(R (*func)(const volatile T*, A0, A1), const volatile U *arg) { +Callback callback(R(*func)(const volatile T *, A0, A1), const volatile U *arg) +{ return Callback(func, arg); } @@ -3986,8 +4326,9 @@ Callback callback(R (*func)(const volatile T*, A0, A1), const volatil */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(U *obj, R (*func)(T*, A0, A1)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(U *obj, R(*func)(T *, A0, A1)) +{ return Callback(func, obj); } @@ -4001,8 +4342,9 @@ Callback callback(U *obj, R (*func)(T*, A0, A1)) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const U *obj, R (*func)(const T*, A0, A1)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const U *obj, R(*func)(const T *, A0, A1)) +{ return Callback(func, obj); } @@ -4016,8 +4358,9 @@ Callback callback(const U *obj, R (*func)(const T*, A0, A1)) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(volatile U *obj, R(*func)(volatile T *, A0, A1)) +{ return Callback(func, obj); } @@ -4031,8 +4374,9 @@ Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1)) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const volatile U *obj, R(*func)(const volatile T *, A0, A1)) +{ return Callback(func, obj); } @@ -4043,7 +4387,8 @@ Callback callback(const volatile U *obj, R (*func)(const volatile T*, * @return Callback with infered type */ template -Callback callback(R (*func)(A0, A1, A2) = 0) { +Callback callback(R(*func)(A0, A1, A2) = 0) +{ return Callback(func); } @@ -4053,7 +4398,8 @@ Callback callback(R (*func)(A0, A1, A2) = 0) { * @return Callback with infered type */ template -Callback callback(const Callback &func) { +Callback callback(const Callback &func) +{ return Callback(func); } @@ -4064,7 +4410,8 @@ Callback callback(const Callback &func) { * @return Callback with infered type */ template -Callback callback(U *obj, R (T::*method)(A0, A1, A2)) { +Callback callback(U *obj, R(T::*method)(A0, A1, A2)) +{ return Callback(obj, method); } @@ -4075,7 +4422,8 @@ Callback callback(U *obj, R (T::*method)(A0, A1, A2)) { * @return Callback with infered type */ template -Callback callback(const U *obj, R (T::*method)(A0, A1, A2) const) { +Callback callback(const U *obj, R(T::*method)(A0, A1, A2) const) +{ return Callback(obj, method); } @@ -4086,7 +4434,8 @@ Callback callback(const U *obj, R (T::*method)(A0, A1, A2) const) * @return Callback with infered type */ template -Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2) volatile) { +Callback callback(volatile U *obj, R(T::*method)(A0, A1, A2) volatile) +{ return Callback(obj, method); } @@ -4097,7 +4446,8 @@ Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2) vol * @return Callback with infered type */ template -Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2) const volatile) { +Callback callback(const volatile U *obj, R(T::*method)(A0, A1, A2) const volatile) +{ return Callback(obj, method); } @@ -4108,7 +4458,8 @@ Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A * @return Callback with infered type */ template -Callback callback(R (*func)(T*, A0, A1, A2), U *arg) { +Callback callback(R(*func)(T *, A0, A1, A2), U *arg) +{ return Callback(func, arg); } @@ -4119,7 +4470,8 @@ Callback callback(R (*func)(T*, A0, A1, A2), U *arg) { * @return Callback with infered type */ template -Callback callback(R (*func)(const T*, A0, A1, A2), const U *arg) { +Callback callback(R(*func)(const T *, A0, A1, A2), const U *arg) +{ return Callback(func, arg); } @@ -4130,7 +4482,8 @@ Callback callback(R (*func)(const T*, A0, A1, A2), const U *arg) * @return Callback with infered type */ template -Callback callback(R (*func)(volatile T*, A0, A1, A2), volatile U *arg) { +Callback callback(R(*func)(volatile T *, A0, A1, A2), volatile U *arg) +{ return Callback(func, arg); } @@ -4141,7 +4494,8 @@ Callback callback(R (*func)(volatile T*, A0, A1, A2), volatile U * @return Callback with infered type */ template -Callback callback(R (*func)(const volatile T*, A0, A1, A2), const volatile U *arg) { +Callback callback(R(*func)(const volatile T *, A0, A1, A2), const volatile U *arg) +{ return Callback(func, arg); } @@ -4155,8 +4509,9 @@ Callback callback(R (*func)(const volatile T*, A0, A1, A2), const */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(U *obj, R (*func)(T*, A0, A1, A2)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(U *obj, R(*func)(T *, A0, A1, A2)) +{ return Callback(func, obj); } @@ -4170,8 +4525,9 @@ Callback callback(U *obj, R (*func)(T*, A0, A1, A2)) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const U *obj, R(*func)(const T *, A0, A1, A2)) +{ return Callback(func, obj); } @@ -4185,8 +4541,9 @@ Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2)) */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(volatile U *obj, R(*func)(volatile T *, A0, A1, A2)) +{ return Callback(func, obj); } @@ -4200,8 +4557,9 @@ Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const volatile U *obj, R(*func)(const volatile T *, A0, A1, A2)) +{ return Callback(func, obj); } @@ -4212,7 +4570,8 @@ Callback callback(const volatile U *obj, R (*func)(const volatile * @return Callback with infered type */ template -Callback callback(R (*func)(A0, A1, A2, A3) = 0) { +Callback callback(R(*func)(A0, A1, A2, A3) = 0) +{ return Callback(func); } @@ -4222,7 +4581,8 @@ Callback callback(R (*func)(A0, A1, A2, A3) = 0) { * @return Callback with infered type */ template -Callback callback(const Callback &func) { +Callback callback(const Callback &func) +{ return Callback(func); } @@ -4233,7 +4593,8 @@ Callback callback(const Callback &func) { * @return Callback with infered type */ template -Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { +Callback callback(U *obj, R(T::*method)(A0, A1, A2, A3)) +{ return Callback(obj, method); } @@ -4244,7 +4605,8 @@ Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3)) { * @return Callback with infered type */ template -Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3) const) { +Callback callback(const U *obj, R(T::*method)(A0, A1, A2, A3) const) +{ return Callback(obj, method); } @@ -4255,7 +4617,8 @@ Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3 * @return Callback with infered type */ template -Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3) volatile) { +Callback callback(volatile U *obj, R(T::*method)(A0, A1, A2, A3) volatile) +{ return Callback(obj, method); } @@ -4266,7 +4629,8 @@ Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, * @return Callback with infered type */ template -Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3) const volatile) { +Callback callback(const volatile U *obj, R(T::*method)(A0, A1, A2, A3) const volatile) +{ return Callback(obj, method); } @@ -4277,7 +4641,8 @@ Callback callback(const volatile U *obj, R (T::*method)(A0, A * @return Callback with infered type */ template -Callback callback(R (*func)(T*, A0, A1, A2, A3), U *arg) { +Callback callback(R(*func)(T *, A0, A1, A2, A3), U *arg) +{ return Callback(func, arg); } @@ -4288,7 +4653,8 @@ Callback callback(R (*func)(T*, A0, A1, A2, A3), U *arg) { * @return Callback with infered type */ template -Callback callback(R (*func)(const T*, A0, A1, A2, A3), const U *arg) { +Callback callback(R(*func)(const T *, A0, A1, A2, A3), const U *arg) +{ return Callback(func, arg); } @@ -4299,7 +4665,8 @@ Callback callback(R (*func)(const T*, A0, A1, A2, A3), const * @return Callback with infered type */ template -Callback callback(R (*func)(volatile T*, A0, A1, A2, A3), volatile U *arg) { +Callback callback(R(*func)(volatile T *, A0, A1, A2, A3), volatile U *arg) +{ return Callback(func, arg); } @@ -4310,7 +4677,8 @@ Callback callback(R (*func)(volatile T*, A0, A1, A2, A3), vol * @return Callback with infered type */ template -Callback callback(R (*func)(const volatile T*, A0, A1, A2, A3), const volatile U *arg) { +Callback callback(R(*func)(const volatile T *, A0, A1, A2, A3), const volatile U *arg) +{ return Callback(func, arg); } @@ -4324,8 +4692,9 @@ Callback callback(R (*func)(const volatile T*, A0, A1, A2, A3 */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(U *obj, R(*func)(T *, A0, A1, A2, A3)) +{ return Callback(func, obj); } @@ -4339,8 +4708,9 @@ Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3)) { */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const U *obj, R(*func)(const T *, A0, A1, A2, A3)) +{ return Callback(func, obj); } @@ -4354,8 +4724,9 @@ Callback callback(const U *obj, R (*func)(const T*, A0, A1, A */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(volatile U *obj, R(*func)(volatile T *, A0, A1, A2, A3)) +{ return Callback(func, obj); } @@ -4369,8 +4740,9 @@ Callback callback(volatile U *obj, R (*func)(volatile T*, A0, */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const volatile U *obj, R(*func)(const volatile T *, A0, A1, A2, A3)) +{ return Callback(func, obj); } @@ -4381,7 +4753,8 @@ Callback callback(const volatile U *obj, R (*func)(const vola * @return Callback with infered type */ template -Callback callback(R (*func)(A0, A1, A2, A3, A4) = 0) { +Callback callback(R(*func)(A0, A1, A2, A3, A4) = 0) +{ return Callback(func); } @@ -4391,7 +4764,8 @@ Callback callback(R (*func)(A0, A1, A2, A3, A4) = 0) { * @return Callback with infered type */ template -Callback callback(const Callback &func) { +Callback callback(const Callback &func) +{ return Callback(func); } @@ -4402,7 +4776,8 @@ Callback callback(const Callback & * @return Callback with infered type */ template -Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3, A4)) { +Callback callback(U *obj, R(T::*method)(A0, A1, A2, A3, A4)) +{ return Callback(obj, method); } @@ -4413,7 +4788,8 @@ Callback callback(U *obj, R (T::*method)(A0, A1, A2, A3, * @return Callback with infered type */ template -Callback callback(const U *obj, R (T::*method)(A0, A1, A2, A3, A4) const) { +Callback callback(const U *obj, R(T::*method)(A0, A1, A2, A3, A4) const) +{ return Callback(obj, method); } @@ -4424,7 +4800,8 @@ Callback callback(const U *obj, R (T::*method)(A0, A1, A2 * @return Callback with infered type */ template -Callback callback(volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) volatile) { +Callback callback(volatile U *obj, R(T::*method)(A0, A1, A2, A3, A4) volatile) +{ return Callback(obj, method); } @@ -4435,7 +4812,8 @@ Callback callback(volatile U *obj, R (T::*method)(A0, A1, * @return Callback with infered type */ template -Callback callback(const volatile U *obj, R (T::*method)(A0, A1, A2, A3, A4) const volatile) { +Callback callback(const volatile U *obj, R(T::*method)(A0, A1, A2, A3, A4) const volatile) +{ return Callback(obj, method); } @@ -4446,7 +4824,8 @@ Callback callback(const volatile U *obj, R (T::*method)(A * @return Callback with infered type */ template -Callback callback(R (*func)(T*, A0, A1, A2, A3, A4), U *arg) { +Callback callback(R(*func)(T *, A0, A1, A2, A3, A4), U *arg) +{ return Callback(func, arg); } @@ -4457,7 +4836,8 @@ Callback callback(R (*func)(T*, A0, A1, A2, A3, A4), U *a * @return Callback with infered type */ template -Callback callback(R (*func)(const T*, A0, A1, A2, A3, A4), const U *arg) { +Callback callback(R(*func)(const T *, A0, A1, A2, A3, A4), const U *arg) +{ return Callback(func, arg); } @@ -4468,7 +4848,8 @@ Callback callback(R (*func)(const T*, A0, A1, A2, A3, A4) * @return Callback with infered type */ template -Callback callback(R (*func)(volatile T*, A0, A1, A2, A3, A4), volatile U *arg) { +Callback callback(R(*func)(volatile T *, A0, A1, A2, A3, A4), volatile U *arg) +{ return Callback(func, arg); } @@ -4479,7 +4860,8 @@ Callback callback(R (*func)(volatile T*, A0, A1, A2, A3, * @return Callback with infered type */ template -Callback callback(R (*func)(const volatile T*, A0, A1, A2, A3, A4), const volatile U *arg) { +Callback callback(R(*func)(const volatile T *, A0, A1, A2, A3, A4), const volatile U *arg) +{ return Callback(func, arg); } @@ -4493,8 +4875,9 @@ Callback callback(R (*func)(const volatile T*, A0, A1, A2 */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(U *obj, R(*func)(T *, A0, A1, A2, A3, A4)) +{ return Callback(func, obj); } @@ -4508,8 +4891,9 @@ Callback callback(U *obj, R (*func)(T*, A0, A1, A2, A3, A */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const U *obj, R (*func)(const T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const U *obj, R(*func)(const T *, A0, A1, A2, A3, A4)) +{ return Callback(func, obj); } @@ -4523,8 +4907,9 @@ Callback callback(const U *obj, R (*func)(const T*, A0, A */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(volatile U *obj, R (*func)(volatile T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(volatile U *obj, R(*func)(volatile T *, A0, A1, A2, A3, A4)) +{ return Callback(func, obj); } @@ -4538,8 +4923,9 @@ Callback callback(volatile U *obj, R (*func)(volatile T*, */ template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "Arguments to callback have been reordered to callback(func, arg)") -Callback callback(const volatile U *obj, R (*func)(const volatile T*, A0, A1, A2, A3, A4)) { + "Arguments to callback have been reordered to callback(func, arg)") +Callback callback(const volatile U *obj, R(*func)(const volatile T *, A0, A1, A2, A3, A4)) +{ return Callback(func, obj); } diff --git a/platform/CircularBuffer.h b/platform/CircularBuffer.h index 00e1eab862c..accb3abce93 100644 --- a/platform/CircularBuffer.h +++ b/platform/CircularBuffer.h @@ -24,17 +24,29 @@ namespace mbed { namespace internal { /* Detect if CounterType of the Circular buffer is of unsigned type. */ template -struct is_unsigned { static const bool value = false; }; +struct is_unsigned { + static const bool value = false; +}; template<> -struct is_unsigned { static const bool value = true; }; +struct is_unsigned { + static const bool value = true; +}; template<> -struct is_unsigned { static const bool value = true; }; +struct is_unsigned { + static const bool value = true; +}; template<> -struct is_unsigned { static const bool value = true; }; +struct is_unsigned { + static const bool value = true; +}; template<> -struct is_unsigned { static const bool value = true; }; +struct is_unsigned { + static const bool value = true; +}; template<> -struct is_unsigned { static const bool value = true; }; +struct is_unsigned { + static const bool value = true; +}; }; /** \addtogroup platform */ @@ -52,7 +64,8 @@ struct is_unsigned { static const bool value = true; }; template class CircularBuffer { public: - CircularBuffer() : _head(0), _tail(0), _full(false) { + CircularBuffer() : _head(0), _tail(0), _full(false) + { MBED_STATIC_ASSERT( internal::is_unsigned::value, "CounterType must be unsigned" @@ -65,7 +78,8 @@ class CircularBuffer { ); } - ~CircularBuffer() { + ~CircularBuffer() + { } /** Push the transaction to the buffer. This overwrites the buffer if it's @@ -73,7 +87,8 @@ class CircularBuffer { * * @param data Data to be pushed to the buffer */ - void push(const T& data) { + void push(const T &data) + { core_util_critical_section_enter(); if (full()) { _tail++; @@ -92,7 +107,8 @@ class CircularBuffer { * @param data Data to be popped from the buffer * @return True if the buffer is not empty and data contains a transaction, false otherwise */ - bool pop(T& data) { + bool pop(T &data) + { bool data_popped = false; core_util_critical_section_enter(); if (!empty()) { @@ -109,7 +125,8 @@ class CircularBuffer { * * @return True if the buffer is empty, false if not */ - bool empty() const { + bool empty() const + { core_util_critical_section_enter(); bool is_empty = (_head == _tail) && !_full; core_util_critical_section_exit(); @@ -120,7 +137,8 @@ class CircularBuffer { * * @return True if the buffer is full, false if not */ - bool full() const { + bool full() const + { core_util_critical_section_enter(); bool full = _full; core_util_critical_section_exit(); @@ -130,7 +148,8 @@ class CircularBuffer { /** Reset the buffer * */ - void reset() { + void reset() + { core_util_critical_section_enter(); _head = 0; _tail = 0; @@ -139,7 +158,8 @@ class CircularBuffer { } /** Get the number of elements currently stored in the circular_buffer */ - CounterType size() const { + CounterType size() const + { core_util_critical_section_enter(); CounterType elements; if (!_full) { @@ -160,7 +180,8 @@ class CircularBuffer { * @param data Data to be peeked from the buffer * @return True if the buffer is not empty and data contains a transaction, false otherwise */ - bool peek(T& data) const { + bool peek(T &data) const + { bool data_updated = false; core_util_critical_section_enter(); if (!empty()) { @@ -170,7 +191,7 @@ class CircularBuffer { core_util_critical_section_exit(); return data_updated; } - + private: T _pool[BufferSize]; volatile CounterType _head; diff --git a/platform/CriticalSectionLock.h b/platform/CriticalSectionLock.h index 17fa4750ead..f654f5d26ca 100644 --- a/platform/CriticalSectionLock.h +++ b/platform/CriticalSectionLock.h @@ -57,12 +57,12 @@ namespace mbed { */ class CriticalSectionLock { public: - CriticalSectionLock() + CriticalSectionLock() { core_util_critical_section_enter(); } - ~CriticalSectionLock() + ~CriticalSectionLock() { core_util_critical_section_exit(); } @@ -72,8 +72,8 @@ class CriticalSectionLock { * */ MBED_DEPRECATED_SINCE("mbed-os-5.8", - "This function is inconsistent with RAII and is being removed in the future." - "Replaced by static function CriticalSectionLock::enable.") + "This function is inconsistent with RAII and is being removed in the future." + "Replaced by static function CriticalSectionLock::enable.") void lock() { core_util_critical_section_enter(); @@ -84,8 +84,8 @@ class CriticalSectionLock { * */ MBED_DEPRECATED_SINCE("mbed-os-5.8", - "This function is inconsistent with RAII and is being removed in the future." - "Replaced by static function CriticalSectionLock::disable.") + "This function is inconsistent with RAII and is being removed in the future." + "Replaced by static function CriticalSectionLock::disable.") void unlock() { core_util_critical_section_exit(); diff --git a/platform/DirHandle.h b/platform/DirHandle.h index 033ed92eb7a..d0b04d04f27 100644 --- a/platform/DirHandle.h +++ b/platform/DirHandle.h @@ -80,7 +80,7 @@ class DirHandle : private NonCopyable { */ virtual void rewind() = 0; - /** Get the sizeof the directory + /** Get the sizeof the directory * * @return Number of files in the directory */ @@ -108,7 +108,10 @@ class DirHandle : private NonCopyable { * @deprecated Replaced by `int DirHandle::close()' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", "Replaced by DirHandle::close") - virtual int closedir() { return close(); }; + virtual int closedir() + { + return close(); + }; /** Return the directory entry at the current position, and * advances the position to the next entry. @@ -130,7 +133,10 @@ class DirHandle : private NonCopyable { * @deprecated Replaced by `void DirHandle::rewind()' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", "Replaced by DirHandle::rewind") - virtual void rewinddir() { rewind(); } + virtual void rewinddir() + { + rewind(); + } /** Returns the current position of the DirHandle. * @@ -140,7 +146,10 @@ class DirHandle : private NonCopyable { * @deprecated Replaced by `off_t DirHandle::tell()' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", "Replaced by DirHandle::tell") - virtual off_t telldir() { return tell(); } + virtual off_t telldir() + { + return tell(); + } /** Sets the position of the DirHandle. * @@ -148,7 +157,10 @@ class DirHandle : private NonCopyable { * @deprecated Replaced by `void DirHandle::seek(off_t offset)' */ MBED_DEPRECATED_SINCE("mbed-os-5.4", "Replaced by DirHandle::seek") - virtual void seekdir(off_t location) { seek(location); } + virtual void seekdir(off_t location) + { + seek(location); + } }; /**@}*/ diff --git a/platform/FileBase.cpp b/platform/FileBase.cpp index 4458f584b48..a6ca848a82b 100644 --- a/platform/FileBase.cpp +++ b/platform/FileBase.cpp @@ -23,8 +23,9 @@ FileBase *FileBase::_head = NULL; SingletonPtr FileBase::_mutex; FileBase::FileBase(const char *name, PathType t) : _next(NULL), - _name(name), - _path_type(t) { + _name(name), + _path_type(t) +{ _mutex->lock(); if (name != NULL) { // put this object at head of the list @@ -36,7 +37,8 @@ FileBase::FileBase(const char *name, PathType t) : _next(NULL), _mutex->unlock(); } -FileBase::~FileBase() { +FileBase::~FileBase() +{ _mutex->lock(); if (_name != NULL) { // remove this object from the list @@ -53,12 +55,13 @@ FileBase::~FileBase() { _mutex->unlock(); if (getPathType() == FilePathType) { - extern void remove_filehandle(FileHandle *file); - remove_filehandle(static_cast(static_cast(this))); + extern void remove_filehandle(FileHandle * file); + remove_filehandle(static_cast(static_cast(this))); } } -FileBase *FileBase::lookup(const char *name, unsigned int len) { +FileBase *FileBase::lookup(const char *name, unsigned int len) +{ _mutex->lock(); FileBase *p = _head; while (p != NULL) { @@ -73,7 +76,8 @@ FileBase *FileBase::lookup(const char *name, unsigned int len) { return NULL; } -FileBase *FileBase::get(int n) { +FileBase *FileBase::get(int n) +{ _mutex->lock(); FileBase *p = _head; int m = 0; @@ -90,12 +94,14 @@ FileBase *FileBase::get(int n) { return NULL; } -const char* FileBase::getName(void) { +const char *FileBase::getName(void) +{ // Constant read so no lock needed return _name; } -PathType FileBase::getPathType(void) { +PathType FileBase::getPathType(void) +{ // Constant read so no lock needed return _path_type; } diff --git a/platform/FileBase.h b/platform/FileBase.h index 4f6371923b2..0ef63b40af1 100644 --- a/platform/FileBase.h +++ b/platform/FileBase.h @@ -27,7 +27,7 @@ typedef int FILEHANDLE; #include "platform/NonCopyable.h" namespace mbed { - + typedef enum { FilePathType, FileSystemPathType @@ -42,13 +42,13 @@ typedef enum { /** Class FileBase * */ - + class FileBase : private NonCopyable { public: FileBase(const char *name, PathType t); virtual ~FileBase(); - const char* getName(void); + const char *getName(void); PathType getPathType(void); static FileBase *lookup(const char *name, unsigned int len); @@ -61,7 +61,7 @@ class FileBase : private NonCopyable { static SingletonPtr _mutex; FileBase *_next; - const char * const _name; + const char *const _name; const PathType _path_type; }; diff --git a/platform/FileHandle.h b/platform/FileHandle.h index 7c2c8f38322..03b6399a66e 100644 --- a/platform/FileHandle.h +++ b/platform/FileHandle.h @@ -69,7 +69,7 @@ class FileHandle : private NonCopyable { * * if some data can be written, and non-blocking set, write partial * * @param buffer The buffer to write from - * @param size The number of bytes to write + * @param size The number of bytes to write * @return The number of bytes written, negative error on failure */ virtual ssize_t write(const void *buffer, size_t size) = 0; diff --git a/platform/FilePath.cpp b/platform/FilePath.cpp index ee348993f50..92511d1b687 100644 --- a/platform/FilePath.cpp +++ b/platform/FilePath.cpp @@ -17,11 +17,12 @@ namespace mbed { -FilePath::FilePath(const char* file_path) : file_name(NULL), fb(NULL) { +FilePath::FilePath(const char *file_path) : file_name(NULL), fb(NULL) +{ // skip slashes file_path += strspn(file_path, "/"); - const char* file_system = file_path; + const char *file_system = file_path; file_name = file_system; int len = 0; while (true) { @@ -41,37 +42,45 @@ FilePath::FilePath(const char* file_path) : file_name(NULL), fb(NULL) { fb = FileBase::lookup(file_system, len); } -const char* FilePath::fileName(void) { +const char *FilePath::fileName(void) +{ return file_name; } -bool FilePath::isFileSystem(void) { - if (NULL == fb) +bool FilePath::isFileSystem(void) +{ + if (NULL == fb) { return false; + } return (fb->getPathType() == FileSystemPathType); } -FileSystemLike* FilePath::fileSystem(void) { +FileSystemLike *FilePath::fileSystem(void) +{ if (isFileSystem()) { - return static_cast(fb); + return static_cast(fb); } return NULL; } -bool FilePath::isFile(void) { - if (NULL == fb) +bool FilePath::isFile(void) +{ + if (NULL == fb) { return false; + } return (fb->getPathType() == FilePathType); } -FileLike* FilePath::file(void) { +FileLike *FilePath::file(void) +{ if (isFile()) { - return (FileLike*)fb; + return (FileLike *)fb; } return NULL; } -bool FilePath::exists(void) { +bool FilePath::exists(void) +{ return fb != NULL; } diff --git a/platform/FilePath.h b/platform/FilePath.h index d380041ca05..6183ffbcefe 100644 --- a/platform/FilePath.h +++ b/platform/FilePath.h @@ -33,27 +33,27 @@ class FileSystem; /** Class FilePath * */ - + class FilePath { public: /** Constructor FilePath * * @param file_path The path of file. - */ - FilePath(const char* file_path); + */ + FilePath(const char *file_path); - const char* fileName(void); + const char *fileName(void); bool isFileSystem(void); - FileSystemLike* fileSystem(void); + FileSystemLike *fileSystem(void); bool isFile(void); - FileLike* file(void); + FileLike *file(void); bool exists(void); private: - const char* file_name; - FileBase* fb; + const char *file_name; + FileBase *fb; }; /**@}*/ diff --git a/platform/FileSystemHandle.h b/platform/FileSystemHandle.h index 349e25855ee..750dab056a5 100644 --- a/platform/FileSystemHandle.h +++ b/platform/FileSystemHandle.h @@ -101,7 +101,7 @@ class FileSystemHandle : private NonCopyable { * @param buf The stat buffer to write to * @return 0 on success, negative error code on failure */ - virtual int statvfs(const char *path, struct statvfs *buf); + virtual int statvfs(const char *path, struct statvfs *buf); }; /**@}*/ diff --git a/platform/FileSystemLike.h b/platform/FileSystemLike.h index aef7913cf67..abcd6358d39 100644 --- a/platform/FileSystemLike.h +++ b/platform/FileSystemLike.h @@ -59,7 +59,7 @@ class FileSystemLike : public FileSystemHandle, public FileBase, private NonCopy * @deprecated Replaced by `int open(FileHandle **, ...)` for propagating error codes */ MBED_DEPRECATED_SINCE("mbed-os-5.5", - "Replaced by `int open(FileHandle **, ...)` for propagating error codes") + "Replaced by `int open(FileHandle **, ...)` for propagating error codes") FileHandle *open(const char *path, int flags) { FileHandle *file; @@ -74,7 +74,7 @@ class FileSystemLike : public FileSystemHandle, public FileBase, private NonCopy * @deprecated Replaced by `int open(DirHandle **, ...)` for propagating error codes */ MBED_DEPRECATED_SINCE("mbed-os-5.5", - "Replaced by `int open(DirHandle **, ...)` for propagating error codes") + "Replaced by `int open(DirHandle **, ...)` for propagating error codes") DirHandle *opendir(const char *path) { DirHandle *dir; diff --git a/platform/FunctionPointer.h b/platform/FunctionPointer.h index 18c34c2106e..c17f53a9a96 100644 --- a/platform/FunctionPointer.h +++ b/platform/FunctionPointer.h @@ -35,21 +35,23 @@ template class FunctionPointerArg1 : public Callback { public: MBED_DEPRECATED_SINCE("mbed-os-5.1", - "FunctionPointerArg1 has been replaced by Callback") - FunctionPointerArg1(R (*function)(A1) = 0) + "FunctionPointerArg1 has been replaced by Callback") + FunctionPointerArg1(R(*function)(A1) = 0) : Callback(function) {} template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "FunctionPointerArg1 has been replaced by Callback") - FunctionPointerArg1(T *object, R (T::*member)(A1)) + "FunctionPointerArg1 has been replaced by Callback") + FunctionPointerArg1(T *object, R(T::*member)(A1)) : Callback(object, member) {} - R (*get_function())(A1) { - return *reinterpret_cast(this); + R(*get_function())(A1) + { + return *reinterpret_cast(this); } - R call(A1 a1) const { + R call(A1 a1) const + { if (!Callback::operator bool()) { return (R)0; } @@ -57,7 +59,8 @@ class FunctionPointerArg1 : public Callback { return Callback::call(a1); } - R operator()(A1 a1) const { + R operator()(A1 a1) const + { return Callback::call(a1); } }; @@ -66,21 +69,23 @@ template class FunctionPointerArg1 : public Callback { public: MBED_DEPRECATED_SINCE("mbed-os-5.1", - "FunctionPointer has been replaced by Callback") - FunctionPointerArg1(R (*function)() = 0) + "FunctionPointer has been replaced by Callback") + FunctionPointerArg1(R(*function)() = 0) : Callback(function) {} template MBED_DEPRECATED_SINCE("mbed-os-5.1", - "FunctionPointer has been replaced by Callback") - FunctionPointerArg1(T *object, R (T::*member)()) + "FunctionPointer has been replaced by Callback") + FunctionPointerArg1(T *object, R(T::*member)()) : Callback(object, member) {} - R (*get_function())() { - return *reinterpret_cast(this); + R(*get_function())() + { + return *reinterpret_cast(this); } - R call() const { + R call() const + { if (!Callback::operator bool()) { return (R)0; } @@ -88,7 +93,8 @@ class FunctionPointerArg1 : public Callback { return Callback::call(); } - R operator()() const { + R operator()() const + { return Callback::call(); } }; diff --git a/platform/LocalFileSystem.cpp b/platform/LocalFileSystem.cpp index 13daee31c26..c5c7d33dff7 100644 --- a/platform/LocalFileSystem.cpp +++ b/platform/LocalFileSystem.cpp @@ -45,7 +45,8 @@ typedef struct { /* File Search info record */ #define RESERVED_FOR_USER_APPLICATIONS (0x100) /* 0x100 - 0x1ff */ #define USR_XFFIND (RESERVED_FOR_USER_APPLICATIONS + 0) -static int xffind (const char *pattern, XFINFO *info) { +static int xffind(const char *pattern, XFINFO *info) +{ unsigned param[4]; param[0] = (unsigned long)pattern; @@ -63,7 +64,8 @@ static int xffind (const char *pattern, XFINFO *info) { #define OPEN_A 8 #define OPEN_INVALID -1 -int posix_to_semihost_open_flags(int flags) { +int posix_to_semihost_open_flags(int flags) +{ /* POSIX flags -> semihosting open mode */ int openmode; if (flags & O_RDWR) { @@ -94,7 +96,8 @@ int posix_to_semihost_open_flags(int flags) { return openmode; } -FILEHANDLE local_file_open(const char* name, int flags) { +FILEHANDLE local_file_open(const char *name, int flags) +{ int openmode = posix_to_semihost_open_flags(flags); if (openmode == OPEN_INVALID) { return (FILEHANDLE)NULL; @@ -108,42 +111,48 @@ FILEHANDLE local_file_open(const char* name, int flags) { return fh; } -LocalFileHandle::LocalFileHandle(FILEHANDLE fh) : _fh(fh), pos(0) { +LocalFileHandle::LocalFileHandle(FILEHANDLE fh) : _fh(fh), pos(0) +{ // No lock needed in constructor } -int LocalFileHandle::close() { +int LocalFileHandle::close() +{ int retval = semihost_close(_fh); delete this; return retval; } -ssize_t LocalFileHandle::write(const void *buffer, size_t length) { +ssize_t LocalFileHandle::write(const void *buffer, size_t length) +{ lock(); - ssize_t n = semihost_write(_fh, (const unsigned char*)buffer, length, 0); // number of characters not written + ssize_t n = semihost_write(_fh, (const unsigned char *)buffer, length, 0); // number of characters not written n = length - n; // number of characters written pos += n; unlock(); return n; } -ssize_t LocalFileHandle::read(void *buffer, size_t length) { +ssize_t LocalFileHandle::read(void *buffer, size_t length) +{ lock(); - ssize_t n = semihost_read(_fh, (unsigned char*)buffer, length, 0); // number of characters not read + ssize_t n = semihost_read(_fh, (unsigned char *)buffer, length, 0); // number of characters not read n = length - n; // number of characters read pos += n; unlock(); return n; } -int LocalFileHandle::isatty() { +int LocalFileHandle::isatty() +{ lock(); int ret = semihost_istty(_fh); unlock(); return ret; } -off_t LocalFileHandle::seek(off_t position, int whence) { +off_t LocalFileHandle::seek(off_t position, int whence) +{ lock(); if (whence == SEEK_CUR) { position += pos; @@ -158,25 +167,29 @@ off_t LocalFileHandle::seek(off_t position, int whence) { return position; } -int LocalFileHandle::sync() { +int LocalFileHandle::sync() +{ lock(); int ret = semihost_ensure(_fh); unlock(); return ret; } -off_t LocalFileHandle::size() { +off_t LocalFileHandle::size() +{ lock(); off_t off = semihost_flen(_fh); unlock(); return off; } -void LocalFileHandle::lock() { +void LocalFileHandle::lock() +{ _mutex.lock(); } -void LocalFileHandle::unlock() { +void LocalFileHandle::unlock() +{ _mutex.unlock(); } @@ -185,18 +198,21 @@ class LocalDirHandle : public DirHandle { public: XFINFO info; - LocalDirHandle() : info() { + LocalDirHandle() : info() + { } - virtual int close() { + virtual int close() + { // No lock can be used in destructor delete this; return 0; } - virtual int read(struct dirent *ent) { + virtual int read(struct dirent *ent) + { lock(); - if (xffind("*", &info)!=0) { + if (xffind("*", &info) != 0) { unlock(); return 0; } @@ -205,20 +221,23 @@ class LocalDirHandle : public DirHandle { return 1; } - virtual void rewind() { + virtual void rewind() + { lock(); info.fileID = 0; unlock(); } - virtual off_t tell() { + virtual off_t tell() + { lock(); int fileId = info.fileID; unlock(); return fileId; } - virtual void seek(off_t offset) { + virtual void seek(off_t offset) + { lock(); info.fileID = offset; unlock(); @@ -227,16 +246,19 @@ class LocalDirHandle : public DirHandle { protected: PlatformMutex _mutex; - virtual void lock() { + virtual void lock() + { _mutex.lock(); } - virtual void unlock() { + virtual void unlock() + { _mutex.unlock(); } }; -int LocalFileSystem::open(FileHandle **file, const char* name, int flags) { +int LocalFileSystem::open(FileHandle **file, const char *name, int flags) +{ // No global state modified so function is thread safe /* reject filenames with / in them */ @@ -260,13 +282,15 @@ int LocalFileSystem::open(FileHandle **file, const char* name, int flags) { return 0; } -int LocalFileSystem::remove(const char *filename) { +int LocalFileSystem::remove(const char *filename) +{ // No global state modified so function is thread safe return semihost_remove(filename); } -int LocalFileSystem::open(DirHandle **dir, const char *name) { +int LocalFileSystem::open(DirHandle **dir, const char *name) +{ // No global state modified so function is thread safe *dir = new LocalDirHandle(); diff --git a/platform/LocalFileSystem.h b/platform/LocalFileSystem.h index ce0baafaf07..78ca4993750 100644 --- a/platform/LocalFileSystem.h +++ b/platform/LocalFileSystem.h @@ -32,7 +32,7 @@ namespace mbed { * @{ */ -FILEHANDLE local_file_open(const char* name, int flags); +FILEHANDLE local_file_open(const char *name, int flags); /** * @class LocalFileHandle @@ -106,7 +106,8 @@ class LocalFileSystem : public FileSystemLike, private NonCopyable { public: - PlatformMutex() { + PlatformMutex() + { // Stub } - ~PlatformMutex() { + ~PlatformMutex() + { // Stub } - void lock() { + void lock() + { // Do nothing } - void unlock() { + void unlock() + { // Do nothing } }; diff --git a/platform/ScopedLock.h b/platform/ScopedLock.h index 674462f2554..8f79fbf7ddd 100644 --- a/platform/ScopedLock.h +++ b/platform/ScopedLock.h @@ -65,7 +65,7 @@ class ScopedLock : private NonCopyable > { * @param lockable reference to the instance of Lockable object * @note lockable object should outlive the ScopedLock object */ - ScopedLock(Lockable& lockable): _lockable(lockable) + ScopedLock(Lockable &lockable): _lockable(lockable) { _lockable.lock(); } @@ -75,7 +75,7 @@ class ScopedLock : private NonCopyable > { _lockable.unlock(); } private: - Lockable& _lockable; + Lockable &_lockable; }; /**@}*/ diff --git a/platform/SingletonPtr.h b/platform/SingletonPtr.h index 848fd099f46..a7f5f6bde5b 100644 --- a/platform/SingletonPtr.h +++ b/platform/SingletonPtr.h @@ -56,7 +56,7 @@ inline static void singleton_lock(void) inline static void singleton_unlock(void) { #ifdef MBED_CONF_RTOS_PRESENT - osMutexRelease (singleton_mutex_id); + osMutexRelease(singleton_mutex_id); #endif } @@ -80,7 +80,8 @@ struct SingletonPtr { * @returns * A pointer to the singleton */ - T* get() { + T *get() + { if (NULL == _ptr) { singleton_lock(); if (NULL == _ptr) { @@ -99,7 +100,8 @@ struct SingletonPtr { * @returns * A pointer to the singleton */ - T* operator->() { + T *operator->() + { return get(); } diff --git a/platform/Stream.cpp b/platform/Stream.cpp index 63d83c5a4e6..3c14bb19c06 100644 --- a/platform/Stream.cpp +++ b/platform/Stream.cpp @@ -19,13 +19,14 @@ namespace mbed { -Stream::Stream(const char *name) : FileLike(name), _file(NULL) { +Stream::Stream(const char *name) : FileLike(name), _file(NULL) +{ // No lock needed in constructor /* open ourselves */ _file = fdopen(this, "w+"); // fdopen() will make us buffered because Stream::isatty() // wrongly returns zero which is not being changed for - // backward compatibility + // backward compatibility if (_file) { mbed_set_unbuffered_stream(_file); } else { @@ -33,47 +34,54 @@ Stream::Stream(const char *name) : FileLike(name), _file(NULL) { } } -Stream::~Stream() { +Stream::~Stream() +{ // No lock can be used in destructor fclose(_file); } -int Stream::putc(int c) { +int Stream::putc(int c) +{ lock(); fflush(_file); int ret = std::fputc(c, _file); unlock(); return ret; } -int Stream::puts(const char *s) { +int Stream::puts(const char *s) +{ lock(); fflush(_file); int ret = std::fputs(s, _file); unlock(); return ret; } -int Stream::getc() { +int Stream::getc() +{ lock(); fflush(_file); int ret = mbed_getc(_file); unlock(); return ret; } -char* Stream::gets(char *s, int size) { +char *Stream::gets(char *s, int size) +{ lock(); fflush(_file); - char *ret = mbed_gets(s,size,_file); + char *ret = mbed_gets(s, size, _file); unlock(); return ret; } -int Stream::close() { +int Stream::close() +{ return 0; } -ssize_t Stream::write(const void* buffer, size_t length) { - const char* ptr = (const char*)buffer; - const char* end = ptr + length; +ssize_t Stream::write(const void *buffer, size_t length) +{ + const char *ptr = (const char *)buffer; + const char *end = ptr + length; lock(); while (ptr != end) { @@ -83,48 +91,58 @@ ssize_t Stream::write(const void* buffer, size_t length) { } unlock(); - return ptr - (const char*)buffer; + return ptr - (const char *)buffer; } -ssize_t Stream::read(void* buffer, size_t length) { - char* ptr = (char*)buffer; - char* end = ptr + length; +ssize_t Stream::read(void *buffer, size_t length) +{ + char *ptr = (char *)buffer; + char *end = ptr + length; lock(); while (ptr != end) { int c = _getc(); - if (c==EOF) break; + if (c == EOF) { + break; + } *ptr++ = c; } unlock(); - return ptr - (const char*)buffer; + return ptr - (const char *)buffer; } -off_t Stream::seek(off_t offset, int whence) { +off_t Stream::seek(off_t offset, int whence) +{ return 0; } -off_t Stream::tell() { +off_t Stream::tell() +{ return 0; } -void Stream::rewind() { +void Stream::rewind() +{ } -int Stream::isatty() { +int Stream::isatty() +{ return 0; } -int Stream::sync() { +int Stream::sync() +{ return 0; } -off_t Stream::size() { +off_t Stream::size() +{ return 0; } -int Stream::printf(const char* format, ...) { +int Stream::printf(const char *format, ...) +{ lock(); std::va_list arg; va_start(arg, format); @@ -135,7 +153,8 @@ int Stream::printf(const char* format, ...) { return r; } -int Stream::scanf(const char* format, ...) { +int Stream::scanf(const char *format, ...) +{ lock(); std::va_list arg; va_start(arg, format); @@ -146,7 +165,8 @@ int Stream::scanf(const char* format, ...) { return r; } -int Stream::vprintf(const char* format, std::va_list args) { +int Stream::vprintf(const char *format, std::va_list args) +{ lock(); fflush(_file); int r = vfprintf(_file, format, args); @@ -154,7 +174,8 @@ int Stream::vprintf(const char* format, std::va_list args) { return r; } -int Stream::vscanf(const char* format, std::va_list args) { +int Stream::vscanf(const char *format, std::va_list args) +{ lock(); fflush(_file); int r = vfscanf(_file, format, args); diff --git a/platform/Stream.h b/platform/Stream.h index 20b7e44afcb..bb761a59790 100644 --- a/platform/Stream.h +++ b/platform/Stream.h @@ -33,7 +33,7 @@ namespace mbed { extern void mbed_set_unbuffered_stream(std::FILE *_file); extern int mbed_getc(std::FILE *_file); -extern char* mbed_gets(char *s, int size, std::FILE *_file); +extern char *mbed_gets(char *s, int size, std::FILE *_file); /** File stream * @@ -42,24 +42,27 @@ extern char* mbed_gets(char *s, int size, std::FILE *_file); class Stream : public FileLike, private NonCopyable { public: - Stream(const char *name=NULL); + Stream(const char *name = NULL); virtual ~Stream(); int putc(int c); int puts(const char *s); int getc(); char *gets(char *s, int size); - int printf(const char* format, ...); - int scanf(const char* format, ...); - int vprintf(const char* format, std::va_list args); - int vscanf(const char* format, std::va_list args); + int printf(const char *format, ...); + int scanf(const char *format, ...); + int vprintf(const char *format, std::va_list args); + int vscanf(const char *format, std::va_list args); - operator std::FILE*() {return _file;} + operator std::FILE *() + { + return _file; + } protected: virtual int close(); - virtual ssize_t write(const void* buffer, size_t length); - virtual ssize_t read(void* buffer, size_t length); + virtual ssize_t write(const void *buffer, size_t length); + virtual ssize_t read(void *buffer, size_t length); virtual off_t seek(off_t offset, int whence); virtual off_t tell(); virtual void rewind(); @@ -74,13 +77,15 @@ class Stream : public FileLike, private NonCopyable { /** Acquire exclusive access to this object. */ - virtual void lock() { + virtual void lock() + { // Stub } /** Release exclusive access to this object. */ - virtual void unlock() { + virtual void unlock() + { // Stub } }; diff --git a/platform/Transaction.h b/platform/Transaction.h index 23f03e07f22..1d8d6ff9de5 100644 --- a/platform/Transaction.h +++ b/platform/Transaction.h @@ -46,20 +46,24 @@ typedef struct { template class Transaction { public: - Transaction(Class *tpointer, const transaction_t& transaction) : _obj(tpointer), _data(transaction) { + Transaction(Class *tpointer, const transaction_t &transaction) : _obj(tpointer), _data(transaction) + { } - Transaction() : _obj(), _data() { + Transaction() : _obj(), _data() + { } - ~Transaction() { + ~Transaction() + { } /** Get object's instance for the transaction * * @return The object which was stored */ - Class* get_object() { + Class *get_object() + { return _obj; } @@ -67,12 +71,13 @@ class Transaction { * * @return The transaction which was stored */ - transaction_t* get_transaction() { + transaction_t *get_transaction() + { return &_data; } private: - Class* _obj; + Class *_obj; transaction_t _data; }; /**@}*/ diff --git a/platform/astyle-branch.out b/platform/astyle-branch.out new file mode 100644 index 00000000000..a72b2fde8fa --- /dev/null +++ b/platform/astyle-branch.out @@ -0,0 +1,74 @@ +Formatted .\ATCmdParser.cpp +Formatted .\ATCmdParser.h +Formatted .\Callback.h +Formatted .\CallChain.cpp +Formatted .\CallChain.h +Formatted .\CircularBuffer.h +Unchanged .\critical.h +Formatted .\CriticalSectionLock.h +Formatted .\CThunk.h +Unchanged .\DeepSleepLock.h +Formatted .\DirHandle.h +Formatted .\FileBase.cpp +Formatted .\FileBase.h +Unchanged .\FileHandle.cpp +Formatted .\FileHandle.h +Unchanged .\FileLike.h +Formatted .\FilePath.cpp +Formatted .\FilePath.h +Unchanged .\FileSystemHandle.cpp +Formatted .\FileSystemHandle.h +Formatted .\FileSystemLike.h +Formatted .\FunctionPointer.h +Formatted .\LocalFileSystem.cpp +Formatted .\LocalFileSystem.h +Formatted .\mbed_alloc_wrappers.cpp +Formatted .\mbed_application.c +Unchanged .\mbed_application.h +Unchanged .\mbed_assert.c +Unchanged .\mbed_assert.h +Formatted .\mbed_board.c +Formatted .\mbed_critical.c +Formatted .\mbed_critical.h +Formatted .\mbed_debug.h +Formatted .\mbed_error.c +Formatted .\mbed_error.h +Formatted .\mbed_error_hist.c +Formatted .\mbed_error_hist.h +Formatted .\mbed_interface.c +Formatted .\mbed_interface.h +Formatted .\mbed_mem_trace.cpp +Formatted .\mbed_mem_trace.h +Formatted .\mbed_mktime.c +Formatted .\mbed_mktime.h +Unchanged .\mbed_poll.cpp +Unchanged .\mbed_poll.h +Formatted .\mbed_power_mgmt.h +Unchanged .\mbed_preprocessor.h +Formatted .\mbed_retarget.cpp +Formatted .\mbed_retarget.h +Formatted .\mbed_rtc_time.cpp +Unchanged .\mbed_rtc_time.h +Formatted .\mbed_sdk_boot.c +Formatted .\mbed_semihost_api.c +Formatted .\mbed_semihost_api.h +Unchanged .\mbed_sleep.h +Unchanged .\mbed_stats.c +Unchanged .\mbed_stats.h +Formatted .\mbed_toolchain.h +Formatted .\mbed_wait_api.h +Formatted .\mbed_wait_api_no_rtos.c +Formatted .\mbed_wait_api_rtos.cpp +Formatted .\NonCopyable.h +Unchanged .\platform.h +Formatted .\PlatformMutex.h +Unchanged .\rtc_time.h +Formatted .\ScopedLock.h +Unchanged .\semihost_api.h +Formatted .\SingletonPtr.h +Unchanged .\sleep.h +Formatted .\Stream.cpp +Formatted .\Stream.h +Unchanged .\toolchain.h +Formatted .\Transaction.h +Unchanged .\wait_api.h diff --git a/platform/mbed_alloc_wrappers.cpp b/platform/mbed_alloc_wrappers.cpp index 58f153c70d0..87fcd95f142 100644 --- a/platform/mbed_alloc_wrappers.cpp +++ b/platform/mbed_alloc_wrappers.cpp @@ -76,33 +76,35 @@ void mbed_stats_heap_get(mbed_stats_heap_t *stats) #endif/* FEATURE_UVISOR */ extern "C" { - void * __real__malloc_r(struct _reent * r, size_t size); - void * __real__memalign_r(struct _reent * r, size_t alignment, size_t bytes); - void * __real__realloc_r(struct _reent * r, void * ptr, size_t size); - void __real__free_r(struct _reent * r, void * ptr); - void* __real__calloc_r(struct _reent * r, size_t nmemb, size_t size); - void* malloc_wrapper(struct _reent * r, size_t size, void * caller); - void free_wrapper(struct _reent * r, void * ptr, void* caller); + void *__real__malloc_r(struct _reent *r, size_t size); + void *__real__memalign_r(struct _reent *r, size_t alignment, size_t bytes); + void *__real__realloc_r(struct _reent *r, void *ptr, size_t size); + void __real__free_r(struct _reent *r, void *ptr); + void *__real__calloc_r(struct _reent *r, size_t nmemb, size_t size); + void *malloc_wrapper(struct _reent *r, size_t size, void *caller); + void free_wrapper(struct _reent *r, void *ptr, void *caller); } // TODO: memory tracing doesn't work with uVisor enabled. #if !defined(FEATURE_UVISOR) -extern "C" void * __wrap__malloc_r(struct _reent * r, size_t size) { +extern "C" void *__wrap__malloc_r(struct _reent *r, size_t size) +{ return malloc_wrapper(r, size, MBED_CALLER_ADDR()); } -extern "C" void * malloc_wrapper(struct _reent * r, size_t size, void * caller) { +extern "C" void *malloc_wrapper(struct _reent *r, size_t size, void *caller) +{ void *ptr = NULL; #ifdef MBED_MEM_TRACING_ENABLED mbed_mem_trace_lock(); #endif #ifdef MBED_HEAP_STATS_ENABLED malloc_stats_mutex->lock(); - alloc_info_t *alloc_info = (alloc_info_t*)__real__malloc_r(r, size + sizeof(alloc_info_t)); + alloc_info_t *alloc_info = (alloc_info_t *)__real__malloc_r(r, size + sizeof(alloc_info_t)); if (alloc_info != NULL) { alloc_info->size = size; - ptr = (void*)(alloc_info + 1); + ptr = (void *)(alloc_info + 1); heap_stats.current_size += size; heap_stats.total_size += size; heap_stats.alloc_cnt += 1; @@ -123,7 +125,8 @@ extern "C" void * malloc_wrapper(struct _reent * r, size_t size, void * caller) return ptr; } -extern "C" void * __wrap__realloc_r(struct _reent * r, void * ptr, size_t size) { +extern "C" void *__wrap__realloc_r(struct _reent *r, void *ptr, size_t size) +{ void *new_ptr = NULL; #ifdef MBED_MEM_TRACING_ENABLED mbed_mem_trace_lock(); @@ -139,7 +142,7 @@ extern "C" void * __wrap__realloc_r(struct _reent * r, void * ptr, size_t size) // Get old size uint32_t old_size = 0; if (ptr != NULL) { - alloc_info_t *alloc_info = ((alloc_info_t*)ptr) - 1; + alloc_info_t *alloc_info = ((alloc_info_t *)ptr) - 1; old_size = alloc_info->size; } @@ -152,7 +155,7 @@ extern "C" void * __wrap__realloc_r(struct _reent * r, void * ptr, size_t size) // and free the old buffer if (new_ptr != NULL) { uint32_t copy_size = (old_size < size) ? old_size : size; - memcpy(new_ptr, (void*)ptr, copy_size); + memcpy(new_ptr, (void *)ptr, copy_size); free(ptr); } #else // #ifdef MBED_HEAP_STATS_ENABLED @@ -165,11 +168,13 @@ extern "C" void * __wrap__realloc_r(struct _reent * r, void * ptr, size_t size) return new_ptr; } -extern "C" void __wrap__free_r(struct _reent * r, void * ptr) { +extern "C" void __wrap__free_r(struct _reent *r, void *ptr) +{ free_wrapper(r, ptr, MBED_CALLER_ADDR()); } -extern "C" void free_wrapper(struct _reent * r, void * ptr, void * caller) { +extern "C" void free_wrapper(struct _reent *r, void *ptr, void *caller) +{ #ifdef MBED_MEM_TRACING_ENABLED mbed_mem_trace_lock(); #endif @@ -177,11 +182,11 @@ extern "C" void free_wrapper(struct _reent * r, void * ptr, void * caller) { malloc_stats_mutex->lock(); alloc_info_t *alloc_info = NULL; if (ptr != NULL) { - alloc_info = ((alloc_info_t*)ptr) - 1; + alloc_info = ((alloc_info_t *)ptr) - 1; heap_stats.current_size -= alloc_info->size; heap_stats.alloc_cnt -= 1; } - __real__free_r(r, (void*)alloc_info); + __real__free_r(r, (void *)alloc_info); malloc_stats_mutex->unlock(); #else // #ifdef MBED_HEAP_STATS_ENABLED __real__free_r(r, ptr); @@ -192,7 +197,8 @@ extern "C" void free_wrapper(struct _reent * r, void * ptr, void * caller) { #endif // #ifdef MBED_MEM_TRACING_ENABLED } -extern "C" void * __wrap__calloc_r(struct _reent * r, size_t nmemb, size_t size) { +extern "C" void *__wrap__calloc_r(struct _reent *r, size_t nmemb, size_t size) +{ void *ptr = NULL; #ifdef MBED_MEM_TRACING_ENABLED mbed_mem_trace_lock(); @@ -214,7 +220,8 @@ extern "C" void * __wrap__calloc_r(struct _reent * r, size_t nmemb, size_t size) return ptr; } -extern "C" void * __wrap__memalign_r(struct _reent * r, size_t alignment, size_t bytes) { +extern "C" void *__wrap__memalign_r(struct _reent *r, size_t alignment, size_t bytes) +{ return __real__memalign_r(r, alignment, bytes); } @@ -255,26 +262,28 @@ extern "C" { void *SUPER_REALLOC(void *ptr, size_t size); void *SUPER_CALLOC(size_t nmemb, size_t size); void SUPER_FREE(void *ptr); - void *malloc_wrapper(size_t size, void* caller); - void free_wrapper(void *ptr, void* caller); + void *malloc_wrapper(size_t size, void *caller); + void free_wrapper(void *ptr, void *caller); } -extern "C" void* SUB_MALLOC(size_t size) { +extern "C" void *SUB_MALLOC(size_t size) +{ return malloc_wrapper(size, MBED_CALLER_ADDR()); } -extern "C" void* malloc_wrapper(size_t size, void* caller) { +extern "C" void *malloc_wrapper(size_t size, void *caller) +{ void *ptr = NULL; #ifdef MBED_MEM_TRACING_ENABLED mbed_mem_trace_lock(); #endif #ifdef MBED_HEAP_STATS_ENABLED malloc_stats_mutex->lock(); - alloc_info_t *alloc_info = (alloc_info_t*)SUPER_MALLOC(size + sizeof(alloc_info_t)); + alloc_info_t *alloc_info = (alloc_info_t *)SUPER_MALLOC(size + sizeof(alloc_info_t)); if (alloc_info != NULL) { alloc_info->size = size; - ptr = (void*)(alloc_info + 1); + ptr = (void *)(alloc_info + 1); heap_stats.current_size += size; heap_stats.total_size += size; heap_stats.alloc_cnt += 1; @@ -296,7 +305,8 @@ extern "C" void* malloc_wrapper(size_t size, void* caller) { } -extern "C" void* SUB_REALLOC(void *ptr, size_t size) { +extern "C" void *SUB_REALLOC(void *ptr, size_t size) +{ void *new_ptr = NULL; #ifdef MBED_MEM_TRACING_ENABLED mbed_mem_trace_lock(); @@ -307,7 +317,7 @@ extern "C" void* SUB_REALLOC(void *ptr, size_t size) { // Get old size uint32_t old_size = 0; if (ptr != NULL) { - alloc_info_t *alloc_info = ((alloc_info_t*)ptr) - 1; + alloc_info_t *alloc_info = ((alloc_info_t *)ptr) - 1; old_size = alloc_info->size; } @@ -320,7 +330,7 @@ extern "C" void* SUB_REALLOC(void *ptr, size_t size) { // and free the old buffer if (new_ptr != NULL) { uint32_t copy_size = (old_size < size) ? old_size : size; - memcpy(new_ptr, (void*)ptr, copy_size); + memcpy(new_ptr, (void *)ptr, copy_size); free(ptr); } #else // #ifdef MBED_HEAP_STATS_ENABLED @@ -333,7 +343,8 @@ extern "C" void* SUB_REALLOC(void *ptr, size_t size) { return new_ptr; } -extern "C" void *SUB_CALLOC(size_t nmemb, size_t size) { +extern "C" void *SUB_CALLOC(size_t nmemb, size_t size) +{ void *ptr = NULL; #ifdef MBED_MEM_TRACING_ENABLED mbed_mem_trace_lock(); @@ -354,11 +365,13 @@ extern "C" void *SUB_CALLOC(size_t nmemb, size_t size) { return ptr; } -extern "C" void SUB_FREE(void *ptr) { +extern "C" void SUB_FREE(void *ptr) +{ free_wrapper(ptr, MBED_CALLER_ADDR()); } -extern "C" void free_wrapper(void *ptr, void* caller) { +extern "C" void free_wrapper(void *ptr, void *caller) +{ #ifdef MBED_MEM_TRACING_ENABLED mbed_mem_trace_lock(); #endif @@ -366,11 +379,11 @@ extern "C" void free_wrapper(void *ptr, void* caller) { malloc_stats_mutex->lock(); alloc_info_t *alloc_info = NULL; if (ptr != NULL) { - alloc_info = ((alloc_info_t*)ptr) - 1; + alloc_info = ((alloc_info_t *)ptr) - 1; heap_stats.current_size -= alloc_info->size; heap_stats.alloc_cnt -= 1; } - SUPER_FREE((void*)alloc_info); + SUPER_FREE((void *)alloc_info); malloc_stats_mutex->unlock(); #else // #ifdef MBED_HEAP_STATS_ENABLED SUPER_FREE(ptr); diff --git a/platform/mbed_application.c b/platform/mbed_application.c index 9cfe8b07208..9953130bfd1 100644 --- a/platform/mbed_application.c +++ b/platform/mbed_application.c @@ -23,11 +23,33 @@ #if defined(__CORTEX_A9) +static void powerdown_gic(void); + void mbed_start_application(uintptr_t address) { + __disable_irq(); + powerdown_gic(); + __enable_irq(); ((void(*)())address)(); } +static void powerdown_gic() +{ + int i; + int j; + + for (i = 0; i < 32; i++) { + GICDistributor->ICENABLER[i] = 0xFFFFFFFF; + GICDistributor->ICPENDR[i] = 0xFFFFFFFF; + if (i < 4) { + GICDistributor->CPENDSGIR[i] = 0xFFFFFFFF; + } + for (j = 0; j < 8; j++) { + GICDistributor->IPRIORITYR[i*8+j] = 0x00000000; + } + } +} + #else static void powerdown_nvic(void); @@ -46,8 +68,8 @@ void mbed_start_application(uintptr_t address) powerdown_nvic(); powerdown_scb(address); - sp = *((void**)address + 0); - pc = *((void**)address + 1); + sp = *((void **)address + 0); + pc = *((void **)address + 1); start_new_application(sp, pc); } @@ -133,16 +155,16 @@ __asm static void start_new_application(void *sp, void *pc) void start_new_application(void *sp, void *pc) { - __asm volatile ( + __asm volatile( "movw r2, #0 \n" // Fail to compile "mov r2, #0" with ARMC6. Replace with MOVW. - // We needn't "movt r2, #0" immediately following because MOVW - // will zero-extend the 16-bit immediate. + // We needn't "movt r2, #0" immediately following because MOVW + // will zero-extend the 16-bit immediate. "msr control, r2 \n" // Switch to main stack "mov sp, %0 \n" "msr primask, r2 \n" // Enable interrupts "bx %1 \n" : - : "l" (sp), "l" (pc) + : "l"(sp), "l"(pc) : "r2", "cc", "memory" ); } diff --git a/platform/mbed_board.c b/platform/mbed_board.c index 227c774c8b2..0c837cfb32f 100644 --- a/platform/mbed_board.c +++ b/platform/mbed_board.c @@ -26,11 +26,13 @@ extern int stdio_uart_inited; extern serial_t stdio_uart; #endif -WEAK void mbed_die(void) { +WEAK void mbed_die(void) +{ #if !defined (NRF51_H) && !defined(TARGET_EFM32) core_util_critical_section_enter(); #endif - gpio_t led_err; gpio_init_out(&led_err, LED1); + gpio_t led_err; + gpio_init_out(&led_err, LED1); while (1) { for (int i = 0; i < 4; ++i) { @@ -49,14 +51,16 @@ WEAK void mbed_die(void) { } } -void mbed_error_printf(const char* format, ...) { +void mbed_error_printf(const char *format, ...) +{ va_list arg; va_start(arg, format); mbed_error_vfprintf(format, arg); va_end(arg); } -void mbed_error_vfprintf(const char * format, va_list arg) { +void mbed_error_vfprintf(const char *format, va_list arg) +{ #if DEVICE_SERIAL #define ERROR_BUF_SIZE (128) core_util_critical_section_enter(); @@ -70,7 +74,7 @@ void mbed_error_vfprintf(const char * format, va_list arg) { char stdio_out_prev = '\0'; for (int i = 0; i < size; i++) { if (buffer[i] == '\n' && stdio_out_prev != '\r') { - serial_putc(&stdio_uart, '\r'); + serial_putc(&stdio_uart, '\r'); } serial_putc(&stdio_uart, buffer[i]); stdio_out_prev = buffer[i]; diff --git a/platform/mbed_critical.c b/platform/mbed_critical.c index d9dcc78a4b3..3b3aaa566fd 100644 --- a/platform/mbed_critical.c +++ b/platform/mbed_critical.c @@ -38,7 +38,7 @@ #else #error "Unknown architecture for exclusive access" #endif -#else +#else #define MBED_EXCLUSIVE_ACCESS __EXCLUSIVE_ACCESS #endif #endif @@ -57,7 +57,7 @@ bool core_util_are_interrupts_enabled(void) bool core_util_is_isr_active(void) { #if defined(__CORTEX_A9) - switch(__get_CPSR() & 0x1FU) { + switch (__get_CPSR() & 0x1FU) { case CPSR_M_USR: case CPSR_M_SYS: return false; @@ -79,7 +79,7 @@ void core_util_critical_section_enter(void) { // FIXME #ifdef FEATURE_UVISOR - #warning "core_util_critical_section_enter needs fixing to work from unprivileged code" +#warning "core_util_critical_section_enter needs fixing to work from unprivileged code" #else // If the reentrancy counter overflows something has gone badly wrong. MBED_ASSERT(critical_section_reentrancy_counter < UINT32_MAX); @@ -94,7 +94,7 @@ void core_util_critical_section_exit(void) { // FIXME #ifdef FEATURE_UVISOR - #warning "core_util_critical_section_exit needs fixing to work from unprivileged code" +#warning "core_util_critical_section_exit needs fixing to work from unprivileged code" #endif /* FEATURE_UVISOR */ // If critical_section_enter has not previously been called, do nothing @@ -112,7 +112,7 @@ void core_util_critical_section_exit(void) #if MBED_EXCLUSIVE_ACCESS /* Supress __ldrex and __strex deprecated warnings - "#3731-D: intrinsic is deprecated" */ -#if defined (__CC_ARM) +#if defined (__CC_ARM) #pragma diag_suppress 3731 #endif @@ -330,18 +330,21 @@ uint32_t core_util_atomic_decr_u32(volatile uint32_t *valuePtr, uint32_t delta) #endif -bool core_util_atomic_cas_ptr(void * volatile *ptr, void **expectedCurrentValue, void *desiredValue) { +bool core_util_atomic_cas_ptr(void *volatile *ptr, void **expectedCurrentValue, void *desiredValue) +{ return core_util_atomic_cas_u32( - (volatile uint32_t *)ptr, - (uint32_t *)expectedCurrentValue, - (uint32_t)desiredValue); + (volatile uint32_t *)ptr, + (uint32_t *)expectedCurrentValue, + (uint32_t)desiredValue); } -void *core_util_atomic_incr_ptr(void * volatile *valuePtr, ptrdiff_t delta) { +void *core_util_atomic_incr_ptr(void *volatile *valuePtr, ptrdiff_t delta) +{ return (void *)core_util_atomic_incr_u32((volatile uint32_t *)valuePtr, (uint32_t)delta); } -void *core_util_atomic_decr_ptr(void * volatile *valuePtr, ptrdiff_t delta) { +void *core_util_atomic_decr_ptr(void *volatile *valuePtr, ptrdiff_t delta) +{ return (void *)core_util_atomic_decr_u32((volatile uint32_t *)valuePtr, (uint32_t)delta); } diff --git a/platform/mbed_critical.h b/platform/mbed_critical.h index 17ec7889343..f5ecc37aabd 100644 --- a/platform/mbed_critical.h +++ b/platform/mbed_critical.h @@ -315,7 +315,7 @@ bool core_util_atomic_cas_u32(volatile uint32_t *ptr, uint32_t *expectedCurrentV * always succeeds if the current value is expected, as per the pseudocode * above; it will not spuriously fail as "atomic_compare_exchange_weak" may. */ -bool core_util_atomic_cas_ptr(void * volatile *ptr, void **expectedCurrentValue, void *desiredValue); +bool core_util_atomic_cas_ptr(void *volatile *ptr, void **expectedCurrentValue, void *desiredValue); /** * Atomic increment. @@ -350,7 +350,7 @@ uint32_t core_util_atomic_incr_u32(volatile uint32_t *valuePtr, uint32_t delta); * @note The type of the pointer argument is not taken into account * and the pointer is incremented by bytes. */ -void *core_util_atomic_incr_ptr(void * volatile *valuePtr, ptrdiff_t delta); +void *core_util_atomic_incr_ptr(void *volatile *valuePtr, ptrdiff_t delta); /** * Atomic decrement. @@ -385,7 +385,7 @@ uint32_t core_util_atomic_decr_u32(volatile uint32_t *valuePtr, uint32_t delta); * @note The type of the pointer argument is not taken into account * and the pointer is decremented by bytes */ -void *core_util_atomic_decr_ptr(void * volatile *valuePtr, ptrdiff_t delta); +void *core_util_atomic_decr_ptr(void *volatile *valuePtr, ptrdiff_t delta); #ifdef __cplusplus } // extern "C" diff --git a/platform/mbed_debug.h b/platform/mbed_debug.h index 5f9a19805d6..5ccc123bb07 100644 --- a/platform/mbed_debug.h +++ b/platform/mbed_debug.h @@ -5,7 +5,7 @@ * \defgroup platform_debug Debug functions * @{ */ - + /* mbed Microcontroller Library * Copyright (c) 2006-2013 ARM Limited * @@ -37,7 +37,8 @@ extern "C" { * * @param format printf-style format string, followed by variables */ -static inline void debug(const char *format, ...) { +static inline void debug(const char *format, ...) +{ #if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) va_list args; va_start(args, format); @@ -55,7 +56,8 @@ static inline void debug(const char *format, ...) { * @param condition output only if condition is true (!= 0) * @param format printf-style format string, followed by variables */ -static inline void debug_if(int condition, const char *format, ...) { +static inline void debug_if(int condition, const char *format, ...) +{ #if DEVICE_STDIO_MESSAGES && !defined(NDEBUG) if (condition) { va_list args; diff --git a/platform/mbed_error.c b/platform/mbed_error.c index 1fcaa7c35cf..d0c8ec9b5f5 100644 --- a/platform/mbed_error.c +++ b/platform/mbed_error.c @@ -21,7 +21,7 @@ #include "platform/mbed_error.h" #include "platform/mbed_error_hist.h" #include "platform/mbed_interface.h" -#ifdef MBED_CONF_RTOS_PRESENT +#ifdef MBED_CONF_RTOS_PRESENT #include "rtx_os.h" #endif @@ -43,8 +43,13 @@ sp = __get_PSP();/*Read PSP*/ \ } \ } \ - } + } +#ifndef NDEBUG +#define ERROR_REPORT(ctx, error_msg) print_error_report(ctx, error_msg) +#else +#define ERROR_REPORT(ctx, error_msg) ((void) 0) +#endif static uint8_t error_in_progress = 0; static int error_count = 0; @@ -59,8 +64,8 @@ static void mbed_halt_system(void) { //If not in ISR context exit, otherwise spin on WFI if (core_util_is_isr_active() || !core_util_are_interrupts_enabled()) { - for(;;) { - __WFI(); + for (;;) { + __WFI(); } } else { //exit eventually calls mbed_die @@ -68,16 +73,17 @@ static void mbed_halt_system(void) } } -WEAK void error(const char* format, ...) { +WEAK void error(const char *format, ...) +{ // Prevent recursion if error is called again if (error_in_progress) { return; } - + //Call handle_error/print_error_report permanently setting error_in_progress flag handle_error(MBED_ERROR_UNKNOWN, 0, NULL, 0); - print_error_report(&last_error_ctx, "Fatal Run-time error"); + ERROR_REPORT(&last_error_ctx, "Fatal Run-time error"); error_in_progress = 1; #ifndef NDEBUG @@ -90,170 +96,173 @@ WEAK void error(const char* format, ...) { } //Set an error status with the error handling system -static mbed_error_status_t handle_error(mbed_error_status_t error_status, unsigned int error_value, const char *filename, int line_number) +static mbed_error_status_t handle_error(mbed_error_status_t error_status, unsigned int error_value, const char *filename, int line_number) { mbed_error_ctx current_error_ctx; - + //Error status should always be < 0 if (error_status >= 0) { //This is a weird situation, someone called mbed_error with invalid error code. //We will still handle the situation but change the error code to ERROR_INVALID_ARGUMENT, atleast the context will have info on who called it error_status = MBED_ERROR_INVALID_ARGUMENT; } - + //Prevent corruption by holding out other callers //and we also need this until we remove the "error" call completely while (error_in_progress == 1); - + //Use critsect here, as we don't want inadvertant modification of this global variable core_util_critical_section_enter(); error_in_progress = 1; core_util_critical_section_exit(); - + //Increment error count error_count++; - + //Clear the context capturing buffer memset(¤t_error_ctx, sizeof(mbed_error_ctx), 0); //Capture error information current_error_ctx.error_status = error_status; current_error_ctx.error_address = (uint32_t)MBED_CALLER_ADDR(); current_error_ctx.error_value = error_value; -#ifdef MBED_CONF_RTOS_PRESENT +#ifdef MBED_CONF_RTOS_PRESENT //Capture thread info osRtxThread_t *current_thread = osRtxInfo.thread.run.curr; current_error_ctx.thread_id = (uint32_t)current_thread; current_error_ctx.thread_entry_address = (uint32_t)current_thread->thread_addr; current_error_ctx.thread_stack_size = current_thread->stack_size; current_error_ctx.thread_stack_mem = (uint32_t)current_thread->stack_mem; -#ifdef TARGET_CORTEX_M +#ifdef TARGET_CORTEX_M GET_CURRENT_SP(current_error_ctx.thread_current_sp); #endif //TARGET_CORTEX_M - + #endif //MBED_CONF_RTOS_PRESENT -#ifdef MBED_CONF_PLATFORM_ERROR_FILENAME_CAPTURE_ENABLED +#if MBED_CONF_PLATFORM_ERROR_FILENAME_CAPTURE_ENABLED //Capture filename/linenumber if provided //Index for tracking error_filename memset(¤t_error_ctx.error_filename, 0, MBED_CONF_PLATFORM_MAX_ERROR_FILENAME_LEN); strncpy(current_error_ctx.error_filename, filename, MBED_CONF_PLATFORM_MAX_ERROR_FILENAME_LEN); current_error_ctx.error_line_number = line_number; #endif - + //Capture the fist system error and store it if (error_count == 1) { //first error memcpy(&first_error_ctx, ¤t_error_ctx, sizeof(mbed_error_ctx)); } - + //copy this error to last error memcpy(&last_error_ctx, ¤t_error_ctx, sizeof(mbed_error_ctx)); - + #if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED //Log the error with error log mbed_error_hist_put(¤t_error_ctx); -#endif - +#endif + //Call the error hook if available if (error_hook != NULL) { error_hook(&last_error_ctx); } - + error_in_progress = 0; - + return MBED_SUCCESS; } //Return the first error -mbed_error_status_t mbed_get_first_error(void) +mbed_error_status_t mbed_get_first_error(void) { //return the first error recorded return first_error_ctx.error_status; } //Return the last error -mbed_error_status_t mbed_get_last_error(void) +mbed_error_status_t mbed_get_last_error(void) { //return the last error recorded return last_error_ctx.error_status; } //Gets the current error count -int mbed_get_error_count(void) +int mbed_get_error_count(void) { //return the current error count return error_count; } -//Sets a fatal error -mbed_error_status_t mbed_warning(mbed_error_status_t error_status, const char *error_msg, unsigned int error_value, const char *filename, int line_number) +//Sets a fatal error +mbed_error_status_t mbed_warning(mbed_error_status_t error_status, const char *error_msg, unsigned int error_value, const char *filename, int line_number) { return handle_error(error_status, error_value, filename, line_number); } -//Sets a fatal error, this function is marked WEAK to be able to override this for some tests -WEAK mbed_error_status_t mbed_error(mbed_error_status_t error_status, const char *error_msg, unsigned int error_value, const char *filename, int line_number) +//Sets a fatal error, this function is marked WEAK to be able to override this for some tests +WEAK mbed_error_status_t mbed_error(mbed_error_status_t error_status, const char *error_msg, unsigned int error_value, const char *filename, int line_number) { //set the error reported and then halt the system - if ( MBED_SUCCESS != handle_error(error_status, error_value, filename, line_number)) + if (MBED_SUCCESS != handle_error(error_status, error_value, filename, line_number)) { return MBED_ERROR_FAILED_OPERATION; - + } + //On fatal errors print the error context/report - print_error_report(&last_error_ctx, error_msg); + ERROR_REPORT(&last_error_ctx, error_msg); mbed_halt_system(); - + return MBED_ERROR_FAILED_OPERATION; } //Register an application defined callback with error handling -mbed_error_status_t mbed_set_error_hook(mbed_error_hook_t error_hook_in) +mbed_error_status_t mbed_set_error_hook(mbed_error_hook_t error_hook_in) { //register the new hook/callback - if ( error_hook_in != NULL ) { + if (error_hook_in != NULL) { error_hook = error_hook_in; return MBED_SUCCESS; - } - + } + return MBED_ERROR_INVALID_ARGUMENT; } -//Retrieve the first error context from error log -mbed_error_status_t mbed_get_first_error_info (mbed_error_ctx *error_info) +//Retrieve the first error context from error log +mbed_error_status_t mbed_get_first_error_info(mbed_error_ctx *error_info) { memcpy(error_info, &first_error_ctx, sizeof(first_error_ctx)); return MBED_SUCCESS; } -//Retrieve the last error context from error log -mbed_error_status_t mbed_get_last_error_info (mbed_error_ctx *error_info) +//Retrieve the last error context from error log +mbed_error_status_t mbed_get_last_error_info(mbed_error_ctx *error_info) { memcpy(error_info, &last_error_ctx, sizeof(mbed_error_ctx)); return MBED_SUCCESS; } //Makes an mbed_error_status_t value -mbed_error_status_t mbed_make_error(mbed_error_type_t error_type, mbed_module_type_t entity, mbed_error_code_t error_code) +mbed_error_status_t mbed_make_error(mbed_error_type_t error_type, mbed_module_type_t entity, mbed_error_code_t error_code) { - switch(error_type) - { + switch (error_type) { case MBED_ERROR_TYPE_POSIX: - if (error_code >= MBED_POSIX_ERROR_BASE && error_code <= MBED_SYSTEM_ERROR_BASE) + if (error_code >= MBED_POSIX_ERROR_BASE && error_code <= MBED_SYSTEM_ERROR_BASE) { return -error_code; + } break; - + case MBED_ERROR_TYPE_SYSTEM: - if (error_code >= MBED_SYSTEM_ERROR_BASE && error_code <= MBED_CUSTOM_ERROR_BASE) + if (error_code >= MBED_SYSTEM_ERROR_BASE && error_code <= MBED_CUSTOM_ERROR_BASE) { return MAKE_MBED_ERROR(MBED_ERROR_TYPE_SYSTEM, entity, error_code); + } break; - + case MBED_ERROR_TYPE_CUSTOM: - if (error_code >= MBED_CUSTOM_ERROR_BASE) + if (error_code >= MBED_CUSTOM_ERROR_BASE) { return MAKE_MBED_ERROR(MBED_ERROR_TYPE_CUSTOM, entity, error_code); + } break; - + default: break; } - + //If we are passed incorrect values return a generic system error return MAKE_MBED_ERROR(MBED_ERROR_TYPE_SYSTEM, MBED_MODULE_UNKNOWN, MBED_ERROR_CODE_UNKNOWN); } @@ -263,21 +272,21 @@ mbed_error_status_t mbed_make_error(mbed_error_type_t error_type, mbed_module_ty * @return 0 or MBED_SUCCESS on success. * */ -mbed_error_status_t mbed_clear_all_errors(void) +mbed_error_status_t mbed_clear_all_errors(void) { mbed_error_status_t status = MBED_SUCCESS; - + //Make sure we dont multiple clients resetting core_util_critical_section_enter(); //Clear the error and context capturing buffer memset(&last_error_ctx, sizeof(mbed_error_ctx), 0); //reset error count to 0 error_count = 0; -#if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED +#if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED status = mbed_error_hist_reset(); #endif core_util_critical_section_exit(); - + return status; } @@ -292,106 +301,108 @@ static void print_thread(osRtxThread_t *thread) static void print_threads_info(osRtxThread_t *threads) { while (threads != NULL) { - print_thread( threads ); + print_thread(threads); threads = threads->thread_next; } } #endif +#ifndef NDEBUG static void print_error_report(mbed_error_ctx *ctx, const char *error_msg) { uint32_t error_code = MBED_GET_ERROR_CODE(ctx->error_status); uint32_t error_module = MBED_GET_ERROR_MODULE(ctx->error_status); - + mbed_error_printf("\n\n++ MbedOS Error Info ++\nError Status: 0x%X Code: %d Module: %d\nError Message: ", ctx->error_status, error_code, error_module); - + switch (error_code) { //These are errors reported by kernel handled from mbed_rtx_handlers case MBED_ERROR_CODE_RTOS_EVENT: mbed_error_printf("Kernel Error: 0x%X, ", ctx->error_value); break; - + case MBED_ERROR_CODE_RTOS_THREAD_EVENT: mbed_error_printf("Thread: 0x%X, ", ctx->error_value); break; - + case MBED_ERROR_CODE_RTOS_MUTEX_EVENT: mbed_error_printf("Mutex: 0x%X, ", ctx->error_value); break; - + case MBED_ERROR_CODE_RTOS_SEMAPHORE_EVENT: mbed_error_printf("Semaphore: 0x%X, ", ctx->error_value); break; - + case MBED_ERROR_CODE_RTOS_MEMORY_POOL_EVENT: mbed_error_printf("MemoryPool: 0x%X, ", ctx->error_value); break; - + case MBED_ERROR_CODE_RTOS_EVENT_FLAGS_EVENT: mbed_error_printf("EventFlags: 0x%X, ", ctx->error_value); break; - + case MBED_ERROR_CODE_RTOS_TIMER_EVENT: mbed_error_printf("Timer: 0x%X, ", ctx->error_value); break; - - case MBED_ERROR_CODE_RTOS_MESSAGE_QUEUE_EVENT: + + case MBED_ERROR_CODE_RTOS_MESSAGE_QUEUE_EVENT: mbed_error_printf("MessageQueue: 0x%X, ", ctx->error_value); break; - + default: //Nothing to do here, just print the error info down break; } mbed_error_printf(error_msg); mbed_error_printf("\nLocation: 0x%X", ctx->error_address); - + #if MBED_CONF_PLATFORM_ERROR_FILENAME_CAPTURE_ENABLED && !defined(NDEBUG) if ((NULL != ctx->error_filename[0]) && (ctx->error_line_number != 0)) { - //for string, we must pass address of a ptr which has the address of the string + //for string, we must pass address of a ptr which has the address of the string mbed_error_printf("\nFile:%s+%d", ctx->error_filename, ctx->error_line_number); } -#endif - +#endif + mbed_error_printf("\nError Value: 0x%X", ctx->error_value); #ifdef TARGET_CORTEX_M - mbed_error_printf("\nCurrent Thread: Id: 0x%X Entry: 0x%X StackSize: 0x%X StackMem: 0x%X SP: 0x%X ", - ctx->thread_id, ctx->thread_entry_address, ctx->thread_stack_size, ctx->thread_stack_mem, ctx->thread_current_sp); + mbed_error_printf("\nCurrent Thread: Id: 0x%X Entry: 0x%X StackSize: 0x%X StackMem: 0x%X SP: 0x%X ", + ctx->thread_id, ctx->thread_entry_address, ctx->thread_stack_size, ctx->thread_stack_mem, ctx->thread_current_sp); #else //For Cortex-A targets we dont have support to capture the current SP - mbed_error_printf("\nCurrent Thread: Id: 0x%X Entry: 0x%X StackSize: 0x%X StackMem: 0x%X ", - ctx->thread_id, ctx->thread_entry_address, ctx->thread_stack_size, ctx->thread_stack_mem); + mbed_error_printf("\nCurrent Thread: Id: 0x%X Entry: 0x%X StackSize: 0x%X StackMem: 0x%X ", + ctx->thread_id, ctx->thread_entry_address, ctx->thread_stack_size, ctx->thread_stack_mem); #endif //TARGET_CORTEX_M - + #if MBED_CONF_PLATFORM_ERROR_ALL_THREADS_INFO && defined(MBED_CONF_RTOS_PRESENT) mbed_error_printf("\nNext:"); print_thread(osRtxInfo.thread.run.next); - + mbed_error_printf("\nWait:"); osRtxThread_t *threads = (osRtxThread_t *)&osRtxInfo.thread.wait_list; print_threads_info(threads); - + mbed_error_printf("\nDelay:"); threads = (osRtxThread_t *)&osRtxInfo.thread.delay_list; print_threads_info(threads); - + mbed_error_printf("\nIdle:"); threads = (osRtxThread_t *)&osRtxInfo.thread.idle; print_threads_info(threads); #endif - + mbed_error_printf("\n-- MbedOS Error Info --\n"); } +#endif //ifndef NDEBUG #if MBED_CONF_PLATFORM_ERROR_HIST_ENABLED //Retrieve the error context from error log at the specified index -mbed_error_status_t mbed_get_error_hist_info (int index, mbed_error_ctx *error_info) +mbed_error_status_t mbed_get_error_hist_info(int index, mbed_error_ctx *error_info) { return mbed_error_hist_get(index, error_info); } //Retrieve the error log count -int mbed_get_error_hist_count(void) +int mbed_get_error_hist_count(void) { return mbed_error_hist_get_count(); } @@ -402,56 +413,56 @@ mbed_error_status_t mbed_save_error_hist(const char *path) mbed_error_ctx ctx = {0}; int log_count = mbed_error_hist_get_count(); FILE *error_log_file = NULL; - + //Ensure path is valid - if (path==NULL) { + if (path == NULL) { ret = MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_INVALID_ARGUMENT); goto exit; } - + //Open the file for saving the error log info - if ((error_log_file = fopen( path, "w" )) == NULL){ + if ((error_log_file = fopen(path, "w")) == NULL) { ret = MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_OPEN_FAILED); goto exit; } - + //First store the first and last errors - if (fprintf(error_log_file, "\nFirst Error: Status:0x%x ThreadId:0x%x Address:0x%x Value:0x%x\n", - (unsigned int)first_error_ctx.error_status, - (unsigned int)first_error_ctx.thread_id, - (unsigned int)first_error_ctx.error_address, - (unsigned int)first_error_ctx.error_value) <= 0) { + if (fprintf(error_log_file, "\nFirst Error: Status:0x%x ThreadId:0x%x Address:0x%x Value:0x%x\n", + (unsigned int)first_error_ctx.error_status, + (unsigned int)first_error_ctx.thread_id, + (unsigned int)first_error_ctx.error_address, + (unsigned int)first_error_ctx.error_value) <= 0) { ret = MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_WRITE_FAILED); goto exit; } - - if (fprintf(error_log_file, "\nLast Error: Status:0x%x ThreadId:0x%x Address:0x%x Value:0x%x\n", - (unsigned int)last_error_ctx.error_status, - (unsigned int)last_error_ctx.thread_id, - (unsigned int)last_error_ctx.error_address, - (unsigned int)last_error_ctx.error_value) <= 0) { + + if (fprintf(error_log_file, "\nLast Error: Status:0x%x ThreadId:0x%x Address:0x%x Value:0x%x\n", + (unsigned int)last_error_ctx.error_status, + (unsigned int)last_error_ctx.thread_id, + (unsigned int)last_error_ctx.error_address, + (unsigned int)last_error_ctx.error_value) <= 0) { ret = MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_WRITE_FAILED); goto exit; } - + //Update with error log info while (--log_count >= 0) { mbed_error_hist_get(log_count, &ctx); //first line of file will be error log count - if (fprintf(error_log_file, "\n%d: Status:0x%x ThreadId:0x%x Address:0x%x Value:0x%x\n", - log_count, - (unsigned int)ctx.error_status, - (unsigned int)ctx.thread_id, - (unsigned int)ctx.error_address, - (unsigned int)ctx.error_value) <= 0) { + if (fprintf(error_log_file, "\n%d: Status:0x%x ThreadId:0x%x Address:0x%x Value:0x%x\n", + log_count, + (unsigned int)ctx.error_status, + (unsigned int)ctx.thread_id, + (unsigned int)ctx.error_address, + (unsigned int)ctx.error_value) <= 0) { ret = MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_WRITE_FAILED); goto exit; } } - + exit: fclose(error_log_file); - + return ret; } #endif diff --git a/platform/mbed_error.h b/platform/mbed_error.h index 630b052bcdc..3ba9fd24aad 100644 --- a/platform/mbed_error.h +++ b/platform/mbed_error.h @@ -29,14 +29,14 @@ extern "C" { #endif -/** Define this macro to include filenames in error context. For release builds, do not include filename to save memory. +/** Define this macro to include filenames in error context. For release builds, do not include filename to save memory. * MBED_PLATFORM_CONF_ERROR_FILENAME_CAPTURE_ENABLED - */ + */ /** Define this macro to enable error history - * MBED_PLATFORM_CONF_ERROR_HIST_ENABLED + * MBED_PLATFORM_CONF_ERROR_HIST_ENABLED */ - + #ifndef MBED_CONF_PLATFORM_MAX_ERROR_FILENAME_LEN #define MBED_CONF_PLATFORM_MAX_ERROR_FILENAME_LEN 16 #else //MBED_CONF_PLATFORM_MAX_ERROR_FILENAME_LEN @@ -46,7 +46,7 @@ extern "C" { //longer that 64 bytes with the current implementation. #error "Unsupported error filename buffer length detected, max supported length is 64 chars. Please change MBED_CONF_PLATFORM_MAX_ERROR_FILENAME_LEN or max-error-filename-len in configuration." #endif -#endif +#endif #define MBED_ERROR_STATUS_CODE_MASK (0x0000FFFF) #define MBED_ERROR_STATUS_CODE_POS (0) @@ -68,10 +68,10 @@ extern "C" { ((0x80000000) | \ (MBED_ERROR_STATUS_CODE_MASK & (error_code << MBED_ERROR_STATUS_CODE_POS)) | \ (MBED_ERROR_STATUS_MODULE_MASK & (module << MBED_ERROR_STATUS_MODULE_POS)) | \ - (MBED_ERROR_STATUS_TYPE_MASK & (type << MBED_ERROR_STATUS_TYPE_POS))) + (MBED_ERROR_STATUS_TYPE_MASK & (type << MBED_ERROR_STATUS_TYPE_POS))) #define MBED_GET_ERROR_TYPE( error_status ) ((error_status & MBED_ERROR_STATUS_TYPE_MASK) >> MBED_ERROR_STATUS_TYPE_POS) -#define MBED_GET_ERROR_MODULE( error_status ) ((error_status & MBED_ERROR_STATUS_MODULE_MASK) >> MBED_ERROR_STATUS_MODULE_POS) +#define MBED_GET_ERROR_MODULE( error_status ) ((error_status & MBED_ERROR_STATUS_MODULE_MASK) >> MBED_ERROR_STATUS_MODULE_POS) #define MBED_GET_ERROR_CODE( error_status ) (int)((MBED_GET_ERROR_TYPE( error_status ) == MBED_ERROR_TYPE_POSIX)?(-error_status):((error_status & MBED_ERROR_STATUS_CODE_MASK) >> MBED_ERROR_STATUS_CODE_POS)) /** mbed_error_status_t description @@ -84,7 +84,7 @@ extern "C" { | 31 Always Negative | 30-29(2 bits) | 28-24 | 23-16(8 bits) | 15-0(16 bits) | | -1 | TYPE | (unused/reserved) | MODULE TYPE | ERROR CODE | \endverbatim - * + * * The error status value range for each error type is as follows:\n * Posix Error Status-es - 0xFFFFFFFF to 0xFFFFFF01(-1 -255) - This corresponds to Posix error codes represented as negative.\n * 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 @@ -141,7 +141,7 @@ typedef int mbed_error_status_t; * @param error_value Value associated with the error status. This would depend on error code/error scenario. * * @code - * + * * MBED_WARNING( ERROR_INVALID_SIZE, "MyDriver: Invalid size in read" ) * MBED_WARNING1( ERROR_INVALID_SIZE, "MyDriver: Invalid size in read", size_val ) * @@ -152,15 +152,15 @@ typedef int mbed_error_status_t; */ #ifdef NDEBUG #define MBED_WARNING1( error_status, error_msg, error_value ) mbed_warning( error_status, (const char *)NULL, (uint32_t)error_value, NULL, 0 ) -#define MBED_WARNING( error_status, error_msg ) mbed_warning( error_status, (const char *)NULL, (uint32_t)0, NULL, 0 ) +#define MBED_WARNING( error_status, error_msg ) mbed_warning( error_status, (const char *)NULL, (uint32_t)0, NULL, 0 ) #else //NDEBUG #if MBED_CONF_PLATFORM_ERROR_FILENAME_CAPTURE_ENABLED #define MBED_WARNING1( error_status, error_msg, error_value ) mbed_warning( error_status, (const char *)error_msg, (uint32_t)error_value, (const char *)MBED_FILENAME, __LINE__ ) #define MBED_WARNING( error_status, error_msg ) mbed_warning( error_status, (const char *)error_msg, (uint32_t)0 , (const char *)MBED_FILENAME, __LINE__ ) #else //MBED_CONF_PLATFORM_ERROR_FILENAME_CAPTURE_ENABLED #define MBED_WARNING1( error_status, error_msg, error_value ) mbed_warning( error_status, (const char *)error_msg, (uint32_t)error_value, NULL, 0 ) -#define MBED_WARNING( error_status, error_msg ) mbed_warning( error_status, (const char *)error_msg, (uint32_t)0, NULL, 0 ) -#endif +#define MBED_WARNING( error_status, error_msg ) mbed_warning( error_status, (const char *)error_msg, (uint32_t)0, NULL, 0 ) +#endif #endif /** @@ -173,13 +173,13 @@ typedef int mbed_error_status_t; * MBED_ERROR_INVALID_ARGUMENT if called with invalid error status/codes * * @code - * + * * MBED_ERROR( MBED_ERROR_MUTEX_LOCK_FAILED, "MyDriver: Can't lock driver Mutex" ) * MBED_ERROR1( MBED_ERROR_MUTEX_LOCK_FAILED, "MyDriver: Can't lock driver Mutex", &my_mutex ) * * @endcode * @note The macro calls mbed_error API with filename and line number info without caller explicitly passing them. - * Since this macro is a wrapper for mbed_error API callers should process the return value from this macro which is the return value from calling mbed_error API. + * Since this macro is a wrapper for mbed_error API callers should process the return value from this macro which is the return value from calling mbed_error API. * */ #ifdef NDEBUG @@ -192,7 +192,7 @@ typedef int mbed_error_status_t; #else //MBED_CONF_PLATFORM_ERROR_FILENAME_CAPTURE_ENABLED #define MBED_ERROR1( error_status, error_msg, error_value ) mbed_error( error_status, (const char *)error_msg, (uint32_t)error_value, NULL, 0 ) #define MBED_ERROR( error_status, error_msg ) mbed_error( error_status, (const char *)error_msg, (uint32_t)0 , NULL, 0 ) -#endif +#endif #endif //Error Type definition @@ -201,19 +201,18 @@ typedef int mbed_error_status_t; * This enumeration defines the Error types supported. The value of these enum values will be encoded into mbed_error_status_t TYPE field.\n * See mbed_error_status_t description for more info.\n * MBED_ERROR_TYPE_SYSTEM - Used to indicate that the error status is of System defined Error type.\n - * MBED_ERROR_TYPE_CUSTOM - Used to indicate that the error status is of Custom defined Error type.\n - * MBED_ERROR_TYPE_POSIX - Used to indicate that the error status is of Posix error type.\n + * MBED_ERROR_TYPE_CUSTOM - Used to indicate that the error status is of Custom defined Error type.\n + * MBED_ERROR_TYPE_POSIX - Used to indicate that the error status is of Posix error type.\n * */ -typedef enum _mbed_error_type_t -{ +typedef enum _mbed_error_type_t { MBED_ERROR_TYPE_SYSTEM = 0, MBED_ERROR_TYPE_CUSTOM = 1, //2 is reserved //Use 3 for POSIX because we are mapping -1 to -255 to POSIX error codes //and thus we must use 3 to match the type bits in error status representation which are from 0xFFFFFFFF to 0xFFFFFF00 MBED_ERROR_TYPE_POSIX = 3 -} mbed_error_type_t; +} mbed_error_type_t; //Module type/id definitions /** mbed_module_type_t definition @@ -228,16 +227,16 @@ typedef enum _mbed_error_type_t * @code * Example: mbed_error_status_t i2c_driver_error = MBED_MAKE_ERROR( MBED_MODULE_DRIVER_I2C, MBED_ERROR_CONFIG_UNSUPPORTED ); * @endcode - * + * * @note * \n Below are the module code mappings:\n \verbatim - MBED_MODULE_APPLICATION 0 Application + 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_NETWORK_STACKMODULE_MEMORY_SUBSYSTEM 5 Memory Subsystem MBED_MODULE_FILESYSTEM 6 Filesystem MBED_MODULE_BLOCK_DEVICE 7 Block device MBED_MODULE_DRIVER 8 Driver @@ -254,11 +253,11 @@ typedef enum _mbed_error_type_t MODULE_DRIVER_PWM 19 PWM Driver MODULE_DRIVER_QSPI 20 QSPI Driver MODULE_DRIVER_USB 21 USB Driver - MODULE_TARGET_SDK 22 SDK - + MODULE_TARGET_SDK 22 SDK + MBED_MODULE_UNKNOWN 255 Unknown module \endverbatim - * + * */ typedef enum _mbed_module_type { MBED_MODULE_APPLICATION = 0, @@ -285,7 +284,7 @@ typedef enum _mbed_module_type { MBED_MODULE_DRIVER_USB, MBED_MODULE_TARGET_SDK, /* Add More entities here as required */ - + MBED_MODULE_UNKNOWN = 255, MBED_MODULE_MAX = MBED_MODULE_UNKNOWN } mbed_module_type_t; @@ -315,141 +314,141 @@ typedef enum _mbed_module_type { * ERROR_EPERM = -(MBED_POSIX_ERROR_BASE+EPERM)\n * Its effectively equivalent to:\n * ERROR_CODE_EPERM = 1\n - * ERROR_EPERM = -1\n + * ERROR_EPERM = -1\n * All Posix error codes currently supported by MbedOS(defined in mbed_retarget.h) are defined using the MBED_DEFINE_POSIX_ERROR macro.\n\n * Below are the Posic error codes and the description:\n * \verbatim - EPERM 1 Operation not permitted - ENOENT 2 No such file or directory - ESRCH 3 No such process - EINTR 4 Interrupted system call - EIO 5 I/O error - ENXIO 6 No such device or address - E2BIG 7 Argument list too long - ENOEXEC 8 Exec format error - EBADF 9 Bad file number - ECHILD 10 No child processes - EAGAIN 11 Try again - ENOMEM 12 Out of memory - EACCES 13 Permission denied - EFAULT 14 Bad address - ENOTBLK 15 Block device required - EBUSY 16 Device or resource busy - EEXIST 17 File exists - EXDEV 18 Cross-device link - ENODEV 19 No such device - ENOTDIR 20 Not a directory - EISDIR 21 Is a directory - EINVAL 22 Invalid argument - ENFILE 23 File table overflow - EMFILE 24 Too many open files - ENOTTY 25 Not a typewriter - ETXTBSY 26 Text file busy - EFBIG 27 File too large - ENOSPC 28 No space left on device - ESPIPE 29 Illegal seek - EROFS 30 Read-only file system - EMLINK 31 Too many links - EPIPE 32 Broken pipe - EDOM 33 Math argument out of domain of func - ERANGE 34 Math result not representable - EDEADLK 35 Resource deadlock would occur - ENAMETOOLONG 36 File name too long - ENOLCK 37 No record locks available - ENOSYS 38 Function not implemented - ENOTEMPTY 39 Directory not empty - ELOOP 40 Too many symbolic links encountered - EWOULDBLOCK EAGAIN Operation would block - ENOMSG 42 No message of desired type - EIDRM 43 Identifier removed - ECHRNG 44 Channel number out of range - EL2NSYNC 45 Level 2 not synchronized - EL3HLT 46 Level 3 halted - EL3RST 47 Level 3 reset - ELNRNG 48 Link number out of range - EUNATCH 49 Protocol driver not attached - ENOCSI 50 No CSI structure available - EL2HLT 51 Level 2 halted - EBADE 52 Invalid exchange - EBADR 53 Invalid request descriptor - EXFULL 54 Exchange full - ENOANO 55 No anode - EBADRQC 56 Invalid request code - EBADSLT 57 Invalid slot - EDEADLOCK EDEADLK Resource deadlock would occur - EBFONT 59 Bad font file format - ENOSTR 60 Device not a stream - ENODATA 61 No data available - ETIME 62 Timer expired - ENOSR 63 Out of streams resources - ENONET 64 Machine is not on the network - ENOPKG 65 Package not installed - EREMOTE 66 Object is remote - ENOLINK 67 Link has been severed - EADV 68 Advertise error - ESRMNT 69 Srmount error - ECOMM 70 Communication error on send - EPROTO 71 Protocol error - EMULTIHOP 72 Multihop attempted - EDOTDOT 73 RFS specific error - EBADMSG 74 Not a data message - EOVERFLOW 75 Value too large for defined data type - ENOTUNIQ 76 Name not unique on network - EBADFD 77 File descriptor in bad state - EREMCHG 78 Remote address changed - ELIBACC 79 Can not access a needed shared library - ELIBBAD 80 Accessing a corrupted shared library - ELIBSCN 81 .lib section in a.out corrupted - ELIBMAX 82 Attempting to link in too many shared libraries - ELIBEXEC 83 Cannot exec a shared library directly - EILSEQ 84 Illegal byte sequence - ERESTART 85 Interrupted system call should be restarted - ESTRPIPE 86 Streams pipe error - EUSERS 87 Too many users - ENOTSOCK 88 Socket operation on non-socket - EDESTADDRREQ 89 Destination address required - EMSGSIZE 90 Message too long - EPROTOTYPE 91 Protocol wrong type for socket - ENOPROTOOPT 92 Protocol not available - EPROTONOSUPPORT 93 Protocol not supported - ESOCKTNOSUPPORT 94 Socket type not supported - EOPNOTSUPP 95 Operation not supported on transport endpoint - EPFNOSUPPORT 96 Protocol family not supported - EAFNOSUPPORT 97 Address family not supported by protocol - EADDRINUSE 98 Address already in use - EADDRNOTAVAIL 99 Cannot assign requested address - ENETDOWN 100 Network is down - ENETUNREACH 101 Network is unreachable - ENETRESET 102 Network dropped connection because of reset - ECONNABORTED 103 Software caused connection abort - ECONNRESET 104 Connection reset by peer - ENOBUFS 105 No buffer space available - EISCONN 106 Transport endpoint is already connected - ENOTCONN 107 Transport endpoint is not connected - ESHUTDOWN 108 Cannot send after transport endpoint shutdown - ETOOMANYREFS 109 Too many references: cannot splice - ETIMEDOUT 110 Connection timed out - ECONNREFUSED 111 Connection refused - EHOSTDOWN 112 Host is down - EHOSTUNREACH 113 No route to host - EALREADY 114 Operation already in progress - EINPROGRESS 115 Operation now in progress - ESTALE 116 Stale NFS file handle - EUCLEAN 117 Structure needs cleaning - ENOTNAM 118 Not a XENIX named type file - ENAVAIL 119 No XENIX semaphores available - EISNAM 120 Is a named type file - EREMOTEIO 121 Remote I/O error - EDQUOT 122 Quota exceeded - ENOMEDIUM 123 No medium found - EMEDIUMTYPE 124 Wrong medium type - ECANCELED 125 Operation Canceled - ENOKEY 126 Required key not available - EKEYEXPIRED 127 Key has expired - EKEYREVOKED 128 Key has been revoked - EKEYREJECTED 129 Key was rejected by service - EOWNERDEAD 130 Owner died - ENOTRECOVERABLE 131 State not recoverable + EPERM 1 Operation not permitted + ENOENT 2 No such file or directory + ESRCH 3 No such process + EINTR 4 Interrupted system call + EIO 5 I/O error + ENXIO 6 No such device or address + E2BIG 7 Argument list too long + ENOEXEC 8 Exec format error + EBADF 9 Bad file number + ECHILD 10 No child processes + EAGAIN 11 Try again + ENOMEM 12 Out of memory + EACCES 13 Permission denied + EFAULT 14 Bad address + ENOTBLK 15 Block device required + EBUSY 16 Device or resource busy + EEXIST 17 File exists + EXDEV 18 Cross-device link + ENODEV 19 No such device + ENOTDIR 20 Not a directory + EISDIR 21 Is a directory + EINVAL 22 Invalid argument + ENFILE 23 File table overflow + EMFILE 24 Too many open files + ENOTTY 25 Not a typewriter + ETXTBSY 26 Text file busy + EFBIG 27 File too large + ENOSPC 28 No space left on device + ESPIPE 29 Illegal seek + EROFS 30 Read-only file system + EMLINK 31 Too many links + EPIPE 32 Broken pipe + EDOM 33 Math argument out of domain of func + ERANGE 34 Math result not representable + EDEADLK 35 Resource deadlock would occur + ENAMETOOLONG 36 File name too long + ENOLCK 37 No record locks available + ENOSYS 38 Function not implemented + ENOTEMPTY 39 Directory not empty + ELOOP 40 Too many symbolic links encountered + EWOULDBLOCK EAGAIN Operation would block + ENOMSG 42 No message of desired type + EIDRM 43 Identifier removed + ECHRNG 44 Channel number out of range + EL2NSYNC 45 Level 2 not synchronized + EL3HLT 46 Level 3 halted + EL3RST 47 Level 3 reset + ELNRNG 48 Link number out of range + EUNATCH 49 Protocol driver not attached + ENOCSI 50 No CSI structure available + EL2HLT 51 Level 2 halted + EBADE 52 Invalid exchange + EBADR 53 Invalid request descriptor + EXFULL 54 Exchange full + ENOANO 55 No anode + EBADRQC 56 Invalid request code + EBADSLT 57 Invalid slot + EDEADLOCK EDEADLK Resource deadlock would occur + EBFONT 59 Bad font file format + ENOSTR 60 Device not a stream + ENODATA 61 No data available + ETIME 62 Timer expired + ENOSR 63 Out of streams resources + ENONET 64 Machine is not on the network + ENOPKG 65 Package not installed + EREMOTE 66 Object is remote + ENOLINK 67 Link has been severed + EADV 68 Advertise error + ESRMNT 69 Srmount error + ECOMM 70 Communication error on send + EPROTO 71 Protocol error + EMULTIHOP 72 Multihop attempted + EDOTDOT 73 RFS specific error + EBADMSG 74 Not a data message + EOVERFLOW 75 Value too large for defined data type + ENOTUNIQ 76 Name not unique on network + EBADFD 77 File descriptor in bad state + EREMCHG 78 Remote address changed + ELIBACC 79 Can not access a needed shared library + ELIBBAD 80 Accessing a corrupted shared library + ELIBSCN 81 .lib section in a.out corrupted + ELIBMAX 82 Attempting to link in too many shared libraries + ELIBEXEC 83 Cannot exec a shared library directly + EILSEQ 84 Illegal byte sequence + ERESTART 85 Interrupted system call should be restarted + ESTRPIPE 86 Streams pipe error + EUSERS 87 Too many users + ENOTSOCK 88 Socket operation on non-socket + EDESTADDRREQ 89 Destination address required + EMSGSIZE 90 Message too long + EPROTOTYPE 91 Protocol wrong type for socket + ENOPROTOOPT 92 Protocol not available + EPROTONOSUPPORT 93 Protocol not supported + ESOCKTNOSUPPORT 94 Socket type not supported + EOPNOTSUPP 95 Operation not supported on transport endpoint + EPFNOSUPPORT 96 Protocol family not supported + EAFNOSUPPORT 97 Address family not supported by protocol + EADDRINUSE 98 Address already in use + EADDRNOTAVAIL 99 Cannot assign requested address + ENETDOWN 100 Network is down + ENETUNREACH 101 Network is unreachable + ENETRESET 102 Network dropped connection because of reset + ECONNABORTED 103 Software caused connection abort + ECONNRESET 104 Connection reset by peer + ENOBUFS 105 No buffer space available + EISCONN 106 Transport endpoint is already connected + ENOTCONN 107 Transport endpoint is not connected + ESHUTDOWN 108 Cannot send after transport endpoint shutdown + ETOOMANYREFS 109 Too many references: cannot splice + ETIMEDOUT 110 Connection timed out + ECONNREFUSED 111 Connection refused + EHOSTDOWN 112 Host is down + EHOSTUNREACH 113 No route to host + EALREADY 114 Operation already in progress + EINPROGRESS 115 Operation now in progress + ESTALE 116 Stale NFS file handle + EUCLEAN 117 Structure needs cleaning + ENOTNAM 118 Not a XENIX named type file + ENAVAIL 119 No XENIX semaphores available + EISNAM 120 Is a named type file + EREMOTEIO 121 Remote I/O error + EDQUOT 122 Quota exceeded + ENOMEDIUM 123 No medium found + EMEDIUMTYPE 124 Wrong medium type + ECANCELED 125 Operation Canceled + ENOKEY 126 Required key not available + EKEYEXPIRED 127 Key has expired + EKEYREVOKED 128 Key has been revoked + EKEYREJECTED 129 Key was rejected by service + EOWNERDEAD 130 Owner died + ENOTRECOVERABLE 131 State not recoverable \endverbatim * * @note @@ -459,75 +458,75 @@ typedef enum _mbed_module_type { * ERROR_INVALID_ARGUMENT = MAKE_MBED_ERROR(ERROR_TYPE_SYSTEM, MBED_MODULE_UNKNOWN, ERROR_CODE_INVALID_ARGUMENT)\n * Its effectively equivalent to:\n * ERROR_CODE_INVALID_ARGUMENT = 1\n - * ERROR_INVALID_ARGUMENT = 0x80FF0001\n (Note that MODULE field is set to MBED_MODULE_UNKNOWN) + * ERROR_INVALID_ARGUMENT = 0x80FF0001\n (Note that MODULE field is set to MBED_MODULE_UNKNOWN) * New System Error codes should be defined using MBED_DEFINE_SYSTEM_ERROR macro and must have an unique error code value\n * passed as the second argument in the MBED_DEFINE_SYSTEM_ERROR macro.\n\n * Below are the Mbed System error codes and the description: - * \verbatim - UNKNOWN 256 Unknown error - INVALID_ARGUMENT 257 Invalid Argument - INVALID_DATA 258 Invalid data - INVALID_FORMAT 259 Invalid format - INVALID_INDEX 260 Invalid Index - INVALID_SIZE 261 Inavlid Size - INVALID_OPERATION 262 Invalid Operation - NOT_FOUND 263 Not Found - ACCESS_DENIED 264 Access Denied - NOT_SUPPORTED 265 Not supported - BUFFER_FULL 266 Buffer Full - MEDIA_FULL 267 Media/Disk Full - ALREADY_IN_USE 268 Already in use - TIMEOUT 269 Timeout error - NOT_READY 270 Not Ready - FAILED_OPERATION 271 Requested Operation failed - OPERATION_PROHIBITED 272 Operation prohibited - 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 - MUTEX_LOCK_FAILED 277 Mutex lock failed - SEMAPHORE_UNLOCK_FAILED 278 Sempahore unlock failed - MUTEX_UNLOCK_FAILED 279 Mutex unlock failed - CRC_ERROR 280 CRC error or mismatch - OPEN_FAILED 281 Open failed - CLOSE_FAILED 282 Close failed - READ_FAILED 283 Read failed - WRITE_FAILED 284 Write failed - INITIALIZATION_FAILED 285 Initialization failed - BOOT_FAILURE 286 Boot failure - OUT_OF_MEMORY 287 Out of memory - OUT_OF_RESOURCES 288 Out of resources - ALLOC_FAILED 289 Alloc failed - FREE_FAILED 290 Free failed - OVERFLOW 291 Overflow error - UNDERFLOW 292 Underflow error - STACK_OVERFLOW 293 Stack overflow error - ISR_QUEUE_OVERFLOW 294 ISR queue overflow - TIMER_QUEUE_OVERFLOW 295 Timer Queue overflow - CLIB_SPACE_UNAVAILABLE 296 Standard library error - Space unavailable - CLIB_EXCEPTION 297 Standard library error - Exception - CLIB_MUTEX_INIT_FAILURE 298 Standard library error - Mutex Init failure - CREATE_FAILED 299 Create failed - DELETE_FAILED 300 Delete failed - THREAD_CREATE_FAILED 301 Thread Create failed - THREAD_DELETE_FAILED 302 Thread Delete failed - PROHIBITED_IN_ISR_CONTEXT 303 Operation Prohibited in ISR context - PINMAP_INVALID 304 Pinmap Invalid - RTOS_EVENT 305 Unknown Rtos Error - RTOS_THREAD_EVENT 306 Rtos Thread Error - RTOS_MUTEX_EVENT 307 Rtos Mutex Error - RTOS_SEMAPHORE_EVENT 308 Rtos Semaphore Error - RTOS_MEMORY_POOL_EVENT 309 Rtos Memory Pool Error - RTOS_TIMER_EVENT 310 Rtos Timer Error - RTOS_EVENT_FLAGS_EVENT 311 Rtos Event flags Error - RTOS_MESSAGE_QUEUE_EVENT 312 Rtos Message queue Error - DEVICE_BUSY 313 Device Busy - CONFIG_UNSUPPORTED 314 Configuration not supported - CONFIG_MISMATCH 315 Configuration mismatch - ALREADY_INITIALIZED 316 Already initialzied - HARDFAULT_EXCEPTION 317 HardFault exception - MEMMANAGE_EXCEPTION 318 MemManage exception - BUSFAULT_EXCEPTION 319 BusFault exception + * \verbatim + UNKNOWN 256 Unknown error + INVALID_ARGUMENT 257 Invalid Argument + INVALID_DATA 258 Invalid data + INVALID_FORMAT 259 Invalid format + INVALID_INDEX 260 Invalid Index + INVALID_SIZE 261 Inavlid Size + INVALID_OPERATION 262 Invalid Operation + NOT_FOUND 263 Not Found + ACCESS_DENIED 264 Access Denied + NOT_SUPPORTED 265 Not supported + BUFFER_FULL 266 Buffer Full + MEDIA_FULL 267 Media/Disk Full + ALREADY_IN_USE 268 Already in use + TIMEOUT 269 Timeout error + NOT_READY 270 Not Ready + FAILED_OPERATION 271 Requested Operation failed + OPERATION_PROHIBITED 272 Operation prohibited + 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 + MUTEX_LOCK_FAILED 277 Mutex lock failed + SEMAPHORE_UNLOCK_FAILED 278 Sempahore unlock failed + MUTEX_UNLOCK_FAILED 279 Mutex unlock failed + CRC_ERROR 280 CRC error or mismatch + OPEN_FAILED 281 Open failed + CLOSE_FAILED 282 Close failed + READ_FAILED 283 Read failed + WRITE_FAILED 284 Write failed + INITIALIZATION_FAILED 285 Initialization failed + BOOT_FAILURE 286 Boot failure + OUT_OF_MEMORY 287 Out of memory + OUT_OF_RESOURCES 288 Out of resources + ALLOC_FAILED 289 Alloc failed + FREE_FAILED 290 Free failed + OVERFLOW 291 Overflow error + UNDERFLOW 292 Underflow error + STACK_OVERFLOW 293 Stack overflow error + ISR_QUEUE_OVERFLOW 294 ISR queue overflow + TIMER_QUEUE_OVERFLOW 295 Timer Queue overflow + CLIB_SPACE_UNAVAILABLE 296 Standard library error - Space unavailable + CLIB_EXCEPTION 297 Standard library error - Exception + CLIB_MUTEX_INIT_FAILURE 298 Standard library error - Mutex Init failure + CREATE_FAILED 299 Create failed + DELETE_FAILED 300 Delete failed + THREAD_CREATE_FAILED 301 Thread Create failed + THREAD_DELETE_FAILED 302 Thread Delete failed + PROHIBITED_IN_ISR_CONTEXT 303 Operation Prohibited in ISR context + PINMAP_INVALID 304 Pinmap Invalid + RTOS_EVENT 305 Unknown Rtos Error + RTOS_THREAD_EVENT 306 Rtos Thread Error + RTOS_MUTEX_EVENT 307 Rtos Mutex Error + RTOS_SEMAPHORE_EVENT 308 Rtos Semaphore Error + RTOS_MEMORY_POOL_EVENT 309 Rtos Memory Pool Error + RTOS_TIMER_EVENT 310 Rtos Timer Error + RTOS_EVENT_FLAGS_EVENT 311 Rtos Event flags Error + RTOS_MESSAGE_QUEUE_EVENT 312 Rtos Message queue Error + DEVICE_BUSY 313 Device Busy + CONFIG_UNSUPPORTED 314 Configuration not supported + CONFIG_MISMATCH 315 Configuration mismatch + ALREADY_INITIALIZED 316 Already initialzied + HARDFAULT_EXCEPTION 317 HardFault exception + MEMMANAGE_EXCEPTION 318 MemManage exception + BUSFAULT_EXCEPTION 319 BusFault exception USAGEFAULT_EXCEPTION 320 UsageFault exception \endverbatim * @@ -542,23 +541,23 @@ typedef enum _mbed_module_type { * ERROR_MY_CUSTOM_ERROR = 0xA0FF1001\n (Note that MODULE field is set to MBED_MODULE_UNKNOWN) \n\n * * @note - * **Using error codes:** \n + * **Using error codes:** \n * Posix error codes may be used in modules/functions currently using Posix error codes and switching them to Mbed-OS error codes - * may cause interoperability issues. For example, some of the filesystem, network stack implementations may need to use - * Posix error codes in order to keep them compatible with other modules interfacing with them, and may continue to use Posix error codes. - * + * may cause interoperability issues. For example, some of the filesystem, network stack implementations may need to use + * Posix error codes in order to keep them compatible with other modules interfacing with them, and may continue to use Posix error codes. + * * In all other cases, like for any native development of Mbed-OS modules Mbed-OS error codes should be used. * This makes it easy to use Mbed-OS error reporting/logging infrastructure and makes debugging error scenarios * much more efficient. - * + * * @note * **Searching for error codes in mbed-os source tree:** \n * If you get an error report as below which you want to search for in mbed-os source tree, first take note of "Error Code" number. \n * For example, the below error report has an error code of \b 259. Find the error name associated with the error code and in this case its \b INVALID_FORMAT. \n - * Use that error name(\b INVALID_FORMAT) to search the source tree for code locations setting that specific error code. \n + * Use that error name(\b INVALID_FORMAT) to search the source tree for code locations setting that specific error code. \n * If the Error module reported is not 255(which indicates unknown module), you can also use that to narrow down to the specific component reporting the error. * See mbed_module_type_t enum above for module mapping. \n - * + * * \verbatim ++ MbedOS Error Info ++ Error Status: 0x80040103 @@ -571,221 +570,221 @@ typedef enum _mbed_module_type { -- MbedOS Error Info -- \endverbatim */ - + typedef enum _mbed_error_code { //Below are POSIX ERROR CODE definitions, which starts at MBED_POSIX_ERROR_BASE(=0) //POSIX ERROR CODE definitions starts at offset 0(MBED_POSIX_ERROR_BASE) to align them with actual Posix Error Code //defintions in mbed_retarget.h // Error Name Error Code - MBED_DEFINE_POSIX_ERROR( EPERM ,EPERM ), /* 1 Operation not permitted */ - MBED_DEFINE_POSIX_ERROR( ENOENT ,ENOENT ), /* 2 No such file or directory */ - MBED_DEFINE_POSIX_ERROR( ESRCH ,ESRCH ), /* 3 No such process */ - MBED_DEFINE_POSIX_ERROR( EINTR ,EINTR ), /* 4 Interrupted system call */ - MBED_DEFINE_POSIX_ERROR( EIO ,EIO ), /* 5 I/O error */ - MBED_DEFINE_POSIX_ERROR( ENXIO ,ENXIO ), /* 6 No such device or address */ - MBED_DEFINE_POSIX_ERROR( E2BIG ,E2BIG ), /* 7 Argument list too long */ - MBED_DEFINE_POSIX_ERROR( ENOEXEC ,ENOEXEC ), /* 8 Exec format error */ - MBED_DEFINE_POSIX_ERROR( EBADF ,EBADF ), /* 9 Bad file number */ - MBED_DEFINE_POSIX_ERROR( ECHILD ,ECHILD ), /* 10 No child processes */ - MBED_DEFINE_POSIX_ERROR( EAGAIN ,EAGAIN ), /* 11 Try again */ - MBED_DEFINE_POSIX_ERROR( ENOMEM ,ENOMEM ), /* 12 Out of memory */ - MBED_DEFINE_POSIX_ERROR( EACCES ,EACCES ), /* 13 Permission denied */ - MBED_DEFINE_POSIX_ERROR( EFAULT ,EFAULT ), /* 14 Bad address */ - MBED_DEFINE_POSIX_ERROR( ENOTBLK ,ENOTBLK ), /* 15 Block device required */ - MBED_DEFINE_POSIX_ERROR( EBUSY ,EBUSY ), /* 16 Device or resource busy */ - MBED_DEFINE_POSIX_ERROR( EEXIST ,EEXIST ), /* 17 File exists */ - MBED_DEFINE_POSIX_ERROR( EXDEV ,EXDEV ), /* 18 Cross-device link */ - MBED_DEFINE_POSIX_ERROR( ENODEV ,ENODEV ), /* 19 No such device */ - MBED_DEFINE_POSIX_ERROR( ENOTDIR ,ENOTDIR ), /* 20 Not a directory */ - MBED_DEFINE_POSIX_ERROR( EISDIR ,EISDIR ), /* 21 Is a directory */ - MBED_DEFINE_POSIX_ERROR( EINVAL ,EINVAL ), /* 22 Invalid argument */ - MBED_DEFINE_POSIX_ERROR( ENFILE ,ENFILE ), /* 23 File table overflow */ - MBED_DEFINE_POSIX_ERROR( EMFILE ,EMFILE ), /* 24 Too many open files */ - MBED_DEFINE_POSIX_ERROR( ENOTTY ,ENOTTY ), /* 25 Not a typewriter */ - MBED_DEFINE_POSIX_ERROR( ETXTBSY ,ETXTBSY ), /* 26 Text file busy */ - MBED_DEFINE_POSIX_ERROR( EFBIG ,EFBIG ), /* 27 File too large */ - MBED_DEFINE_POSIX_ERROR( ENOSPC ,ENOSPC ), /* 28 No space left on device */ - MBED_DEFINE_POSIX_ERROR( ESPIPE ,ESPIPE ), /* 29 Illegal seek */ - MBED_DEFINE_POSIX_ERROR( EROFS ,EROFS ), /* 30 Read-only file system */ - MBED_DEFINE_POSIX_ERROR( EMLINK ,EMLINK ), /* 31 Too many links */ - MBED_DEFINE_POSIX_ERROR( EPIPE ,EPIPE ), /* 32 Broken pipe */ - MBED_DEFINE_POSIX_ERROR( EDOM ,EDOM ), /* 33 Math argument out of domain of func */ - MBED_DEFINE_POSIX_ERROR( ERANGE ,ERANGE ), /* 34 Math result not representable */ - MBED_DEFINE_POSIX_ERROR( EDEADLK ,EDEADLK ), /* 35 Resource deadlock would occur */ - MBED_DEFINE_POSIX_ERROR( ENAMETOOLONG ,ENAMETOOLONG ), /* 36 File name too long */ - MBED_DEFINE_POSIX_ERROR( ENOLCK ,ENOLCK ), /* 37 No record locks available */ - MBED_DEFINE_POSIX_ERROR( ENOSYS ,ENOSYS ), /* 38 Function not implemented */ - MBED_DEFINE_POSIX_ERROR( ENOTEMPTY ,ENOTEMPTY ), /* 39 Directory not empty */ - MBED_DEFINE_POSIX_ERROR( ELOOP ,ELOOP ), /* 40 Too many symbolic links encountered */ - MBED_DEFINE_POSIX_ERROR( EWOULDBLOCK ,EAGAIN ), /* EAGAIN Operation would block */ - MBED_DEFINE_POSIX_ERROR( ENOMSG ,ENOMSG ), /* 42 No message of desired type */ - MBED_DEFINE_POSIX_ERROR( EIDRM ,EIDRM ), /* 43 Identifier removed */ - MBED_DEFINE_POSIX_ERROR( ECHRNG ,ECHRNG ), /* 44 Channel number out of range */ - MBED_DEFINE_POSIX_ERROR( EL2NSYNC ,EL2NSYNC ), /* 45 Level 2 not synchronized */ - MBED_DEFINE_POSIX_ERROR( EL3HLT ,EL3HLT ), /* 46 Level 3 halted */ - MBED_DEFINE_POSIX_ERROR( EL3RST ,EL3RST ), /* 47 Level 3 reset */ - MBED_DEFINE_POSIX_ERROR( ELNRNG ,ELNRNG ), /* 48 Link number out of range */ - MBED_DEFINE_POSIX_ERROR( EUNATCH ,EUNATCH ), /* 49 Protocol driver not attached */ - MBED_DEFINE_POSIX_ERROR( ENOCSI ,ENOCSI ), /* 50 No CSI structure available */ - MBED_DEFINE_POSIX_ERROR( EL2HLT ,EL2HLT ), /* 51 Level 2 halted */ - MBED_DEFINE_POSIX_ERROR( EBADE ,EBADE ), /* 52 Invalid exchange */ - MBED_DEFINE_POSIX_ERROR( EBADR ,EBADR ), /* 53 Invalid request descriptor */ - MBED_DEFINE_POSIX_ERROR( EXFULL ,EXFULL ), /* 54 Exchange full */ - MBED_DEFINE_POSIX_ERROR( ENOANO ,ENOANO ), /* 55 No anode */ - MBED_DEFINE_POSIX_ERROR( EBADRQC ,EBADRQC ), /* 56 Invalid request code */ - MBED_DEFINE_POSIX_ERROR( EBADSLT ,EBADSLT ), /* 57 Invalid slot */ - MBED_DEFINE_POSIX_ERROR( EDEADLOCK ,EDEADLK ), /* EDEADLK Resource deadlock would occur */ - MBED_DEFINE_POSIX_ERROR( EBFONT ,EBFONT ), /* 59 Bad font file format */ - MBED_DEFINE_POSIX_ERROR( ENOSTR ,ENOSTR ), /* 60 Device not a stream */ - MBED_DEFINE_POSIX_ERROR( ENODATA ,ENODATA ), /* 61 No data available */ - MBED_DEFINE_POSIX_ERROR( ETIME ,ETIME ), /* 62 Timer expired */ - MBED_DEFINE_POSIX_ERROR( ENOSR ,ENOSR ), /* 63 Out of streams resources */ - MBED_DEFINE_POSIX_ERROR( ENONET ,ENONET ), /* 64 Machine is not on the network */ - MBED_DEFINE_POSIX_ERROR( ENOPKG ,ENOPKG ), /* 65 Package not installed */ - MBED_DEFINE_POSIX_ERROR( EREMOTE ,EREMOTE ), /* 66 Object is remote */ - MBED_DEFINE_POSIX_ERROR( ENOLINK ,ENOLINK ), /* 67 Link has been severed */ - MBED_DEFINE_POSIX_ERROR( EADV ,EADV ), /* 68 Advertise error */ - MBED_DEFINE_POSIX_ERROR( ESRMNT ,ESRMNT ), /* 69 Srmount error */ - MBED_DEFINE_POSIX_ERROR( ECOMM ,ECOMM ), /* 70 Communication error on send */ - MBED_DEFINE_POSIX_ERROR( EPROTO ,EPROTO ), /* 71 Protocol error */ - MBED_DEFINE_POSIX_ERROR( EMULTIHOP ,EMULTIHOP ), /* 72 Multihop attempted */ - MBED_DEFINE_POSIX_ERROR( EDOTDOT ,EDOTDOT ), /* 73 RFS specific error */ - MBED_DEFINE_POSIX_ERROR( EBADMSG ,EBADMSG ), /* 74 Not a data message */ - MBED_DEFINE_POSIX_ERROR( EOVERFLOW ,EOVERFLOW ), /* 75 Value too large for defined data type */ - MBED_DEFINE_POSIX_ERROR( ENOTUNIQ ,ENOTUNIQ ), /* 76 Name not unique on network */ - MBED_DEFINE_POSIX_ERROR( EBADFD ,EBADFD ), /* 77 File descriptor in bad state */ - MBED_DEFINE_POSIX_ERROR( EREMCHG ,EREMCHG ), /* 78 Remote address changed */ - MBED_DEFINE_POSIX_ERROR( ELIBACC ,ELIBACC ), /* 79 Can not access a needed shared library */ - MBED_DEFINE_POSIX_ERROR( ELIBBAD ,ELIBBAD ), /* 80 Accessing a corrupted shared library */ - MBED_DEFINE_POSIX_ERROR( ELIBSCN ,ELIBSCN ), /* 81 .lib section in a.out corrupted */ - MBED_DEFINE_POSIX_ERROR( ELIBMAX ,ELIBMAX ), /* 82 Attempting to link in too many shared libraries */ - MBED_DEFINE_POSIX_ERROR( ELIBEXEC ,ELIBEXEC ), /* 83 Cannot exec a shared library directly */ - MBED_DEFINE_POSIX_ERROR( EILSEQ ,EILSEQ ), /* 84 Illegal byte sequence */ - MBED_DEFINE_POSIX_ERROR( ERESTART ,ERESTART ), /* 85 Interrupted system call should be restarted */ - MBED_DEFINE_POSIX_ERROR( ESTRPIPE ,ESTRPIPE ), /* 86 Streams pipe error */ - MBED_DEFINE_POSIX_ERROR( EUSERS ,EUSERS ), /* 87 Too many users */ - MBED_DEFINE_POSIX_ERROR( ENOTSOCK ,ENOTSOCK ), /* 88 Socket operation on non-socket */ - MBED_DEFINE_POSIX_ERROR( EDESTADDRREQ ,EDESTADDRREQ ), /* 89 Destination address required */ - MBED_DEFINE_POSIX_ERROR( EMSGSIZE ,EMSGSIZE ), /* 90 Message too long */ - MBED_DEFINE_POSIX_ERROR( EPROTOTYPE ,EPROTOTYPE ), /* 91 Protocol wrong type for socket */ - MBED_DEFINE_POSIX_ERROR( ENOPROTOOPT ,ENOPROTOOPT ), /* 92 Protocol not available */ - MBED_DEFINE_POSIX_ERROR( EPROTONOSUPPORT ,EPROTONOSUPPORT ), /* 93 Protocol not supported */ - MBED_DEFINE_POSIX_ERROR( ESOCKTNOSUPPORT ,ESOCKTNOSUPPORT ), /* 94 Socket type not supported */ - MBED_DEFINE_POSIX_ERROR( EOPNOTSUPP ,EOPNOTSUPP ), /* 95 Operation not supported on transport endpoint */ - MBED_DEFINE_POSIX_ERROR( EPFNOSUPPORT ,EPFNOSUPPORT ), /* 96 Protocol family not supported */ - MBED_DEFINE_POSIX_ERROR( EAFNOSUPPORT ,EAFNOSUPPORT ), /* 97 Address family not supported by protocol */ - MBED_DEFINE_POSIX_ERROR( EADDRINUSE ,EADDRINUSE ), /* 98 Address already in use */ - MBED_DEFINE_POSIX_ERROR( EADDRNOTAVAIL ,EADDRNOTAVAIL ), /* 99 Cannot assign requested address */ - MBED_DEFINE_POSIX_ERROR( ENETDOWN ,ENETDOWN ), /* 100 Network is down */ - MBED_DEFINE_POSIX_ERROR( ENETUNREACH ,ENETUNREACH ), /* 101 Network is unreachable */ - MBED_DEFINE_POSIX_ERROR( ENETRESET ,ENETRESET ), /* 102 Network dropped connection because of reset */ - MBED_DEFINE_POSIX_ERROR( ECONNABORTED ,ECONNABORTED ), /* 103 Software caused connection abort */ - MBED_DEFINE_POSIX_ERROR( ECONNRESET ,ECONNRESET ), /* 104 Connection reset by peer */ - MBED_DEFINE_POSIX_ERROR( ENOBUFS ,ENOBUFS ), /* 105 No buffer space available */ - MBED_DEFINE_POSIX_ERROR( EISCONN ,EISCONN ), /* 106 Transport endpoint is already connected */ - MBED_DEFINE_POSIX_ERROR( ENOTCONN ,ENOTCONN ), /* 107 Transport endpoint is not connected */ - MBED_DEFINE_POSIX_ERROR( ESHUTDOWN ,ESHUTDOWN ), /* 108 Cannot send after transport endpoint shutdown */ - MBED_DEFINE_POSIX_ERROR( ETOOMANYREFS ,ETOOMANYREFS ), /* 109 Too many references: cannot splice */ - MBED_DEFINE_POSIX_ERROR( ETIMEDOUT ,ETIMEDOUT ), /* 110 Connection timed out */ - MBED_DEFINE_POSIX_ERROR( ECONNREFUSED ,ECONNREFUSED ), /* 111 Connection refused */ - MBED_DEFINE_POSIX_ERROR( EHOSTDOWN ,EHOSTDOWN ), /* 112 Host is down */ - MBED_DEFINE_POSIX_ERROR( EHOSTUNREACH ,EHOSTUNREACH ), /* 113 No route to host */ - MBED_DEFINE_POSIX_ERROR( EALREADY ,EALREADY ), /* 114 Operation already in progress */ - MBED_DEFINE_POSIX_ERROR( EINPROGRESS ,EINPROGRESS ), /* 115 Operation now in progress */ - MBED_DEFINE_POSIX_ERROR( ESTALE ,ESTALE ), /* 116 Stale NFS file handle */ - MBED_DEFINE_POSIX_ERROR( EUCLEAN ,EUCLEAN ), /* 117 Structure needs cleaning */ - MBED_DEFINE_POSIX_ERROR( ENOTNAM ,ENOTNAM ), /* 118 Not a XENIX named type file */ - MBED_DEFINE_POSIX_ERROR( ENAVAIL ,ENAVAIL ), /* 119 No XENIX semaphores available */ - MBED_DEFINE_POSIX_ERROR( EISNAM ,EISNAM ), /* 120 Is a named type file */ - MBED_DEFINE_POSIX_ERROR( EREMOTEIO ,EREMOTEIO ), /* 121 Remote I/O error */ - MBED_DEFINE_POSIX_ERROR( EDQUOT ,EDQUOT ), /* 122 Quota exceeded */ - MBED_DEFINE_POSIX_ERROR( ENOMEDIUM ,ENOMEDIUM ), /* 123 No medium found */ - MBED_DEFINE_POSIX_ERROR( EMEDIUMTYPE ,EMEDIUMTYPE ), /* 124 Wrong medium type */ - MBED_DEFINE_POSIX_ERROR( ECANCELED ,ECANCELED ), /* 125 Operation Canceled */ - MBED_DEFINE_POSIX_ERROR( ENOKEY ,ENOKEY ), /* 126 Required key not available */ - MBED_DEFINE_POSIX_ERROR( EKEYEXPIRED ,EKEYEXPIRED ), /* 127 Key has expired */ - MBED_DEFINE_POSIX_ERROR( EKEYREVOKED ,EKEYREVOKED ), /* 128 Key has been revoked */ - MBED_DEFINE_POSIX_ERROR( EKEYREJECTED ,EKEYREJECTED ), /* 129 Key was rejected by service */ - MBED_DEFINE_POSIX_ERROR( EOWNERDEAD ,EOWNERDEAD ), /* 130 Owner died */ - MBED_DEFINE_POSIX_ERROR( ENOTRECOVERABLE ,ENOTRECOVERABLE ), /* 131 State not recoverable */ - + MBED_DEFINE_POSIX_ERROR(EPERM, EPERM), /* 1 Operation not permitted */ + MBED_DEFINE_POSIX_ERROR(ENOENT, ENOENT), /* 2 No such file or directory */ + MBED_DEFINE_POSIX_ERROR(ESRCH, ESRCH), /* 3 No such process */ + MBED_DEFINE_POSIX_ERROR(EINTR, EINTR), /* 4 Interrupted system call */ + MBED_DEFINE_POSIX_ERROR(EIO, EIO), /* 5 I/O error */ + MBED_DEFINE_POSIX_ERROR(ENXIO, ENXIO), /* 6 No such device or address */ + MBED_DEFINE_POSIX_ERROR(E2BIG, E2BIG), /* 7 Argument list too long */ + MBED_DEFINE_POSIX_ERROR(ENOEXEC, ENOEXEC), /* 8 Exec format error */ + MBED_DEFINE_POSIX_ERROR(EBADF, EBADF), /* 9 Bad file number */ + MBED_DEFINE_POSIX_ERROR(ECHILD, ECHILD), /* 10 No child processes */ + MBED_DEFINE_POSIX_ERROR(EAGAIN, EAGAIN), /* 11 Try again */ + MBED_DEFINE_POSIX_ERROR(ENOMEM, ENOMEM), /* 12 Out of memory */ + MBED_DEFINE_POSIX_ERROR(EACCES, EACCES), /* 13 Permission denied */ + MBED_DEFINE_POSIX_ERROR(EFAULT, EFAULT), /* 14 Bad address */ + MBED_DEFINE_POSIX_ERROR(ENOTBLK, ENOTBLK), /* 15 Block device required */ + MBED_DEFINE_POSIX_ERROR(EBUSY, EBUSY), /* 16 Device or resource busy */ + MBED_DEFINE_POSIX_ERROR(EEXIST, EEXIST), /* 17 File exists */ + MBED_DEFINE_POSIX_ERROR(EXDEV, EXDEV), /* 18 Cross-device link */ + MBED_DEFINE_POSIX_ERROR(ENODEV, ENODEV), /* 19 No such device */ + MBED_DEFINE_POSIX_ERROR(ENOTDIR, ENOTDIR), /* 20 Not a directory */ + MBED_DEFINE_POSIX_ERROR(EISDIR, EISDIR), /* 21 Is a directory */ + MBED_DEFINE_POSIX_ERROR(EINVAL, EINVAL), /* 22 Invalid argument */ + MBED_DEFINE_POSIX_ERROR(ENFILE, ENFILE), /* 23 File table overflow */ + MBED_DEFINE_POSIX_ERROR(EMFILE, EMFILE), /* 24 Too many open files */ + MBED_DEFINE_POSIX_ERROR(ENOTTY, ENOTTY), /* 25 Not a typewriter */ + MBED_DEFINE_POSIX_ERROR(ETXTBSY, ETXTBSY), /* 26 Text file busy */ + MBED_DEFINE_POSIX_ERROR(EFBIG, EFBIG), /* 27 File too large */ + MBED_DEFINE_POSIX_ERROR(ENOSPC, ENOSPC), /* 28 No space left on device */ + MBED_DEFINE_POSIX_ERROR(ESPIPE, ESPIPE), /* 29 Illegal seek */ + MBED_DEFINE_POSIX_ERROR(EROFS, EROFS), /* 30 Read-only file system */ + MBED_DEFINE_POSIX_ERROR(EMLINK, EMLINK), /* 31 Too many links */ + MBED_DEFINE_POSIX_ERROR(EPIPE, EPIPE), /* 32 Broken pipe */ + MBED_DEFINE_POSIX_ERROR(EDOM, EDOM), /* 33 Math argument out of domain of func */ + MBED_DEFINE_POSIX_ERROR(ERANGE, ERANGE), /* 34 Math result not representable */ + MBED_DEFINE_POSIX_ERROR(EDEADLK, EDEADLK), /* 35 Resource deadlock would occur */ + MBED_DEFINE_POSIX_ERROR(ENAMETOOLONG, ENAMETOOLONG), /* 36 File name too long */ + MBED_DEFINE_POSIX_ERROR(ENOLCK, ENOLCK), /* 37 No record locks available */ + MBED_DEFINE_POSIX_ERROR(ENOSYS, ENOSYS), /* 38 Function not implemented */ + MBED_DEFINE_POSIX_ERROR(ENOTEMPTY, ENOTEMPTY), /* 39 Directory not empty */ + MBED_DEFINE_POSIX_ERROR(ELOOP, ELOOP), /* 40 Too many symbolic links encountered */ + MBED_DEFINE_POSIX_ERROR(EWOULDBLOCK, EAGAIN), /* EAGAIN Operation would block */ + MBED_DEFINE_POSIX_ERROR(ENOMSG, ENOMSG), /* 42 No message of desired type */ + MBED_DEFINE_POSIX_ERROR(EIDRM, EIDRM), /* 43 Identifier removed */ + MBED_DEFINE_POSIX_ERROR(ECHRNG, ECHRNG), /* 44 Channel number out of range */ + MBED_DEFINE_POSIX_ERROR(EL2NSYNC, EL2NSYNC), /* 45 Level 2 not synchronized */ + MBED_DEFINE_POSIX_ERROR(EL3HLT, EL3HLT), /* 46 Level 3 halted */ + MBED_DEFINE_POSIX_ERROR(EL3RST, EL3RST), /* 47 Level 3 reset */ + MBED_DEFINE_POSIX_ERROR(ELNRNG, ELNRNG), /* 48 Link number out of range */ + MBED_DEFINE_POSIX_ERROR(EUNATCH, EUNATCH), /* 49 Protocol driver not attached */ + MBED_DEFINE_POSIX_ERROR(ENOCSI, ENOCSI), /* 50 No CSI structure available */ + MBED_DEFINE_POSIX_ERROR(EL2HLT, EL2HLT), /* 51 Level 2 halted */ + MBED_DEFINE_POSIX_ERROR(EBADE, EBADE), /* 52 Invalid exchange */ + MBED_DEFINE_POSIX_ERROR(EBADR, EBADR), /* 53 Invalid request descriptor */ + MBED_DEFINE_POSIX_ERROR(EXFULL, EXFULL), /* 54 Exchange full */ + MBED_DEFINE_POSIX_ERROR(ENOANO, ENOANO), /* 55 No anode */ + MBED_DEFINE_POSIX_ERROR(EBADRQC, EBADRQC), /* 56 Invalid request code */ + MBED_DEFINE_POSIX_ERROR(EBADSLT, EBADSLT), /* 57 Invalid slot */ + MBED_DEFINE_POSIX_ERROR(EDEADLOCK, EDEADLK), /* EDEADLK Resource deadlock would occur */ + MBED_DEFINE_POSIX_ERROR(EBFONT, EBFONT), /* 59 Bad font file format */ + MBED_DEFINE_POSIX_ERROR(ENOSTR, ENOSTR), /* 60 Device not a stream */ + MBED_DEFINE_POSIX_ERROR(ENODATA, ENODATA), /* 61 No data available */ + MBED_DEFINE_POSIX_ERROR(ETIME, ETIME), /* 62 Timer expired */ + MBED_DEFINE_POSIX_ERROR(ENOSR, ENOSR), /* 63 Out of streams resources */ + MBED_DEFINE_POSIX_ERROR(ENONET, ENONET), /* 64 Machine is not on the network */ + MBED_DEFINE_POSIX_ERROR(ENOPKG, ENOPKG), /* 65 Package not installed */ + MBED_DEFINE_POSIX_ERROR(EREMOTE, EREMOTE), /* 66 Object is remote */ + MBED_DEFINE_POSIX_ERROR(ENOLINK, ENOLINK), /* 67 Link has been severed */ + MBED_DEFINE_POSIX_ERROR(EADV, EADV), /* 68 Advertise error */ + MBED_DEFINE_POSIX_ERROR(ESRMNT, ESRMNT), /* 69 Srmount error */ + MBED_DEFINE_POSIX_ERROR(ECOMM, ECOMM), /* 70 Communication error on send */ + MBED_DEFINE_POSIX_ERROR(EPROTO, EPROTO), /* 71 Protocol error */ + MBED_DEFINE_POSIX_ERROR(EMULTIHOP, EMULTIHOP), /* 72 Multihop attempted */ + MBED_DEFINE_POSIX_ERROR(EDOTDOT, EDOTDOT), /* 73 RFS specific error */ + MBED_DEFINE_POSIX_ERROR(EBADMSG, EBADMSG), /* 74 Not a data message */ + MBED_DEFINE_POSIX_ERROR(EOVERFLOW, EOVERFLOW), /* 75 Value too large for defined data type */ + MBED_DEFINE_POSIX_ERROR(ENOTUNIQ, ENOTUNIQ), /* 76 Name not unique on network */ + MBED_DEFINE_POSIX_ERROR(EBADFD, EBADFD), /* 77 File descriptor in bad state */ + MBED_DEFINE_POSIX_ERROR(EREMCHG, EREMCHG), /* 78 Remote address changed */ + MBED_DEFINE_POSIX_ERROR(ELIBACC, ELIBACC), /* 79 Can not access a needed shared library */ + MBED_DEFINE_POSIX_ERROR(ELIBBAD, ELIBBAD), /* 80 Accessing a corrupted shared library */ + MBED_DEFINE_POSIX_ERROR(ELIBSCN, ELIBSCN), /* 81 .lib section in a.out corrupted */ + MBED_DEFINE_POSIX_ERROR(ELIBMAX, ELIBMAX), /* 82 Attempting to link in too many shared libraries */ + MBED_DEFINE_POSIX_ERROR(ELIBEXEC, ELIBEXEC), /* 83 Cannot exec a shared library directly */ + MBED_DEFINE_POSIX_ERROR(EILSEQ, EILSEQ), /* 84 Illegal byte sequence */ + MBED_DEFINE_POSIX_ERROR(ERESTART, ERESTART), /* 85 Interrupted system call should be restarted */ + MBED_DEFINE_POSIX_ERROR(ESTRPIPE, ESTRPIPE), /* 86 Streams pipe error */ + MBED_DEFINE_POSIX_ERROR(EUSERS, EUSERS), /* 87 Too many users */ + MBED_DEFINE_POSIX_ERROR(ENOTSOCK, ENOTSOCK), /* 88 Socket operation on non-socket */ + MBED_DEFINE_POSIX_ERROR(EDESTADDRREQ, EDESTADDRREQ), /* 89 Destination address required */ + MBED_DEFINE_POSIX_ERROR(EMSGSIZE, EMSGSIZE), /* 90 Message too long */ + MBED_DEFINE_POSIX_ERROR(EPROTOTYPE, EPROTOTYPE), /* 91 Protocol wrong type for socket */ + MBED_DEFINE_POSIX_ERROR(ENOPROTOOPT, ENOPROTOOPT), /* 92 Protocol not available */ + MBED_DEFINE_POSIX_ERROR(EPROTONOSUPPORT, EPROTONOSUPPORT), /* 93 Protocol not supported */ + MBED_DEFINE_POSIX_ERROR(ESOCKTNOSUPPORT, ESOCKTNOSUPPORT), /* 94 Socket type not supported */ + MBED_DEFINE_POSIX_ERROR(EOPNOTSUPP, EOPNOTSUPP), /* 95 Operation not supported on transport endpoint */ + MBED_DEFINE_POSIX_ERROR(EPFNOSUPPORT, EPFNOSUPPORT), /* 96 Protocol family not supported */ + MBED_DEFINE_POSIX_ERROR(EAFNOSUPPORT, EAFNOSUPPORT), /* 97 Address family not supported by protocol */ + MBED_DEFINE_POSIX_ERROR(EADDRINUSE, EADDRINUSE), /* 98 Address already in use */ + MBED_DEFINE_POSIX_ERROR(EADDRNOTAVAIL, EADDRNOTAVAIL), /* 99 Cannot assign requested address */ + MBED_DEFINE_POSIX_ERROR(ENETDOWN, ENETDOWN), /* 100 Network is down */ + MBED_DEFINE_POSIX_ERROR(ENETUNREACH, ENETUNREACH), /* 101 Network is unreachable */ + MBED_DEFINE_POSIX_ERROR(ENETRESET, ENETRESET), /* 102 Network dropped connection because of reset */ + MBED_DEFINE_POSIX_ERROR(ECONNABORTED, ECONNABORTED), /* 103 Software caused connection abort */ + MBED_DEFINE_POSIX_ERROR(ECONNRESET, ECONNRESET), /* 104 Connection reset by peer */ + MBED_DEFINE_POSIX_ERROR(ENOBUFS, ENOBUFS), /* 105 No buffer space available */ + MBED_DEFINE_POSIX_ERROR(EISCONN, EISCONN), /* 106 Transport endpoint is already connected */ + MBED_DEFINE_POSIX_ERROR(ENOTCONN, ENOTCONN), /* 107 Transport endpoint is not connected */ + MBED_DEFINE_POSIX_ERROR(ESHUTDOWN, ESHUTDOWN), /* 108 Cannot send after transport endpoint shutdown */ + MBED_DEFINE_POSIX_ERROR(ETOOMANYREFS, ETOOMANYREFS), /* 109 Too many references: cannot splice */ + MBED_DEFINE_POSIX_ERROR(ETIMEDOUT, ETIMEDOUT), /* 110 Connection timed out */ + MBED_DEFINE_POSIX_ERROR(ECONNREFUSED, ECONNREFUSED), /* 111 Connection refused */ + MBED_DEFINE_POSIX_ERROR(EHOSTDOWN, EHOSTDOWN), /* 112 Host is down */ + MBED_DEFINE_POSIX_ERROR(EHOSTUNREACH, EHOSTUNREACH), /* 113 No route to host */ + MBED_DEFINE_POSIX_ERROR(EALREADY, EALREADY), /* 114 Operation already in progress */ + MBED_DEFINE_POSIX_ERROR(EINPROGRESS, EINPROGRESS), /* 115 Operation now in progress */ + MBED_DEFINE_POSIX_ERROR(ESTALE, ESTALE), /* 116 Stale NFS file handle */ + MBED_DEFINE_POSIX_ERROR(EUCLEAN, EUCLEAN), /* 117 Structure needs cleaning */ + MBED_DEFINE_POSIX_ERROR(ENOTNAM, ENOTNAM), /* 118 Not a XENIX named type file */ + MBED_DEFINE_POSIX_ERROR(ENAVAIL, ENAVAIL), /* 119 No XENIX semaphores available */ + MBED_DEFINE_POSIX_ERROR(EISNAM, EISNAM), /* 120 Is a named type file */ + MBED_DEFINE_POSIX_ERROR(EREMOTEIO, EREMOTEIO), /* 121 Remote I/O error */ + MBED_DEFINE_POSIX_ERROR(EDQUOT, EDQUOT), /* 122 Quota exceeded */ + MBED_DEFINE_POSIX_ERROR(ENOMEDIUM, ENOMEDIUM), /* 123 No medium found */ + MBED_DEFINE_POSIX_ERROR(EMEDIUMTYPE, EMEDIUMTYPE), /* 124 Wrong medium type */ + MBED_DEFINE_POSIX_ERROR(ECANCELED, ECANCELED), /* 125 Operation Canceled */ + MBED_DEFINE_POSIX_ERROR(ENOKEY, ENOKEY), /* 126 Required key not available */ + MBED_DEFINE_POSIX_ERROR(EKEYEXPIRED, EKEYEXPIRED), /* 127 Key has expired */ + MBED_DEFINE_POSIX_ERROR(EKEYREVOKED, EKEYREVOKED), /* 128 Key has been revoked */ + MBED_DEFINE_POSIX_ERROR(EKEYREJECTED, EKEYREJECTED), /* 129 Key was rejected by service */ + MBED_DEFINE_POSIX_ERROR(EOWNERDEAD, EOWNERDEAD), /* 130 Owner died */ + MBED_DEFINE_POSIX_ERROR(ENOTRECOVERABLE, ENOTRECOVERABLE), /* 131 State not recoverable */ + //Below are MBED SYSTEM ERROR CODE definitions //MBED SYSTEM ERROR CODE definitions starts at offset MBED_SYSTEM_ERROR_BASE, see above. // Error Name Error Offset Error Code - MBED_DEFINE_SYSTEM_ERROR( UNKNOWN ,0 ), /* 256 Unknown error */ - MBED_DEFINE_SYSTEM_ERROR( INVALID_ARGUMENT ,1 ), /* 257 Invalid Argument */ - 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_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 */ - MBED_DEFINE_SYSTEM_ERROR( UNSUPPORTED ,9 ), /* 265 Unsupported */ - MBED_DEFINE_SYSTEM_ERROR( BUFFER_FULL ,10 ), /* 266 Buffer Full */ - MBED_DEFINE_SYSTEM_ERROR( MEDIA_FULL ,11 ), /* 267 Media/Disk Full */ - MBED_DEFINE_SYSTEM_ERROR( ALREADY_IN_USE ,12 ), /* 268 Already in use */ - MBED_DEFINE_SYSTEM_ERROR( TIME_OUT ,13 ), /* 269 Timeout error */ - MBED_DEFINE_SYSTEM_ERROR( NOT_READY ,14 ), /* 270 Not Ready */ - MBED_DEFINE_SYSTEM_ERROR( FAILED_OPERATION ,15 ), /* 271 Requested Operation failed */ - MBED_DEFINE_SYSTEM_ERROR( OPERATION_PROHIBITED ,16 ), /* 272 Operation prohibited */ - 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( MUTEX_LOCK_FAILED ,21 ), /* 277 Mutex lock failed */ - MBED_DEFINE_SYSTEM_ERROR( SEMAPHORE_UNLOCK_FAILED ,22 ), /* 278 Sempahore 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 */ - MBED_DEFINE_SYSTEM_ERROR( CLOSE_FAILED ,26 ), /* 282 Close failed */ - MBED_DEFINE_SYSTEM_ERROR( READ_FAILED ,27 ), /* 283 Read failed */ - MBED_DEFINE_SYSTEM_ERROR( WRITE_FAILED ,28 ), /* 284 Write failed */ - MBED_DEFINE_SYSTEM_ERROR( INITIALIZATION_FAILED ,29 ), /* 285 Initialization failed */ - MBED_DEFINE_SYSTEM_ERROR( BOOT_FAILURE ,30 ), /* 286 Boot failure */ - MBED_DEFINE_SYSTEM_ERROR( OUT_OF_MEMORY ,31 ), /* 287 Out of memory */ - MBED_DEFINE_SYSTEM_ERROR( OUT_OF_RESOURCES ,32 ), /* 288 Out of resources */ - MBED_DEFINE_SYSTEM_ERROR( ALLOC_FAILED ,33 ), /* 289 Alloc failed */ - MBED_DEFINE_SYSTEM_ERROR( FREE_FAILED ,34 ), /* 290 Free failed */ - MBED_DEFINE_SYSTEM_ERROR( OVERFLOW ,35 ), /* 291 Overflow error */ - MBED_DEFINE_SYSTEM_ERROR( UNDERFLOW ,36 ), /* 292 Underflow error */ - MBED_DEFINE_SYSTEM_ERROR( STACK_OVERFLOW ,37 ), /* 293 Stack overflow error */ - MBED_DEFINE_SYSTEM_ERROR( ISR_QUEUE_OVERFLOW ,38 ), /* 294 ISR queue overflow */ - MBED_DEFINE_SYSTEM_ERROR( TIMER_QUEUE_OVERFLOW ,39 ), /* 295 Timer Queue overflow */ - MBED_DEFINE_SYSTEM_ERROR( CLIB_SPACE_UNAVAILABLE ,40 ), /* 296 Standard library error - Space unavailable */ - MBED_DEFINE_SYSTEM_ERROR( CLIB_EXCEPTION ,41 ), /* 297 Standard library error - Exception */ - MBED_DEFINE_SYSTEM_ERROR( CLIB_MUTEX_INIT_FAILURE ,42 ), /* 298 Standard library error - Mutex Init failure */ - MBED_DEFINE_SYSTEM_ERROR( CREATE_FAILED ,43 ), /* 299 Create failed */ - MBED_DEFINE_SYSTEM_ERROR( DELETE_FAILED ,44 ), /* 300 Delete failed */ - MBED_DEFINE_SYSTEM_ERROR( THREAD_CREATE_FAILED ,45 ), /* 301 Thread Create failed */ - MBED_DEFINE_SYSTEM_ERROR( THREAD_DELETE_FAILED ,46 ), /* 302 Thread Delete failed */ - MBED_DEFINE_SYSTEM_ERROR( PROHIBITED_IN_ISR_CONTEXT ,47 ), /* 303 Operation Prohibited in ISR context */ - MBED_DEFINE_SYSTEM_ERROR( PINMAP_INVALID ,48 ), /* 304 Pinmap Invalid */ - MBED_DEFINE_SYSTEM_ERROR( RTOS_EVENT ,49 ), /* 305 Unknown Rtos Error */ - MBED_DEFINE_SYSTEM_ERROR( RTOS_THREAD_EVENT ,50 ), /* 306 Rtos Thread Error */ - MBED_DEFINE_SYSTEM_ERROR( RTOS_MUTEX_EVENT ,51 ), /* 307 Rtos Mutex Error */ - MBED_DEFINE_SYSTEM_ERROR( RTOS_SEMAPHORE_EVENT ,52 ), /* 308 Rtos Semaphore Error */ - MBED_DEFINE_SYSTEM_ERROR( RTOS_MEMORY_POOL_EVENT ,53 ), /* 309 Rtos Memory Pool Error */ - MBED_DEFINE_SYSTEM_ERROR( RTOS_TIMER_EVENT ,54 ), /* 310 Rtos Timer Error */ - MBED_DEFINE_SYSTEM_ERROR( RTOS_EVENT_FLAGS_EVENT ,55 ), /* 311 Rtos Event flags Error */ - MBED_DEFINE_SYSTEM_ERROR( RTOS_MESSAGE_QUEUE_EVENT ,56 ), /* 312 Rtos Message queue Error */ - 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( 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 */ - MBED_DEFINE_SYSTEM_ERROR( USAGEFAULT_EXCEPTION ,64 ), /* 320 UsageFault exception*/ - + MBED_DEFINE_SYSTEM_ERROR(UNKNOWN, 0), /* 256 Unknown error */ + MBED_DEFINE_SYSTEM_ERROR(INVALID_ARGUMENT, 1), /* 257 Invalid Argument */ + 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_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 */ + MBED_DEFINE_SYSTEM_ERROR(UNSUPPORTED, 9), /* 265 Unsupported */ + MBED_DEFINE_SYSTEM_ERROR(BUFFER_FULL, 10), /* 266 Buffer Full */ + MBED_DEFINE_SYSTEM_ERROR(MEDIA_FULL, 11), /* 267 Media/Disk Full */ + MBED_DEFINE_SYSTEM_ERROR(ALREADY_IN_USE, 12), /* 268 Already in use */ + MBED_DEFINE_SYSTEM_ERROR(TIME_OUT, 13), /* 269 Timeout error */ + MBED_DEFINE_SYSTEM_ERROR(NOT_READY, 14), /* 270 Not Ready */ + MBED_DEFINE_SYSTEM_ERROR(FAILED_OPERATION, 15), /* 271 Requested Operation failed */ + MBED_DEFINE_SYSTEM_ERROR(OPERATION_PROHIBITED, 16), /* 272 Operation prohibited */ + 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(MUTEX_LOCK_FAILED, 21), /* 277 Mutex lock failed */ + MBED_DEFINE_SYSTEM_ERROR(SEMAPHORE_UNLOCK_FAILED, 22), /* 278 Sempahore 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 */ + MBED_DEFINE_SYSTEM_ERROR(CLOSE_FAILED, 26), /* 282 Close failed */ + MBED_DEFINE_SYSTEM_ERROR(READ_FAILED, 27), /* 283 Read failed */ + MBED_DEFINE_SYSTEM_ERROR(WRITE_FAILED, 28), /* 284 Write failed */ + MBED_DEFINE_SYSTEM_ERROR(INITIALIZATION_FAILED, 29), /* 285 Initialization failed */ + MBED_DEFINE_SYSTEM_ERROR(BOOT_FAILURE, 30), /* 286 Boot failure */ + MBED_DEFINE_SYSTEM_ERROR(OUT_OF_MEMORY, 31), /* 287 Out of memory */ + MBED_DEFINE_SYSTEM_ERROR(OUT_OF_RESOURCES, 32), /* 288 Out of resources */ + MBED_DEFINE_SYSTEM_ERROR(ALLOC_FAILED, 33), /* 289 Alloc failed */ + MBED_DEFINE_SYSTEM_ERROR(FREE_FAILED, 34), /* 290 Free failed */ + MBED_DEFINE_SYSTEM_ERROR(OVERFLOW, 35), /* 291 Overflow error */ + MBED_DEFINE_SYSTEM_ERROR(UNDERFLOW, 36), /* 292 Underflow error */ + MBED_DEFINE_SYSTEM_ERROR(STACK_OVERFLOW, 37), /* 293 Stack overflow error */ + MBED_DEFINE_SYSTEM_ERROR(ISR_QUEUE_OVERFLOW, 38), /* 294 ISR queue overflow */ + MBED_DEFINE_SYSTEM_ERROR(TIMER_QUEUE_OVERFLOW, 39), /* 295 Timer Queue overflow */ + MBED_DEFINE_SYSTEM_ERROR(CLIB_SPACE_UNAVAILABLE, 40), /* 296 Standard library error - Space unavailable */ + MBED_DEFINE_SYSTEM_ERROR(CLIB_EXCEPTION, 41), /* 297 Standard library error - Exception */ + MBED_DEFINE_SYSTEM_ERROR(CLIB_MUTEX_INIT_FAILURE, 42), /* 298 Standard library error - Mutex Init failure */ + MBED_DEFINE_SYSTEM_ERROR(CREATE_FAILED, 43), /* 299 Create failed */ + MBED_DEFINE_SYSTEM_ERROR(DELETE_FAILED, 44), /* 300 Delete failed */ + MBED_DEFINE_SYSTEM_ERROR(THREAD_CREATE_FAILED, 45), /* 301 Thread Create failed */ + MBED_DEFINE_SYSTEM_ERROR(THREAD_DELETE_FAILED, 46), /* 302 Thread Delete failed */ + MBED_DEFINE_SYSTEM_ERROR(PROHIBITED_IN_ISR_CONTEXT, 47), /* 303 Operation Prohibited in ISR context */ + MBED_DEFINE_SYSTEM_ERROR(PINMAP_INVALID, 48), /* 304 Pinmap Invalid */ + MBED_DEFINE_SYSTEM_ERROR(RTOS_EVENT, 49), /* 305 Unknown Rtos Error */ + MBED_DEFINE_SYSTEM_ERROR(RTOS_THREAD_EVENT, 50), /* 306 Rtos Thread Error */ + MBED_DEFINE_SYSTEM_ERROR(RTOS_MUTEX_EVENT, 51), /* 307 Rtos Mutex Error */ + MBED_DEFINE_SYSTEM_ERROR(RTOS_SEMAPHORE_EVENT, 52), /* 308 Rtos Semaphore Error */ + MBED_DEFINE_SYSTEM_ERROR(RTOS_MEMORY_POOL_EVENT, 53), /* 309 Rtos Memory Pool Error */ + MBED_DEFINE_SYSTEM_ERROR(RTOS_TIMER_EVENT, 54), /* 310 Rtos Timer Error */ + MBED_DEFINE_SYSTEM_ERROR(RTOS_EVENT_FLAGS_EVENT, 55), /* 311 Rtos Event flags Error */ + MBED_DEFINE_SYSTEM_ERROR(RTOS_MESSAGE_QUEUE_EVENT, 56), /* 312 Rtos Message queue Error */ + 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(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 */ + MBED_DEFINE_SYSTEM_ERROR(USAGEFAULT_EXCEPTION, 64), /* 320 UsageFault exception*/ + //Everytime you add a new system error code, you must update //Error documentation under Handbook to capture the info on //the new error status/codes - + //MBED CUSTOM ERROR CODE definitions starts at offset MBED_CUSTOM_ERROR_BASE, see above. /* Add More/Custom Error Codes here, See example below */ - //DEFINE_CUSTOM_ERROR( MY_CUSTOM_ERROR , 1 ), - + //DEFINE_CUSTOM_ERROR( MY_CUSTOM_ERROR , 1 ), + } mbed_error_code_t; /** mbed_error_ctx struct @@ -820,7 +819,7 @@ typedef struct _mbed_error_ctx { #ifdef MBED_CONF_PLATFORM_MAX_ERROR_FILENAME_LEN char error_filename[MBED_CONF_PLATFORM_MAX_ERROR_FILENAME_LEN]; uint32_t error_line_number; -#endif +#endif } mbed_error_ctx; /** To generate a fatal compile-time error, you can use the pre-processor #error directive. @@ -864,8 +863,8 @@ typedef struct _mbed_error_ctx { * * */ - -void error(const char* format, ...); + +void error(const char *format, ...); /** * Call this Macro to generate a mbed_error_status_t value for a System error @@ -873,7 +872,7 @@ void error(const char* format, ...); * @param error_code The mbed_error_code_t code to be used in generating the mbed_error_status_t. See mbed_error_code_t for error codes. * * @code - * + * * mbed_error_status_t driver_error = MBED_MAKE_SYSTEM_ERROR( MODULE_DRIVER_USB, MBED_ERROR_CODE_INITIALIZATION_FAILED ) * * @endcode @@ -888,7 +887,7 @@ void error(const char* format, ...); * @param error_code The mbed_error_code_t code to be used in generating the mbed_error_status_t. See mbed_error_code_t for error codes. * * @code - * + * * mbed_error_status_t custom_error = MBED_MAKE_CUSTOM_ERROR( MBED_MODULE_APPLICATION, 0xDEAD//16-bit custom error code ) * * @endcode @@ -903,7 +902,7 @@ void error(const char* format, ...); * @param error_code The mbed_error_code_t code to be used in generating the mbed_error_status_t. See mbed_error_code_t for error codes. * * @code - * + * * mbed_error_status_t new_error = MBED_MAKE_ERROR( MODULE_DRIVER_USB, MBED_ERROR_INITIALIZATION_FAILED ) * * @endcode @@ -932,10 +931,10 @@ typedef void (*mbed_error_hook_t)(const mbed_error_ctx *error_ctx); * @param filename Name of the source file originating the error( Most callers can pass __FILE__ here ). * @param line_number The line number of the source file originating the error( Most callers can pass __LINE__ here ) . * @return 0 or MBED_SUCCESS. - * MBED_ERROR_INVALID_ARGUMENT if called with invalid error status/codes + * MBED_ERROR_INVALID_ARGUMENT if called with invalid error status/codes * * @code - * + * * mbed_error( ERROR_OUT_OF_MEMORY, "Out of memory error", 0, __FILE__, __LINE__ ) * * @endcode @@ -967,17 +966,17 @@ int mbed_get_error_count(void); /** * Call this function to set a fatal system error and halt the system. This function will log the fatal error with the context info and prints the error report and halts the system. - * + * * @param error_status mbed_error_status_t status to be set(See mbed_error_status_t enum above for available error status values). * @param error_msg The error message to be printed out to STDIO/Serial. * @param error_value Value associated with the error status. This would depend on error code/error scenario. * @param filename Name of the source file originating the error( Most callers can pass __FILE__ here ). * @param line_number The line number of the source file originating the error( Most callers can pass __LINE__ here ) . * @return 0 or MBED_SUCCESS. - * MBED_ERROR_INVALID_ARGUMENT if called with invalid error status/codes + * MBED_ERROR_INVALID_ARGUMENT if called with invalid error status/codes * * @code - * + * * mbed_error( MBED_ERROR_PROHIBITED_OPERATION, "Prohibited operation tried", 0, __FILE__, __LINE__ ) * * @endcode @@ -987,7 +986,7 @@ int mbed_get_error_count(void); mbed_error_status_t mbed_error(mbed_error_status_t error_status, const char *error_msg, unsigned int error_value, const char *filename, int line_number); /** - * Registers an application defined error callback with the error handling system. + * Registers an application defined error callback with the error handling system. * This function will be called with error context info whenever system handles a mbed_error/mbed_warning call * NOTE: This function should be implemented for re-entrancy as multiple threads may invoke mbed_error which may cause error hook to be called. * @param custom_error_hook mbed_error_status_t status to be set(See mbed_error_status_t enum above for available error status values). @@ -995,7 +994,7 @@ mbed_error_status_t mbed_error(mbed_error_status_t error_status, const char *err * MBED_ERROR_INVALID_ARGUMENT in case of NULL for custom_error_hook * * @code - * + * * mbed_error_status_t my_custom_error_hook(mbed_error_status_t error_status, const mbed_error_ctx *error_ctx) { * //Do something with the error_status or error_ctx * } @@ -1052,7 +1051,7 @@ int mbed_get_error_hist_count(void); /** * Reads the error context information for a specific error from error history, specified by the index. - * + * * @param index index of the error context entry in the history to be retrieved.\n * The number of entries in the error history is configured during build and the max index depends on max depth of error history.\n * index = 0 points to the oldest entry in the history, and index = (max history depth - 1) points to the latest entry in the error history.\n @@ -1065,11 +1064,11 @@ mbed_error_status_t mbed_get_error_hist_info(int index, mbed_error_ctx *error_in /** * Saves the error history information to a file - * + * * @param path path to the file in the filesystem * @return 0 or MBED_ERROR_SUCCESS on success. * MBED_ERROR_WRITE_FAILED if writing to file failed - * MBED_ERROR_INVALID_ARGUMENT if path is not valid + * MBED_ERROR_INVALID_ARGUMENT if path is not valid * * @note Filesystem support is required in order for this function to work. * diff --git a/platform/mbed_error_hist.c b/platform/mbed_error_hist.c index 8472bf0472b..411ae097ca0 100644 --- a/platform/mbed_error_hist.c +++ b/platform/mbed_error_hist.c @@ -33,12 +33,12 @@ mbed_error_status_t mbed_error_hist_put(mbed_error_ctx *error_ctx) if (NULL == error_ctx) { return MBED_ERROR_INVALID_ARGUMENT; } - + core_util_critical_section_enter(); error_log_count++; memcpy(&mbed_error_ctx_log[error_log_count % MBED_CONF_PLATFORM_ERROR_HIST_SIZE], error_ctx, sizeof(mbed_error_ctx)); - core_util_critical_section_exit(); - + core_util_critical_section_exit(); + return MBED_SUCCESS; } @@ -48,15 +48,15 @@ mbed_error_status_t mbed_error_hist_get(int index, mbed_error_ctx *error_ctx) if (index >= MBED_CONF_PLATFORM_ERROR_HIST_SIZE) { return MBED_ERROR_INVALID_ARGUMENT; } - + core_util_critical_section_enter(); //calculate the index where we want to pick the ctx if (error_log_count >= MBED_CONF_PLATFORM_ERROR_HIST_SIZE) { index = (error_log_count + index + 1) % MBED_CONF_PLATFORM_ERROR_HIST_SIZE; } - core_util_critical_section_exit(); + core_util_critical_section_exit(); memcpy(error_ctx, &mbed_error_ctx_log[index % MBED_CONF_PLATFORM_ERROR_HIST_SIZE], sizeof(mbed_error_ctx)); - + return MBED_SUCCESS; } @@ -65,8 +65,8 @@ mbed_error_ctx *mbed_error_hist_get_entry(void) core_util_critical_section_enter(); error_log_count++; mbed_error_ctx *ctx = &mbed_error_ctx_log[error_log_count % MBED_CONF_PLATFORM_ERROR_HIST_SIZE]; - core_util_critical_section_exit(); - + core_util_critical_section_exit(); + return ctx; } @@ -77,22 +77,22 @@ mbed_error_status_t mbed_error_hist_get_last_error(mbed_error_ctx *error_ctx) } core_util_critical_section_enter(); memcpy(error_ctx, &mbed_error_ctx_log[error_log_count % MBED_CONF_PLATFORM_ERROR_HIST_SIZE], sizeof(mbed_error_ctx)); - core_util_critical_section_exit(); - + core_util_critical_section_exit(); + return MBED_SUCCESS; } int mbed_error_hist_get_count() { - return (error_log_count >= MBED_CONF_PLATFORM_ERROR_HIST_SIZE? MBED_CONF_PLATFORM_ERROR_HIST_SIZE:error_log_count+1); + return (error_log_count >= MBED_CONF_PLATFORM_ERROR_HIST_SIZE ? MBED_CONF_PLATFORM_ERROR_HIST_SIZE : error_log_count + 1); } mbed_error_status_t mbed_error_hist_reset() { core_util_critical_section_enter(); error_log_count = -1; - core_util_critical_section_exit(); - + core_util_critical_section_exit(); + return MBED_SUCCESS; } diff --git a/platform/mbed_error_hist.h b/platform/mbed_error_hist.h index 0ac7c99e27d..e83315bfec1 100644 --- a/platform/mbed_error_hist.h +++ b/platform/mbed_error_hist.h @@ -17,11 +17,11 @@ #define MBED_ERROR_HIST_H #ifndef MBED_CONF_PLATFORM_ERROR_HIST_SIZE - #define MBED_CONF_PLATFORM_ERROR_HIST_SIZE 4 +#define MBED_CONF_PLATFORM_ERROR_HIST_SIZE 4 #else - #if MBED_CONF_PLATFORM_ERROR_HIST_SIZE == 0 - #define MBED_CONF_PLATFORM_ERROR_HIST_SIZE 1 - #endif +#if MBED_CONF_PLATFORM_ERROR_HIST_SIZE == 0 +#define MBED_CONF_PLATFORM_ERROR_HIST_SIZE 1 +#endif #endif #ifdef __cplusplus @@ -29,24 +29,24 @@ extern "C" { #endif /* * Puts/Adds an error entry into the error history list - * + * * @param error_ctx pointer to the mbed_error_ctx struct with the error context * @return 0 or MBED_SUCCESS on success. * MBED_ERROR_WRITE_FAILED if writing to file failed - * MBED_ERROR_INVALID_ARGUMENT if path is not valid + * MBED_ERROR_INVALID_ARGUMENT if path is not valid * * */ mbed_error_status_t mbed_error_hist_put(mbed_error_ctx *error_ctx); - + /* * Reads the error entry from the error list with the specified index - * + * * @param index Index of the error context to be retrieved. It starts from 0 and 0 is the oldest. * @param error_ctx pointer to the mbed_error_ctx struct where the error context will be filled, this should be allocated by the caller * @return 0 or MBED_SUCCESS on success. * MBED_ERROR_WRITE_FAILED if writing to file failed - * MBED_ERROR_INVALID_ARGUMENT if path is not valid + * MBED_ERROR_INVALID_ARGUMENT if path is not valid * * */ @@ -55,8 +55,8 @@ mbed_error_status_t mbed_error_hist_get(int index, mbed_error_ctx *error_ctx); /* * Gets a reference to the next error entry in the error log where in the error ctx can be filled in. * Its like reserving the next error entry to fill in the error info - * - * @return Returns the pointer to the next error ctx entry + * + * @return Returns the pointer to the next error ctx entry * * */ @@ -64,11 +64,11 @@ mbed_error_ctx *mbed_error_hist_get_entry(void); /* * Reads the last(latest) error entry from the error history - * + * * @param error_ctx pointer to the mbed_error_ctx struct where the error context will be filled, this should be allocated by the caller * @return 0 or MBED_SUCCESS on success. * MBED_ERROR_WRITE_FAILED if writing to file failed - * MBED_ERROR_INVALID_ARGUMENT if path is not valid + * MBED_ERROR_INVALID_ARGUMENT if path is not valid * * */ @@ -76,8 +76,8 @@ mbed_error_status_t mbed_error_hist_get_last_error(mbed_error_ctx *error_ctx); /* * Returns the number of error entries in the error history list - * - * @return Number of entries in the history list + * + * @return Number of entries in the history list * * */ @@ -85,10 +85,10 @@ int mbed_error_hist_get_count(void); /* * Resets the error log by resetting the number of errors to 0 and clears all previous errors in the history list - * + * * @return 0 or MBED_SUCCESS on success. * MBED_ERROR_WRITE_FAILED if writing to file failed - * MBED_ERROR_INVALID_ARGUMENT if path is not valid + * MBED_ERROR_INVALID_ARGUMENT if path is not valid * * */ @@ -96,17 +96,17 @@ mbed_error_status_t mbed_error_hist_reset(void); /* * Saves the error log information to a file - * + * * @param path path to the file in the filesystem * @return 0 or MBED_SUCCESS on success. * MBED_ERROR_WRITE_FAILED if writing to file failed - * MBED_ERROR_INVALID_ARGUMENT if path is not valid + * MBED_ERROR_INVALID_ARGUMENT if path is not valid * * @note Filesystem support is required in order for this function to work. * */ -mbed_error_status_t mbed_save_error_hist(const char *path); - +mbed_error_status_t mbed_save_error_hist(const char *path); + #ifdef __cplusplus } #endif diff --git a/platform/mbed_interface.c b/platform/mbed_interface.c index 99c7c4891b1..b1a43697e9b 100644 --- a/platform/mbed_interface.c +++ b/platform/mbed_interface.c @@ -25,11 +25,13 @@ #if DEVICE_SEMIHOST // return true if a debugger is attached, indicating mbed interface is connected -int mbed_interface_connected(void) { +int mbed_interface_connected(void) +{ return semihost_connected(); } -int mbed_interface_reset(void) { +int mbed_interface_reset(void) +{ if (mbed_interface_connected()) { semihost_reset(); return 0; @@ -38,7 +40,8 @@ int mbed_interface_reset(void) { } } -WEAK int mbed_interface_uid(char *uid) { +WEAK int mbed_interface_uid(char *uid) +{ if (mbed_interface_connected()) { return semihost_uid(uid); // Returns 0 if successful, -1 on failure } else { @@ -47,11 +50,13 @@ WEAK int mbed_interface_uid(char *uid) { } } -int mbed_interface_disconnect(void) { +int mbed_interface_disconnect(void) +{ int res; if (mbed_interface_connected()) { - if ((res = semihost_disabledebug()) != 0) + if ((res = semihost_disabledebug()) != 0) { return res; + } while (mbed_interface_connected()); return 0; } else { @@ -59,11 +64,13 @@ int mbed_interface_disconnect(void) { } } -int mbed_interface_powerdown(void) { +int mbed_interface_powerdown(void) +{ int res; if (mbed_interface_connected()) { - if ((res = semihost_powerdown()) != 0) + if ((res = semihost_powerdown()) != 0) { return res; + } while (mbed_interface_connected()); return 0; } else { @@ -72,17 +79,20 @@ int mbed_interface_powerdown(void) { } MBED_DEPRECATED_SINCE("mbed-os-5.9", "This function shouldn't be used in new code." - "For system reset funcionality use system_reset()") -void mbed_reset(void) { + "For system reset funcionality use system_reset()") +void mbed_reset(void) +{ mbed_interface_reset(); } -WEAK int mbed_uid(char *uid) { +WEAK int mbed_uid(char *uid) +{ return mbed_interface_uid(uid); } #endif -WEAK void mbed_mac_address(char *mac) { +WEAK void mbed_mac_address(char *mac) +{ #if DEVICE_SEMIHOST char uid[DEVICE_ID_LENGTH + 1]; int i; @@ -93,7 +103,7 @@ WEAK void mbed_mac_address(char *mac) { #if defined(DEVICE_MAC_OFFSET) p += DEVICE_MAC_OFFSET; #endif - for (i=0; i<6; i++) { + for (i = 0; i < 6; i++) { int byte; sscanf(p, "%2x", &byte); mac[i] = byte; diff --git a/platform/mbed_interface.h b/platform/mbed_interface.h index 94baa34f775..48594916e8f 100644 --- a/platform/mbed_interface.h +++ b/platform/mbed_interface.h @@ -135,7 +135,7 @@ void mbed_die(void); * @endcode * */ -void mbed_error_printf(const char* format, ...); +void mbed_error_printf(const char *format, ...); /** Print out an error message. Similar to mbed_error_printf * but uses a va_list. @@ -146,7 +146,7 @@ void mbed_error_printf(const char* format, ...); * @param arg Variable arguments list * */ -void mbed_error_vfprintf(const char * format, va_list arg); +void mbed_error_vfprintf(const char *format, va_list arg); /** @}*/ #ifdef __cplusplus diff --git a/platform/mbed_mem_trace.cpp b/platform/mbed_mem_trace.cpp index 17326f78e57..7b7b3aa3234 100644 --- a/platform/mbed_mem_trace.cpp +++ b/platform/mbed_mem_trace.cpp @@ -41,7 +41,8 @@ static SingletonPtr mem_trace_mutex; * Public interface *****************************************************************************/ -void mbed_mem_trace_set_callback(mbed_mem_trace_cb_t cb) { +void mbed_mem_trace_set_callback(mbed_mem_trace_cb_t cb) +{ mem_trace_cb = cb; } @@ -57,7 +58,8 @@ void mbed_mem_trace_unlock() mem_trace_mutex->unlock(); } -void *mbed_mem_trace_malloc(void *res, size_t size, void *caller) { +void *mbed_mem_trace_malloc(void *res, size_t size, void *caller) +{ if (mem_trace_cb) { if (TRACE_FIRST_LOCK()) { mem_trace_cb(MBED_MEM_TRACE_MALLOC, res, caller, size); @@ -66,7 +68,8 @@ void *mbed_mem_trace_malloc(void *res, size_t size, void *caller) { return res; } -void *mbed_mem_trace_realloc(void *res, void *ptr, size_t size, void *caller) { +void *mbed_mem_trace_realloc(void *res, void *ptr, size_t size, void *caller) +{ if (mem_trace_cb) { if (TRACE_FIRST_LOCK()) { mem_trace_cb(MBED_MEM_TRACE_REALLOC, res, caller, ptr, size); @@ -75,7 +78,8 @@ void *mbed_mem_trace_realloc(void *res, void *ptr, size_t size, void *caller) { return res; } -void *mbed_mem_trace_calloc(void *res, size_t num, size_t size, void *caller) { +void *mbed_mem_trace_calloc(void *res, size_t num, size_t size, void *caller) +{ if (mem_trace_cb) { if (TRACE_FIRST_LOCK()) { mem_trace_cb(MBED_MEM_TRACE_CALLOC, res, caller, num, size); @@ -84,7 +88,8 @@ void *mbed_mem_trace_calloc(void *res, size_t num, size_t size, void *caller) { return res; } -void mbed_mem_trace_free(void *ptr, void *caller) { +void mbed_mem_trace_free(void *ptr, void *caller) +{ if (mem_trace_cb) { if (TRACE_FIRST_LOCK()) { mem_trace_cb(MBED_MEM_TRACE_FREE, NULL, caller, ptr); @@ -92,20 +97,21 @@ void mbed_mem_trace_free(void *ptr, void *caller) { } } -void mbed_mem_trace_default_callback(uint8_t op, void *res, void *caller, ...) { +void mbed_mem_trace_default_callback(uint8_t op, void *res, void *caller, ...) +{ va_list va; size_t temp_s1, temp_s2; void *temp_ptr; va_start(va, caller); - switch(op) { + switch (op) { case MBED_MEM_TRACE_MALLOC: temp_s1 = va_arg(va, size_t); printf(MBED_MEM_DEFAULT_TRACER_PREFIX "m:%p;%p-%u\n", res, caller, temp_s1); break; case MBED_MEM_TRACE_REALLOC: - temp_ptr = va_arg(va, void*); + temp_ptr = va_arg(va, void *); temp_s1 = va_arg(va, size_t); printf(MBED_MEM_DEFAULT_TRACER_PREFIX "r:%p;%p-%p;%u\n", res, caller, temp_ptr, temp_s1); break; @@ -117,7 +123,7 @@ void mbed_mem_trace_default_callback(uint8_t op, void *res, void *caller, ...) { break; case MBED_MEM_TRACE_FREE: - temp_ptr = va_arg(va, void*); + temp_ptr = va_arg(va, void *); printf(MBED_MEM_DEFAULT_TRACER_PREFIX "f:%p;%p-%p\n", res, caller, temp_ptr); break; diff --git a/platform/mbed_mem_trace.h b/platform/mbed_mem_trace.h index 6b604a08a7b..1fe2e99a905 100644 --- a/platform/mbed_mem_trace.h +++ b/platform/mbed_mem_trace.h @@ -63,7 +63,7 @@ enum { * - for calloc: cb(MBED_MEM_TRACE_CALLOC, res, caller, nmemb, size). * - for free: cb(MBED_MEM_TRACE_FREE, NULL, caller, ptr). */ -typedef void (*mbed_mem_trace_cb_t)(uint8_t op, void *res, void* caller, ...); +typedef void (*mbed_mem_trace_cb_t)(uint8_t op, void *res, void *caller, ...); /** * Set the callback used by the memory tracer (use NULL for disable tracing). diff --git a/platform/mbed_mktime.c b/platform/mbed_mktime.c index cb1280c9c21..68e3b9f62d6 100644 --- a/platform/mbed_mktime.c +++ b/platform/mbed_mktime.c @@ -20,7 +20,7 @@ #define SECONDS_BY_MINUTES 60 #define MINUTES_BY_HOUR 60 #define SECONDS_BY_HOUR (SECONDS_BY_MINUTES * MINUTES_BY_HOUR) -#define HOURS_BY_DAY 24 +#define HOURS_BY_DAY 24 #define SECONDS_BY_DAY (SECONDS_BY_HOUR * HOURS_BY_DAY) #define LAST_VALID_YEAR 206 @@ -29,48 +29,49 @@ #define EDGE_TIMESTAMP_4_YEAR_LEAP_YEAR_SUPPORT 3133695 // 6th of February 1970 at 06:28:15 /* - * 2 dimensional array containing the number of seconds elapsed before a given + * 2 dimensional array containing the number of seconds elapsed before a given * month. * The second index map to the month while the first map to the type of year: - * - 0: non leap year + * - 0: non leap year * - 1: leap year */ static const uint32_t seconds_before_month[2][12] = { { 0, 31 * SECONDS_BY_DAY, - (31 + 28) * SECONDS_BY_DAY, - (31 + 28 + 31) * SECONDS_BY_DAY, - (31 + 28 + 31 + 30) * SECONDS_BY_DAY, - (31 + 28 + 31 + 30 + 31) * SECONDS_BY_DAY, - (31 + 28 + 31 + 30 + 31 + 30) * SECONDS_BY_DAY, - (31 + 28 + 31 + 30 + 31 + 30 + 31) * SECONDS_BY_DAY, - (31 + 28 + 31 + 30 + 31 + 30 + 31 + 31) * SECONDS_BY_DAY, - (31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30) * SECONDS_BY_DAY, - (31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31) * SECONDS_BY_DAY, - (31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30) * SECONDS_BY_DAY, + (31 + 28) *SECONDS_BY_DAY, + (31 + 28 + 31) *SECONDS_BY_DAY, + (31 + 28 + 31 + 30) *SECONDS_BY_DAY, + (31 + 28 + 31 + 30 + 31) *SECONDS_BY_DAY, + (31 + 28 + 31 + 30 + 31 + 30) *SECONDS_BY_DAY, + (31 + 28 + 31 + 30 + 31 + 30 + 31) *SECONDS_BY_DAY, + (31 + 28 + 31 + 30 + 31 + 30 + 31 + 31) *SECONDS_BY_DAY, + (31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30) *SECONDS_BY_DAY, + (31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31) *SECONDS_BY_DAY, + (31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30) *SECONDS_BY_DAY, }, { 0, 31 * SECONDS_BY_DAY, - (31 + 29) * SECONDS_BY_DAY, - (31 + 29 + 31) * SECONDS_BY_DAY, - (31 + 29 + 31 + 30) * SECONDS_BY_DAY, - (31 + 29 + 31 + 30 + 31) * SECONDS_BY_DAY, - (31 + 29 + 31 + 30 + 31 + 30) * SECONDS_BY_DAY, - (31 + 29 + 31 + 30 + 31 + 30 + 31) * SECONDS_BY_DAY, - (31 + 29 + 31 + 30 + 31 + 30 + 31 + 31) * SECONDS_BY_DAY, - (31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30) * SECONDS_BY_DAY, - (31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31) * SECONDS_BY_DAY, - (31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30) * SECONDS_BY_DAY, + (31 + 29) *SECONDS_BY_DAY, + (31 + 29 + 31) *SECONDS_BY_DAY, + (31 + 29 + 31 + 30) *SECONDS_BY_DAY, + (31 + 29 + 31 + 30 + 31) *SECONDS_BY_DAY, + (31 + 29 + 31 + 30 + 31 + 30) *SECONDS_BY_DAY, + (31 + 29 + 31 + 30 + 31 + 30 + 31) *SECONDS_BY_DAY, + (31 + 29 + 31 + 30 + 31 + 30 + 31 + 31) *SECONDS_BY_DAY, + (31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30) *SECONDS_BY_DAY, + (31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31) *SECONDS_BY_DAY, + (31 + 29 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30) *SECONDS_BY_DAY, } }; -bool _rtc_is_leap_year(int year, rtc_leap_year_support_t leap_year_support) { - /* - * since in practice, the value manipulated by this algorithm lie in the +bool _rtc_is_leap_year(int year, rtc_leap_year_support_t leap_year_support) +{ + /* + * since in practice, the value manipulated by this algorithm lie in the * range: [70 : 206] the algorithm can be reduced to: year % 4 with exception for 200 (year 2100 is not leap year). - * The algorithm valid over the full range of value is: + * The algorithm valid over the full range of value is: year = 1900 + year; if (year % 4) { @@ -82,7 +83,7 @@ bool _rtc_is_leap_year(int year, rtc_leap_year_support_t leap_year_support) { } return true; - */ + */ if (leap_year_support == RTC_FULL_LEAP_YEAR_SUPPORT && year == 200) { return false; // 2100 is not a leap year } @@ -90,7 +91,8 @@ bool _rtc_is_leap_year(int year, rtc_leap_year_support_t leap_year_support) { return (year) % 4 ? false : true; } -bool _rtc_maketime(const struct tm* time, time_t * seconds, rtc_leap_year_support_t leap_year_support) { +bool _rtc_maketime(const struct tm *time, time_t *seconds, rtc_leap_year_support_t leap_year_support) +{ if (seconds == NULL || time == NULL) { return false; } @@ -111,12 +113,12 @@ bool _rtc_maketime(const struct tm* time, time_t * seconds, rtc_leap_year_suppor /* Check if we are within valid range. */ if (time->tm_year == LAST_VALID_YEAR) { if ((leap_year_support == RTC_FULL_LEAP_YEAR_SUPPORT && result > EDGE_TIMESTAMP_FULL_LEAP_YEAR_SUPPORT) || - (leap_year_support == RTC_4_YEAR_LEAP_YEAR_SUPPORT && result > EDGE_TIMESTAMP_4_YEAR_LEAP_YEAR_SUPPORT)) { - return false; + (leap_year_support == RTC_4_YEAR_LEAP_YEAR_SUPPORT && result > EDGE_TIMESTAMP_4_YEAR_LEAP_YEAR_SUPPORT)) { + return false; } } - if (time->tm_year > 70) { + if (time->tm_year > 70) { /* Valid in the range [70:206]. */ uint32_t count_of_leap_days = ((time->tm_year - 1) / 4) - (70 / 4); if (leap_year_support == RTC_FULL_LEAP_YEAR_SUPPORT) { @@ -133,7 +135,8 @@ bool _rtc_maketime(const struct tm* time, time_t * seconds, rtc_leap_year_suppor return true; } -bool _rtc_localtime(time_t timestamp, struct tm* time_info, rtc_leap_year_support_t leap_year_support) { +bool _rtc_localtime(time_t timestamp, struct tm *time_info, rtc_leap_year_support_t leap_year_support) +{ if (time_info == NULL) { return false; } @@ -154,7 +157,7 @@ bool _rtc_localtime(time_t timestamp, struct tm* time_info, rtc_leap_year_suppor /* Years start at 70. */ time_info->tm_year = 70; - while (true) { + while (true) { if (_rtc_is_leap_year(time_info->tm_year, leap_year_support) && seconds >= 366) { ++time_info->tm_year; seconds -= 366; diff --git a/platform/mbed_mktime.h b/platform/mbed_mktime.h index f877512b9d2..eed21a9fc3f 100644 --- a/platform/mbed_mktime.h +++ b/platform/mbed_mktime.h @@ -90,7 +90,7 @@ bool _rtc_is_leap_year(int year, rtc_leap_year_support_t leap_year_support); * @note Full and partial leap years support. * @note For use by the HAL only */ -bool _rtc_maketime(const struct tm* time, time_t * seconds, rtc_leap_year_support_t leap_year_support); +bool _rtc_maketime(const struct tm *time, time_t *seconds, rtc_leap_year_support_t leap_year_support); /* Convert a given time in seconds since epoch into calendar time. * @@ -118,7 +118,7 @@ bool _rtc_maketime(const struct tm* time, time_t * seconds, rtc_leap_year_suppor * @note For use by the HAL only. * @note Full and partial leap years support. */ -bool _rtc_localtime(time_t timestamp, struct tm* time_info, rtc_leap_year_support_t leap_year_support); +bool _rtc_localtime(time_t timestamp, struct tm *time_info, rtc_leap_year_support_t leap_year_support); /** @}*/ diff --git a/platform/mbed_power_mgmt.h b/platform/mbed_power_mgmt.h index 9fa7552ab0b..5d30348dcea 100644 --- a/platform/mbed_power_mgmt.h +++ b/platform/mbed_power_mgmt.h @@ -170,7 +170,7 @@ static inline void sleep(void) /** Send the microcontroller to deep sleep * * @deprecated - * Do not use this function. Applications should use sleep() API which puts the system in deepsleep mode if supported. + * Do not use this function. Applications should use sleep() API which puts the system in deepsleep mode if supported. * * @note This function can be a noop if not implemented by the platform. * @note This function will be a noop in debug mode (debug build profile when MBED_DEBUG is defined) @@ -206,7 +206,7 @@ static inline void system_reset(void) { NVIC_SystemReset(); } - + /** Provides the time spent in sleep mode since boot. * * @return Time spent in sleep diff --git a/platform/mbed_retarget.cpp b/platform/mbed_retarget.cpp index 1b14fd84e57..461375938d6 100644 --- a/platform/mbed_retarget.cpp +++ b/platform/mbed_retarget.cpp @@ -111,10 +111,11 @@ static SingletonPtr filehandle_mutex; namespace mbed { void mbed_set_unbuffered_stream(std::FILE *_file); -void remove_filehandle(FileHandle *file) { +void remove_filehandle(FileHandle *file) +{ filehandle_mutex->lock(); /* Remove all open filehandles for this */ - for (unsigned int fh_i = 0; fh_i < sizeof(filehandles)/sizeof(*filehandles); fh_i++) { + for (unsigned int fh_i = 0; fh_i < sizeof(filehandles) / sizeof(*filehandles); fh_i++) { if (filehandles[fh_i] == file) { filehandles[fh_i] = NULL; } @@ -137,23 +138,30 @@ class DirectSerial : public FileHandle { DirectSerial(PinName tx, PinName rx, int baud); virtual ssize_t write(const void *buffer, size_t size); virtual ssize_t read(void *buffer, size_t size); - virtual off_t seek(off_t offset, int whence = SEEK_SET) { + virtual off_t seek(off_t offset, int whence = SEEK_SET) + { return -ESPIPE; } - virtual off_t size() { + virtual off_t size() + { return -EINVAL; } - virtual int isatty() { + virtual int isatty() + { return true; } - virtual int close() { + virtual int close() + { return 0; } virtual short poll(short events) const; }; -DirectSerial::DirectSerial(PinName tx, PinName rx, int baud) { - if (stdio_uart_inited) return; +DirectSerial::DirectSerial(PinName tx, PinName rx, int baud) +{ + if (stdio_uart_inited) { + return; + } serial_init(&stdio_uart, tx, rx); serial_baud(&stdio_uart, baud); #if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS @@ -165,7 +173,8 @@ DirectSerial::DirectSerial(PinName tx, PinName rx, int baud) { #endif } -ssize_t DirectSerial::write(const void *buffer, size_t size) { +ssize_t DirectSerial::write(const void *buffer, size_t size) +{ const unsigned char *buf = static_cast(buffer); for (size_t i = 0; i < size; i++) { serial_putc(&stdio_uart, buf[i]); @@ -173,7 +182,8 @@ ssize_t DirectSerial::write(const void *buffer, size_t size) { return size; } -ssize_t DirectSerial::read(void *buffer, size_t size) { +ssize_t DirectSerial::read(void *buffer, size_t size) +{ unsigned char *buf = static_cast(buffer); if (size == 0) { return 0; @@ -182,7 +192,8 @@ ssize_t DirectSerial::read(void *buffer, size_t size) { return 1; } -short DirectSerial::poll(short events) const { +short DirectSerial::poll(short events) const +{ short revents = 0; if ((events & POLLIN) && serial_readable(&stdio_uart)) { revents |= POLLIN; @@ -198,18 +209,32 @@ class Sink : public FileHandle { public: virtual ssize_t write(const void *buffer, size_t size); virtual ssize_t read(void *buffer, size_t size); - virtual off_t seek(off_t offset, int whence = SEEK_SET) { return ESPIPE; } - virtual off_t size() { return -EINVAL; } - virtual int isatty() { return true; } - virtual int close() { return 0; } + virtual off_t seek(off_t offset, int whence = SEEK_SET) + { + return ESPIPE; + } + virtual off_t size() + { + return -EINVAL; + } + virtual int isatty() + { + return true; + } + virtual int close() + { + return 0; + } }; -ssize_t Sink::write(const void *buffer, size_t size) { +ssize_t Sink::write(const void *buffer, size_t size) +{ // Just swallow the data - this is historical non-DEVICE_SERIAL behaviour return size; } -ssize_t Sink::read(void *buffer, size_t size) { +ssize_t Sink::read(void *buffer, size_t size) +{ // Produce 1 zero byte - historical behaviour returned 1 without touching // the buffer unsigned char *buf = static_cast(buffer); @@ -218,27 +243,27 @@ ssize_t Sink::read(void *buffer, size_t size) { } -MBED_WEAK FileHandle* mbed::mbed_target_override_console(int fd) +MBED_WEAK FileHandle *mbed::mbed_target_override_console(int fd) { return NULL; } -MBED_WEAK FileHandle* mbed::mbed_override_console(int fd) +MBED_WEAK FileHandle *mbed::mbed_override_console(int fd) { return NULL; } -static FileHandle* default_console() +static FileHandle *default_console() { #if DEVICE_SERIAL # if MBED_CONF_PLATFORM_STDIO_BUFFERED_SERIAL static UARTSerial console(STDIO_UART_TX, STDIO_UART_RX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE); # if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS - console.set_flow_control(SerialBase::RTS, STDIO_UART_RTS, NC); + console.set_flow_control(SerialBase::RTS, STDIO_UART_RTS, NC); # elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_CTS - console.set_flow_control(SerialBase::CTS, NC, STDIO_UART_CTS); + console.set_flow_control(SerialBase::CTS, NC, STDIO_UART_CTS); # elif CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTSCTS - console.set_flow_control(SerialBase::RTSCTS, STDIO_UART_RTS, STDIO_UART_CTS); + console.set_flow_control(SerialBase::RTSCTS, STDIO_UART_RTS, STDIO_UART_CTS); # endif # else static DirectSerial console(STDIO_UART_TX, STDIO_UART_RX, MBED_CONF_PLATFORM_STDIO_BAUD_RATE); @@ -250,7 +275,8 @@ static FileHandle* default_console() } /* Locate the default console for stdout, stdin, stderr */ -static FileHandle* get_console(int fd) { +static FileHandle *get_console(int fd) +{ FileHandle *fh = mbed_override_console(fd); if (fh) { return fh; @@ -263,7 +289,8 @@ static FileHandle* get_console(int fd) { } /* Deal with the fact C library may not _open descriptors 0, 1, 2 - auto bind */ -static FileHandle* get_fhc(int fd) { +static FileHandle *get_fhc(int fd) +{ if (fd >= OPEN_MAX) { return NULL; } @@ -281,27 +308,29 @@ static FileHandle* get_fhc(int fd) { * @param error is a negative error code returned from an mbed function and * will be negated to store a positive error code in errno */ -static int handle_open_errors(int error, unsigned filehandle_idx) { +static int handle_open_errors(int error, unsigned filehandle_idx) +{ errno = -error; // Free file handle filehandles[filehandle_idx] = NULL; return -1; } -static inline int openflags_to_posix(int openflags) { +static inline int openflags_to_posix(int openflags) +{ int posix = openflags; #ifdef __ARMCC_VERSION if (openflags & OPEN_PLUS) { posix = O_RDWR; - } else if(openflags & OPEN_W) { + } else if (openflags & OPEN_W) { posix = O_WRONLY; - } else if(openflags & OPEN_A) { - posix = O_WRONLY|O_APPEND; + } else if (openflags & OPEN_A) { + posix = O_WRONLY | O_APPEND; } else { posix = O_RDONLY; } /* a, w, a+, w+ all create if file does not already exist */ - if (openflags & (OPEN_A|OPEN_W)) { + if (openflags & (OPEN_A | OPEN_W)) { posix |= O_CREAT; } /* w and w+ truncate */ @@ -310,26 +339,41 @@ static inline int openflags_to_posix(int openflags) { } #elif defined(__ICCARM__) switch (openflags & _LLIO_RDWRMASK) { - case _LLIO_RDONLY: posix = O_RDONLY; break; - case _LLIO_WRONLY: posix = O_WRONLY; break; - case _LLIO_RDWR : posix = O_RDWR ; break; + case _LLIO_RDONLY: + posix = O_RDONLY; + break; + case _LLIO_WRONLY: + posix = O_WRONLY; + break; + case _LLIO_RDWR : + posix = O_RDWR ; + break; + } + if (openflags & _LLIO_CREAT) { + posix |= O_CREAT; + } + if (openflags & _LLIO_APPEND) { + posix |= O_APPEND; + } + if (openflags & _LLIO_TRUNC) { + posix |= O_TRUNC; } - if (openflags & _LLIO_CREAT ) posix |= O_CREAT; - if (openflags & _LLIO_APPEND) posix |= O_APPEND; - if (openflags & _LLIO_TRUNC ) posix |= O_TRUNC; #elif defined(TOOLCHAIN_GCC) posix &= ~O_BINARY; #endif return posix; } -static int reserve_filehandle() { +static int reserve_filehandle() +{ // find the first empty slot in filehandles, after the slots reserved for stdin/stdout/stderr filehandle_mutex->lock(); int fh_i; for (fh_i = 3; fh_i < OPEN_MAX; fh_i++) { /* Take a next free filehandle slot available. */ - if (filehandles[fh_i] == NULL) break; + if (filehandles[fh_i] == NULL) { + break; + } } if (fh_i >= OPEN_MAX) { /* Too many file handles have been opened */ @@ -343,7 +387,8 @@ static int reserve_filehandle() { return fh_i; } -int mbed::bind_to_fd(FileHandle *fh) { +int mbed::bind_to_fd(FileHandle *fh) +{ int fildes = reserve_filehandle(); if (fildes < 0) { return fildes; @@ -356,7 +401,8 @@ int mbed::bind_to_fd(FileHandle *fh) { return fildes; } -static int unbind_from_fd(int fd, FileHandle *fh) { +static int unbind_from_fd(int fd, FileHandle *fh) +{ if (filehandles[fd] == fh) { filehandles[fd] = NULL; return 0; @@ -368,7 +414,7 @@ static int unbind_from_fd(int fd, FileHandle *fh) { #ifndef __IAR_SYSTEMS_ICC__ /* IAR provides fdopen itself */ -extern "C" std::FILE* fdopen(int fildes, const char *mode) +extern "C" std::FILE *fdopen(int fildes, const char *mode) { // This is to avoid scanf and the bloat it brings. char buf[1 + sizeof fildes]; /* @(integer) */ @@ -405,18 +451,19 @@ std::FILE *fdopen(FileHandle *fh, const char *mode) } } -/* @brief standard c library fopen() retargeting function. +/* @brief standard c library fopen() retargeting function. * * This function is invoked by the standard c library retargeting to handle fopen() * * @return * On success, a valid FILEHANDLE is returned. * On failure, -1 is returned and errno is set to an appropriate value e.g. - * ENOENT file not found (default errno setting) - * EMFILE the maximum number of open files was exceeded. + * ENOENT file not found (default errno setting) + * EMFILE the maximum number of open files was exceeded. * * */ -extern "C" FILEHANDLE PREFIX(_open)(const char *name, int openflags) { +extern "C" FILEHANDLE PREFIX(_open)(const char *name, int openflags) +{ #if defined(__MICROLIB) && (__ARMCC_VERSION>5030000) #if !defined(MBED_CONF_RTOS_PRESENT) // valid only for mbed 2 @@ -463,7 +510,8 @@ extern "C" FILEHANDLE PREFIX(_open)(const char *name, int openflags) { return open(name, openflags_to_posix(openflags)); } -extern "C" int open(const char *name, int oflag, ...) { +extern "C" int open(const char *name, int oflag, ...) +{ int fildes = reserve_filehandle(); if (fildes < 0) { return fildes; @@ -499,12 +547,14 @@ extern "C" int open(const char *name, int oflag, ...) { return fildes; } -extern "C" int PREFIX(_close)(FILEHANDLE fh) { +extern "C" int PREFIX(_close)(FILEHANDLE fh) +{ return close(fh); } -extern "C" int close(int fildes) { - FileHandle* fhc = get_fhc(fildes); +extern "C" int close(int fildes) +{ + FileHandle *fhc = get_fhc(fildes); filehandles[fildes] = NULL; if (fhc == NULL) { errno = EBADF; @@ -520,7 +570,8 @@ extern "C" int close(int fildes) { } } -static bool convert_crlf(int fd) { +static bool convert_crlf(int fd) +{ #if MBED_CONF_PLATFORM_STDIO_CONVERT_TTY_NEWLINES return isatty(fd); #elif MBED_CONF_PLATFORM_STDIO_CONVERT_NEWLINES @@ -531,9 +582,11 @@ static bool convert_crlf(int fd) { } #if defined(__ICCARM__) -extern "C" size_t __write (int fh, const unsigned char *buffer, size_t length) { +extern "C" size_t __write(int fh, const unsigned char *buffer, size_t length) +{ #else -extern "C" int PREFIX(_write)(FILEHANDLE fh, const unsigned char *buffer, unsigned int length, int mode) { +extern "C" int PREFIX(_write)(FILEHANDLE fh, const unsigned char *buffer, unsigned int length, int mode) +{ #endif #if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED && defined(MBED_CONF_RTOS_PRESENT) @@ -610,9 +663,10 @@ extern "C" int PREFIX(_write)(FILEHANDLE fh, const unsigned char *buffer, unsign #endif } -extern "C" ssize_t write(int fildes, const void *buf, size_t length) { +extern "C" ssize_t write(int fildes, const void *buf, size_t length) +{ - FileHandle* fhc = get_fhc(fildes); + FileHandle *fhc = get_fhc(fildes); if (fhc == NULL) { errno = EBADF; return -1; @@ -628,20 +682,24 @@ extern "C" ssize_t write(int fildes, const void *buf, size_t length) { } #if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) -extern "C" void PREFIX(_exit)(int return_code) { - while(1) {} +extern "C" void PREFIX(_exit)(int return_code) +{ + while (1) {} } -extern "C" void _ttywrch(int ch) { +extern "C" void _ttywrch(int ch) +{ char c = ch; write(STDOUT_FILENO, &c, 1); } #endif #if defined(__ICCARM__) -extern "C" size_t __read (int fh, unsigned char *buffer, size_t length) { +extern "C" size_t __read(int fh, unsigned char *buffer, size_t length) +{ #else -extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int length, int mode) { +extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int length, int mode) +{ #endif #if defined(MBED_TRAP_ERRORS_ENABLED) && MBED_TRAP_ERRORS_ENABLED && defined(MBED_CONF_RTOS_PRESENT) @@ -668,7 +726,7 @@ extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int return bytes_read; } if ((c == '\r' && stdio_in_prev[fh] != '\n') || - (c == '\n' && stdio_in_prev[fh] != '\r')) { + (c == '\n' && stdio_in_prev[fh] != '\r')) { stdio_in_prev[fh] = c; *buffer = '\n'; break; @@ -700,9 +758,10 @@ extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int #endif } -extern "C" ssize_t read(int fildes, void *buf, size_t length) { +extern "C" ssize_t read(int fildes, void *buf, size_t length) +{ - FileHandle* fhc = get_fhc(fildes); + FileHandle *fhc = get_fhc(fildes); if (fhc == NULL) { errno = EBADF; return -1; @@ -727,8 +786,9 @@ extern "C" int _isatty(FILEHANDLE fh) return isatty(fh); } -extern "C" int isatty(int fildes) { - FileHandle* fhc = get_fhc(fildes); +extern "C" int isatty(int fildes) +{ + FileHandle *fhc = get_fhc(fildes); if (fhc == NULL) { errno = EBADF; return 0; @@ -765,8 +825,9 @@ int _lseek(FILEHANDLE fh, int offset, int whence) return off; } -extern "C" off_t lseek(int fildes, off_t offset, int whence) { - FileHandle* fhc = get_fhc(fildes); +extern "C" off_t lseek(int fildes, off_t offset, int whence) +{ + FileHandle *fhc = get_fhc(fildes); if (fhc == NULL) { errno = EBADF; return -1; @@ -781,13 +842,15 @@ extern "C" off_t lseek(int fildes, off_t offset, int whence) { } #ifdef __ARMCC_VERSION -extern "C" int PREFIX(_ensure)(FILEHANDLE fh) { +extern "C" int PREFIX(_ensure)(FILEHANDLE fh) +{ return fsync(fh); } #endif -extern "C" int fsync(int fildes) { - FileHandle* fhc = get_fhc(fildes); +extern "C" int fsync(int fildes) +{ + FileHandle *fhc = get_fhc(fildes); if (fhc == NULL) { errno = EBADF; return -1; @@ -803,8 +866,9 @@ extern "C" int fsync(int fildes) { } #ifdef __ARMCC_VERSION -extern "C" long PREFIX(_flen)(FILEHANDLE fh) { - FileHandle* fhc = get_fhc(fh); +extern "C" long PREFIX(_flen)(FILEHANDLE fh) +{ + FileHandle *fhc = get_fhc(fh); if (fhc == NULL) { errno = EBADF; return -1; @@ -837,7 +901,8 @@ extern "C" MBED_WEAK __value_in_regs struct __initial_stackheap _mbed_user_setup return r; } -extern "C" __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) { +extern "C" __value_in_regs struct __initial_stackheap __user_setup_stackheap(uint32_t R0, uint32_t R1, uint32_t R2, uint32_t R3) +{ return _mbed_user_setup_stackheap(R0, R1, R2, R3); } @@ -845,13 +910,15 @@ extern "C" __value_in_regs struct __initial_stackheap __user_setup_stackheap(uin #if !defined(__ARMCC_VERSION) && !defined(__ICCARM__) -extern "C" int _fstat(int fh, struct stat *st) { +extern "C" int _fstat(int fh, struct stat *st) +{ return fstat(fh, st); } #endif -extern "C" int fstat(int fildes, struct stat *st) { - FileHandle* fhc = get_fhc(fildes); +extern "C" int fstat(int fildes, struct stat *st) +{ + FileHandle *fhc = get_fhc(fildes); if (fhc == NULL) { errno = EBADF; return -1; @@ -862,7 +929,8 @@ extern "C" int fstat(int fildes, struct stat *st) { return 0; } -extern "C" int fcntl(int fildes, int cmd, ...) { +extern "C" int fcntl(int fildes, int cmd, ...) +{ FileHandle *fhc = get_fhc(fildes); if (fhc == NULL) { errno = EBADF; @@ -919,7 +987,8 @@ extern "C" int poll(struct pollfd fds[], nfds_t nfds, int timeout) } namespace std { -extern "C" int remove(const char *path) { +extern "C" int remove(const char *path) +{ FilePath fp(path); FileSystemHandle *fs = fp.fileSystem(); if (fs == NULL) { @@ -936,7 +1005,8 @@ extern "C" int remove(const char *path) { } } -extern "C" int rename(const char *oldname, const char *newname) { +extern "C" int rename(const char *oldname, const char *newname) +{ FilePath fpOld(oldname); FilePath fpNew(newname); FileSystemHandle *fsOld = fpOld.fileSystem(); @@ -962,26 +1032,30 @@ extern "C" int rename(const char *oldname, const char *newname) { } } -extern "C" char *tmpnam(char *s) { +extern "C" char *tmpnam(char *s) +{ errno = EBADF; return NULL; } -extern "C" FILE *tmpfile() { +extern "C" FILE *tmpfile() +{ errno = EBADF; return NULL; } } // namespace std #ifdef __ARMCC_VERSION -extern "C" char *_sys_command_string(char *cmd, int len) { +extern "C" char *_sys_command_string(char *cmd, int len) +{ return NULL; } #endif -extern "C" DIR *opendir(const char *path) { +extern "C" DIR *opendir(const char *path) +{ FilePath fp(path); - FileSystemHandle* fs = fp.fileSystem(); + FileSystemHandle *fs = fp.fileSystem(); if (fs == NULL) { errno = ENODEV; return NULL; @@ -997,7 +1071,8 @@ extern "C" DIR *opendir(const char *path) { return dir; } -extern "C" struct dirent *readdir(DIR *dir) { +extern "C" struct dirent *readdir(DIR *dir) +{ static struct dirent ent; int err = dir->read(&ent); if (err < 1) { @@ -1010,7 +1085,8 @@ extern "C" struct dirent *readdir(DIR *dir) { return &ent; } -extern "C" int closedir(DIR *dir) { +extern "C" int closedir(DIR *dir) +{ int err = dir->close(); if (err < 0) { errno = -err; @@ -1020,19 +1096,23 @@ extern "C" int closedir(DIR *dir) { } } -extern "C" void rewinddir(DIR *dir) { +extern "C" void rewinddir(DIR *dir) +{ dir->rewind(); } -extern "C" off_t telldir(DIR *dir) { +extern "C" off_t telldir(DIR *dir) +{ return dir->tell(); } -extern "C" void seekdir(DIR *dir, off_t off) { +extern "C" void seekdir(DIR *dir, off_t off) +{ dir->seek(off); } -extern "C" int mkdir(const char *path, mode_t mode) { +extern "C" int mkdir(const char *path, mode_t mode) +{ FilePath fp(path); FileSystemHandle *fs = fp.fileSystem(); if (fs == NULL) { @@ -1049,7 +1129,8 @@ extern "C" int mkdir(const char *path, mode_t mode) { } } -extern "C" int stat(const char *path, struct stat *st) { +extern "C" int stat(const char *path, struct stat *st) +{ FilePath fp(path); FileSystemHandle *fs = fp.fileSystem(); if (fs == NULL) { @@ -1066,7 +1147,8 @@ extern "C" int stat(const char *path, struct stat *st) { } } -extern "C" int statvfs(const char *path, struct statvfs *buf) { +extern "C" int statvfs(const char *path, struct statvfs *buf) +{ FilePath fp(path); FileSystemHandle *fs = fp.fileSystem(); if (fs == NULL) { @@ -1087,12 +1169,14 @@ extern "C" int statvfs(const char *path, struct statvfs *buf) { /* prevents the exception handling name demangling code getting pulled in */ #include "mbed_error.h" namespace __gnu_cxx { - void __verbose_terminate_handler() { - MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_CLIB_EXCEPTION),"Exception", 0); - } +void __verbose_terminate_handler() +{ + MBED_ERROR1(MBED_MAKE_ERROR(MBED_MODULE_PLATFORM, MBED_ERROR_CODE_CLIB_EXCEPTION), "Exception", 0); +} } extern "C" WEAK void __cxa_pure_virtual(void); -extern "C" WEAK void __cxa_pure_virtual(void) { +extern "C" WEAK void __cxa_pure_virtual(void) +{ exit(1); } @@ -1120,31 +1204,33 @@ extern "C" int errno; // TARGET_NUMAKER_PFM_M453 targets/TARGET_NUVOTON/TARGET_M451/TARGET_NUMAKER_PFM_M453/TOOLCHAIN_GCC_ARM/m451_retarget.c // TARGET_STM32L4 targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L4/l4_retarget.c extern "C" void *__wrap__sbrk(int incr); -extern "C" caddr_t _sbrk(int incr) { +extern "C" caddr_t _sbrk(int incr) +{ return (caddr_t) __wrap__sbrk(incr); } #else // Linker defined symbol used by _sbrk to indicate where heap should start. extern "C" uint32_t __end__; // Weak attribute allows user to override, e.g. to use external RAM for dynamic memory. -extern "C" WEAK caddr_t _sbrk(int incr) { - static unsigned char* heap = (unsigned char*)&__end__; - unsigned char* prev_heap = heap; - unsigned char* new_heap = heap + incr; +extern "C" WEAK caddr_t _sbrk(int incr) +{ + static unsigned char *heap = (unsigned char *)&__end__; + unsigned char *prev_heap = heap; + unsigned char *new_heap = heap + incr; #if defined(TARGET_CORTEX_A) - if (new_heap >= (unsigned char*)&__HeapLimit) { /* __HeapLimit is end of heap section */ + if (new_heap >= (unsigned char *)&__HeapLimit) { /* __HeapLimit is end of heap section */ #else - if (new_heap >= (unsigned char*)__get_MSP()) { + if (new_heap >= (unsigned char *)__get_MSP()) { #endif errno = ENOMEM; - return (caddr_t)-1; + 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; + return (caddr_t) -1; } heap = new_heap; @@ -1154,10 +1240,12 @@ extern "C" WEAK caddr_t _sbrk(int incr) { #endif #if defined(TOOLCHAIN_GCC_ARM) || defined(TOOLCHAIN_GCC_CR) -extern "C" void _exit(int return_code) { +extern "C" void _exit(int return_code) +{ #else namespace std { -extern "C" void exit(int return_code) { +extern "C" void exit(int return_code) +{ #endif #if DEVICE_STDIO_MESSAGES @@ -1191,16 +1279,19 @@ extern "C" void exit(int return_code) { // More informations about this topic for ARMCC here: // http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/6449.html extern "C" { -int __aeabi_atexit(void *object, void (*dtor)(void* /*this*/), void *handle) { - return 1; -} + int __aeabi_atexit(void *object, void (*dtor)(void * /*this*/), void *handle) + { + return 1; + } -int __cxa_atexit(void (*dtor)(void* /*this*/), void *object, void *handle) { - return 1; -} + int __cxa_atexit(void (*dtor)(void * /*this*/), void *object, void *handle) + { + return 1; + } -void __cxa_finalize(void *handle) { -} + void __cxa_finalize(void *handle) + { + } } // end of extern "C" @@ -1216,25 +1307,27 @@ void __cxa_finalize(void *handle) { * * To overcome this limitation, exit and atexit are overriden here. */ -extern "C"{ +extern "C" { -/** - * @brief Retarget of exit for GCC. - * @details Unlike the standard version, this function doesn't call any function - * registered with atexit before calling _exit. - */ -void __wrap_exit(int return_code) { - _exit(return_code); -} + /** + * @brief Retarget of exit for GCC. + * @details Unlike the standard version, this function doesn't call any function + * registered with atexit before calling _exit. + */ + void __wrap_exit(int return_code) + { + _exit(return_code); + } -/** - * @brief Retarget atexit from GCC. - * @details This function will always fail and never register any handler to be - * called at exit. - */ -int __wrap_atexit(void (*func)()) { - return 1; -} + /** + * @brief Retarget atexit from GCC. + * @details This function will always fail and never register any handler to be + * called at exit. + */ + int __wrap_atexit(void (*func)()) + { + return 1; + } } @@ -1244,20 +1337,22 @@ int __wrap_atexit(void (*func)()) { namespace mbed { -void mbed_set_unbuffered_stream(std::FILE *_file) { +void mbed_set_unbuffered_stream(std::FILE *_file) +{ #if defined (__ICCARM__) char buf[2]; - std::setvbuf(_file,buf,_IONBF,NULL); + std::setvbuf(_file, buf, _IONBF, NULL); #else setbuf(_file, NULL); #endif } -int mbed_getc(std::FILE *_file){ +int mbed_getc(std::FILE *_file) +{ #if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ < 8000000) /*This is only valid for unbuffered streams*/ int res = std::fgetc(_file); - if (res>=0){ + if (res >= 0) { _file->_Mode = (unsigned short)(_file->_Mode & ~ 0x1000);/* Unset read mode */ _file->_Rend = _file->_Wend; _file->_Next = _file->_Wend; @@ -1268,18 +1363,19 @@ int mbed_getc(std::FILE *_file){ #endif } -char* mbed_gets(char*s, int size, std::FILE *_file){ +char *mbed_gets(char *s, int size, std::FILE *_file) +{ #if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ < 8000000) /*This is only valid for unbuffered streams*/ - char *str = fgets(s,size,_file); - if (str!=NULL){ + char *str = fgets(s, size, _file); + if (str != NULL) { _file->_Mode = (unsigned short)(_file->_Mode & ~ 0x1000);/* Unset read mode */ _file->_Rend = _file->_Wend; _file->_Next = _file->_Wend; } return str; #else - return std::fgets(s,size,_file); + return std::fgets(s, size, _file); #endif } @@ -1297,9 +1393,10 @@ extern "C" WEAK void __iar_file_Mtxlock(__iar_Rmtx *mutex) {} extern "C" WEAK void __iar_file_Mtxunlock(__iar_Rmtx *mutex) {} #if defined(__IAR_SYSTEMS_ICC__ ) && (__VER__ >= 8000000) #pragma section="__iar_tls$$DATA" -extern "C" WEAK void *__aeabi_read_tp (void) { - // Thread Local storage is not supported, using main thread memory for errno - return __section_begin("__iar_tls$$DATA"); +extern "C" WEAK void *__aeabi_read_tp(void) +{ + // Thread Local storage is not supported, using main thread memory for errno + return __section_begin("__iar_tls$$DATA"); } #endif #elif defined(__CC_ARM) @@ -1307,27 +1404,27 @@ extern "C" WEAK void *__aeabi_read_tp (void) { #elif defined (__GNUC__) struct _reent; // Stub out locks when an rtos is not present -extern "C" WEAK void __rtos_malloc_lock( struct _reent *_r ) {} -extern "C" WEAK void __rtos_malloc_unlock( struct _reent *_r ) {} -extern "C" WEAK void __rtos_env_lock( struct _reent *_r ) {} -extern "C" WEAK void __rtos_env_unlock( struct _reent *_r ) {} +extern "C" WEAK void __rtos_malloc_lock(struct _reent *_r) {} +extern "C" WEAK void __rtos_malloc_unlock(struct _reent *_r) {} +extern "C" WEAK void __rtos_env_lock(struct _reent *_r) {} +extern "C" WEAK void __rtos_env_unlock(struct _reent *_r) {} -extern "C" void __malloc_lock( struct _reent *_r ) +extern "C" void __malloc_lock(struct _reent *_r) { __rtos_malloc_lock(_r); } -extern "C" void __malloc_unlock( struct _reent *_r ) +extern "C" void __malloc_unlock(struct _reent *_r) { __rtos_malloc_unlock(_r); } -extern "C" void __env_lock( struct _reent *_r ) +extern "C" void __env_lock(struct _reent *_r) { __rtos_env_lock(_r); } -extern "C" void __env_unlock( struct _reent *_r ) +extern "C" void __env_unlock(struct _reent *_r) { __rtos_env_unlock(_r); } @@ -1380,10 +1477,10 @@ extern "C" void __cxa_guard_abort(int *guard_object_p) // provide the implementation for these. Note: this needs to use the wrappers // instead of malloc()/free() as the caller address would point to wrappers, // not the caller of "new" or "delete". -extern "C" void* malloc_wrapper(size_t size, const void* caller); -extern "C" void free_wrapper(void *ptr, const void* caller); - -void *operator new(std::size_t count) +extern "C" void *malloc_wrapper(size_t size, const void *caller); +extern "C" void free_wrapper(void *ptr, const void *caller); + +void *operator new (std::size_t count) { void *buffer = malloc_wrapper(count, MBED_CALLER_ADDR()); if (NULL == buffer) { @@ -1401,17 +1498,17 @@ void *operator new[](std::size_t count) return buffer; } -void *operator new(std::size_t count, const std::nothrow_t& tag) +void *operator new (std::size_t count, const std::nothrow_t &tag) { return malloc_wrapper(count, MBED_CALLER_ADDR()); } -void *operator new[](std::size_t count, const std::nothrow_t& tag) +void *operator new[](std::size_t count, const std::nothrow_t &tag) { return malloc_wrapper(count, MBED_CALLER_ADDR()); } -void operator delete(void *ptr) +void operator delete (void *ptr) { free_wrapper(ptr, MBED_CALLER_ADDR()); } @@ -1424,10 +1521,10 @@ void operator delete[](void *ptr) #include -extern "C" void* malloc_wrapper(struct _reent * r, size_t size, void * caller); -extern "C" void free_wrapper(struct _reent * r, void * ptr, void * caller); +extern "C" void *malloc_wrapper(struct _reent *r, size_t size, void *caller); +extern "C" void free_wrapper(struct _reent *r, void *ptr, void *caller); -void *operator new(std::size_t count) +void *operator new (std::size_t count) { void *buffer = malloc_wrapper(_REENT, count, MBED_CALLER_ADDR()); if (NULL == buffer) { @@ -1445,17 +1542,17 @@ void *operator new[](std::size_t count) return buffer; } -void *operator new(std::size_t count, const std::nothrow_t& tag) +void *operator new (std::size_t count, const std::nothrow_t &tag) { return malloc_wrapper(_REENT, count, MBED_CALLER_ADDR()); } -void *operator new[](std::size_t count, const std::nothrow_t& tag) +void *operator new[](std::size_t count, const std::nothrow_t &tag) { return malloc_wrapper(_REENT, count, MBED_CALLER_ADDR()); } -void operator delete(void *ptr) +void operator delete (void *ptr) { free_wrapper(_REENT, ptr, MBED_CALLER_ADDR()); } @@ -1467,7 +1564,7 @@ void operator delete[](void *ptr) #else -void *operator new(std::size_t count) +void *operator new (std::size_t count) { void *buffer = malloc(count); if (NULL == buffer) { @@ -1485,17 +1582,17 @@ void *operator new[](std::size_t count) return buffer; } -void *operator new(std::size_t count, const std::nothrow_t& tag) +void *operator new (std::size_t count, const std::nothrow_t &tag) { return malloc(count); } -void *operator new[](std::size_t count, const std::nothrow_t& tag) +void *operator new[](std::size_t count, const std::nothrow_t &tag) { return malloc(count); } -void operator delete(void *ptr) +void operator delete (void *ptr) { free(ptr); } @@ -1526,7 +1623,7 @@ extern "C" clock_t clock() } // temporary - Default to 1MHz at 32 bits if target does not have us_ticker_get_info -MBED_WEAK const ticker_info_t* us_ticker_get_info() +MBED_WEAK const ticker_info_t *us_ticker_get_info() { static const ticker_info_t info = { 1000000, @@ -1536,7 +1633,7 @@ MBED_WEAK const ticker_info_t* us_ticker_get_info() } // temporary - Default to 1MHz at 32 bits if target does not have lp_ticker_get_info -MBED_WEAK const ticker_info_t* lp_ticker_get_info() +MBED_WEAK const ticker_info_t *lp_ticker_get_info() { static const ticker_info_t info = { 1000000, diff --git a/platform/mbed_retarget.h b/platform/mbed_retarget.h index 31d9347b9ec..d61f3c8c653 100644 --- a/platform/mbed_retarget.h +++ b/platform/mbed_retarget.h @@ -108,7 +108,7 @@ class DirHandle; * @param fd file descriptor - STDIN_FILENO, STDOUT_FILENO or STDERR_FILENO * @return pointer to FileHandle to override normal stream otherwise NULL */ -FileHandle* mbed_target_override_console(int fd); +FileHandle *mbed_target_override_console(int fd); /** Applications may implement this to change stdin, stdout, stderr. * @@ -130,7 +130,7 @@ FileHandle* mbed_target_override_console(int fd); * @param fd file descriptor - STDIN_FILENO, STDOUT_FILENO or STDERR_FILENO * @return pointer to FileHandle to override normal stream otherwise NULL */ -FileHandle* mbed_override_console(int fd); +FileHandle *mbed_override_console(int fd); } @@ -483,7 +483,7 @@ struct statvfs { * consistency where structure may be different with different toolchains */ struct dirent { - char d_name[NAME_MAX+1]; ///< Name of file + char d_name[NAME_MAX + 1]; ///< Name of file uint8_t d_type; ///< Type of file }; @@ -515,9 +515,9 @@ extern "C" { int open(const char *path, int oflag, ...); #ifndef __IAR_SYSTEMS_ICC__ /* IAR provides fdopen itself */ #if __cplusplus - std::FILE* fdopen(int fildes, const char *mode); + std::FILE *fdopen(int fildes, const char *mode); #else - FILE* fdopen(int fildes, const char *mode); + FILE *fdopen(int fildes, const char *mode); #endif #endif ssize_t write(int fildes, const void *buf, size_t nbyte); @@ -531,12 +531,12 @@ extern "C" { int close(int fildes); int stat(const char *path, struct stat *st); int statvfs(const char *path, struct statvfs *buf); - DIR *opendir(const char*); + DIR *opendir(const char *); struct dirent *readdir(DIR *); - int closedir(DIR*); - void rewinddir(DIR*); - long telldir(DIR*); - void seekdir(DIR*, long); + int closedir(DIR *); + void rewinddir(DIR *); + long telldir(DIR *); + void seekdir(DIR *, long); int mkdir(const char *name, mode_t n); #if __cplusplus }; // extern "C" @@ -556,7 +556,7 @@ namespace mbed { * * @returns a pointer to FILE */ -std::FILE* fdopen(mbed::FileHandle *fh, const char *mode); +std::FILE *fdopen(mbed::FileHandle *fh, const char *mode); /** Bind an mbed FileHandle to a POSIX file descriptor * diff --git a/platform/mbed_rtc_time.cpp b/platform/mbed_rtc_time.cpp index f259513c59a..0646a46a0a1 100644 --- a/platform/mbed_rtc_time.cpp +++ b/platform/mbed_rtc_time.cpp @@ -87,8 +87,8 @@ time_t time(time_t *timer) set_time(0); } } - - time_t t = (time_t)-1; + + time_t t = (time_t) -1; if (_rtc_read != NULL) { t = _rtc_read(); } @@ -100,7 +100,8 @@ time_t time(time_t *timer) return t; } -void set_time(time_t t) { +void set_time(time_t t) +{ _mutex->lock(); if (_rtc_init != NULL) { _rtc_init(); @@ -111,7 +112,8 @@ void set_time(time_t t) { _mutex->unlock(); } -void attach_rtc(time_t (*read_rtc)(void), void (*write_rtc)(time_t), void (*init_rtc)(void), int (*isenabled_rtc)(void)) { +void attach_rtc(time_t (*read_rtc)(void), void (*write_rtc)(time_t), void (*init_rtc)(void), int (*isenabled_rtc)(void)) +{ _mutex->lock(); _rtc_read = read_rtc; _rtc_write = write_rtc; diff --git a/platform/mbed_sdk_boot.c b/platform/mbed_sdk_boot.c index 4799e2c5315..32658ef60c4 100644 --- a/platform/mbed_sdk_boot.c +++ b/platform/mbed_sdk_boot.c @@ -30,14 +30,14 @@ * mbed_main(), it is not meant for user code, but for the SDK itself to perform * initializations before main() is called. */ -MBED_WEAK void mbed_main(void) +MBED_WEAK void mbed_main(void) { } /* This function can be implemented by the target to perform higher level target initialization */ -MBED_WEAK void mbed_sdk_init(void) +MBED_WEAK void mbed_sdk_init(void) { } @@ -56,7 +56,7 @@ void mbed_copy_nvic(void) #if !defined(__CORTEX_M0) && !defined(__CORTEX_A9) #ifdef NVIC_RAM_VECTOR_ADDRESS uint32_t *old_vectors = (uint32_t *)SCB->VTOR; - uint32_t *vectors = (uint32_t*)NVIC_RAM_VECTOR_ADDRESS; + uint32_t *vectors = (uint32_t *)NVIC_RAM_VECTOR_ADDRESS; for (int i = 0; i < NVIC_NUM_VECTORS; i++) { vectors[i] = old_vectors[i]; } @@ -71,19 +71,19 @@ void mbed_copy_nvic(void) int $Super$$main(void); -int $Sub$$main(void) +int $Sub$$main(void) { mbed_main(); return $Super$$main(); } -void _platform_post_stackheap_init(void) +void _platform_post_stackheap_init(void) { mbed_copy_nvic(); mbed_sdk_init(); } -#elif defined (__GNUC__) +#elif defined (__GNUC__) extern int __real_main(void); @@ -95,7 +95,7 @@ void software_init_hook(void) } -int __wrap_main(void) +int __wrap_main(void) { mbed_main(); return __real_main(); @@ -105,8 +105,8 @@ int __wrap_main(void) int __low_level_init(void) { - mbed_copy_nvic(); - return 1; + mbed_copy_nvic(); + return 1; } #endif diff --git a/platform/mbed_semihost_api.c b/platform/mbed_semihost_api.c index 06c6777ab8d..f655862c3a0 100644 --- a/platform/mbed_semihost_api.c +++ b/platform/mbed_semihost_api.c @@ -44,7 +44,8 @@ #define USR_DISABLEDEBUG (RESERVED_FOR_USER_APPLICATIONS + 5) #if DEVICE_LOCALFILESYSTEM -FILEHANDLE semihost_open(const char* name, int openmode) { +FILEHANDLE semihost_open(const char *name, int openmode) +{ uint32_t args[3]; args[0] = (uint32_t)name; args[1] = (uint32_t)openmode; @@ -52,12 +53,16 @@ FILEHANDLE semihost_open(const char* name, int openmode) { return __semihost(SYS_OPEN, args); } -int semihost_close(FILEHANDLE fh) { +int semihost_close(FILEHANDLE fh) +{ return __semihost(SYS_CLOSE, &fh); } -int semihost_write(FILEHANDLE fh, const unsigned char* buffer, unsigned int length, int mode) { - if (length == 0) return 0; +int semihost_write(FILEHANDLE fh, const unsigned char *buffer, unsigned int length, int mode) +{ + if (length == 0) { + return 0; + } uint32_t args[3]; args[0] = (uint32_t)fh; @@ -66,7 +71,8 @@ int semihost_write(FILEHANDLE fh, const unsigned char* buffer, unsigned int leng return __semihost(SYS_WRITE, args); } -int semihost_read(FILEHANDLE fh, unsigned char* buffer, unsigned int length, int mode) { +int semihost_read(FILEHANDLE fh, unsigned char *buffer, unsigned int length, int mode) +{ uint32_t args[3]; args[0] = (uint32_t)fh; args[1] = (uint32_t)buffer; @@ -74,33 +80,39 @@ int semihost_read(FILEHANDLE fh, unsigned char* buffer, unsigned int length, int return __semihost(SYS_READ, args); } -int semihost_istty(FILEHANDLE fh) { +int semihost_istty(FILEHANDLE fh) +{ return __semihost(SYS_ISTTY, &fh); } -int semihost_seek(FILEHANDLE fh, long position) { +int semihost_seek(FILEHANDLE fh, long position) +{ uint32_t args[2]; args[0] = (uint32_t)fh; args[1] = (uint32_t)position; return __semihost(SYS_SEEK, args); } -int semihost_ensure(FILEHANDLE fh) { +int semihost_ensure(FILEHANDLE fh) +{ return __semihost(SYS_ENSURE, &fh); } -long semihost_flen(FILEHANDLE fh) { +long semihost_flen(FILEHANDLE fh) +{ return __semihost(SYS_FLEN, &fh); } -int semihost_remove(const char *name) { +int semihost_remove(const char *name) +{ uint32_t args[2]; args[0] = (uint32_t)name; args[1] = (uint32_t)strlen(name); return __semihost(SYS_REMOVE, args); } -int semihost_rename(const char *old_name, const char *new_name) { +int semihost_rename(const char *old_name, const char *new_name) +{ uint32_t args[4]; args[0] = (uint32_t)old_name; args[1] = (uint32_t)strlen(old_name); @@ -110,35 +122,41 @@ int semihost_rename(const char *old_name, const char *new_name) { } #endif -int semihost_exit(void) { +int semihost_exit(void) +{ uint32_t args[4]; return __semihost(SYS_EXIT, args); } -int semihost_uid(char *uid) { +int semihost_uid(char *uid) +{ uint32_t args[2]; args[0] = (uint32_t)uid; args[1] = DEVICE_ID_LENGTH + 1; return __semihost(USR_UID, &args); } -int semihost_reset(void) { +int semihost_reset(void) +{ // Does not normally return, however if used with older firmware versions // that do not support this call it will return -1. return __semihost(USR_RESET, NULL); } -int semihost_vbus(void) { +int semihost_vbus(void) +{ return __semihost(USR_VBUS, NULL); } -int semihost_powerdown(void) { +int semihost_powerdown(void) +{ return __semihost(USR_POWERDOWN, NULL); } #if DEVICE_DEBUG_AWARENESS -int semihost_connected(void) { +int semihost_connected(void) +{ return (CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) ? 1 : 0; } @@ -146,12 +164,14 @@ int semihost_connected(void) { // These processors cannot know if the interface is connect, assume so: static int is_debugger_attached = 1; -int semihost_connected(void) { +int semihost_connected(void) +{ return is_debugger_attached; } #endif -int semihost_disabledebug(void) { +int semihost_disabledebug(void) +{ uint32_t args[1]; #if !(DEVICE_DEBUG_AWARENESS) is_debugger_attached = 0; diff --git a/platform/mbed_semihost_api.h b/platform/mbed_semihost_api.h index 611cce69c07..2f20c8cbb24 100644 --- a/platform/mbed_semihost_api.h +++ b/platform/mbed_semihost_api.h @@ -29,8 +29,9 @@ extern "C" { #if !defined(__CC_ARM) && !defined(__ARMCC_VERSION) #if defined(__ICCARM__) -static inline int __semihost(int reason, const void *arg) { - return __semihosting(reason, (void*)arg); +static inline int __semihost(int reason, const void *arg) +{ + return __semihosting(reason, (void *)arg); } #else @@ -44,17 +45,18 @@ static inline int __semihost(int reason, const void *arg) { # define AngelSWIAsm swi #endif -static inline int __semihost(int reason, const void *arg) { +static inline int __semihost(int reason, const void *arg) +{ int value; - asm volatile ( - "mov r0, %1" "\n\t" - "mov r1, %2" "\n\t" - AngelSWIInsn " %a3" "\n\t" - "mov %0, r0" - : "=r" (value) /* output operands */ - : "r" (reason), "r" (arg), "i" (AngelSWI) /* input operands */ - : "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc" /* list of clobbered registers */ + asm volatile( + "mov r0, %1" "\n\t" + "mov r1, %2" "\n\t" + AngelSWIInsn " %a3" "\n\t" + "mov %0, r0" + : "=r"(value) /* output operands */ + : "r"(reason), "r"(arg), "i"(AngelSWI) /* input operands */ + : "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc" /* list of clobbered registers */ ); return value; @@ -63,14 +65,14 @@ static inline int __semihost(int reason, const void *arg) { #endif #if DEVICE_LOCALFILESYSTEM -FILEHANDLE semihost_open(const char* name, int openmode); -int semihost_close (FILEHANDLE fh); -int semihost_read (FILEHANDLE fh, unsigned char* buffer, unsigned int length, int mode); -int semihost_write (FILEHANDLE fh, const unsigned char* buffer, unsigned int length, int mode); +FILEHANDLE semihost_open(const char *name, int openmode); +int semihost_close(FILEHANDLE fh); +int semihost_read(FILEHANDLE fh, unsigned char *buffer, unsigned int length, int mode); +int semihost_write(FILEHANDLE fh, const unsigned char *buffer, unsigned int length, int mode); int semihost_ensure(FILEHANDLE fh); -long semihost_flen (FILEHANDLE fh); -int semihost_seek (FILEHANDLE fh, long position); -int semihost_istty (FILEHANDLE fh); +long semihost_flen(FILEHANDLE fh); +int semihost_seek(FILEHANDLE fh, long position); +int semihost_istty(FILEHANDLE fh); int semihost_remove(const char *name); int semihost_rename(const char *old_name, const char *new_name); diff --git a/platform/mbed_stats.c b/platform/mbed_stats.c index 6886ed30d20..11d870b7d10 100644 --- a/platform/mbed_stats.c +++ b/platform/mbed_stats.c @@ -1,6 +1,7 @@ #include "mbed_assert.h" #include "mbed_stats.h" #include "mbed_power_mgmt.h" +#include "mbed_version.h" #include #include @@ -123,6 +124,7 @@ void mbed_stats_sys_get(mbed_stats_sys_t *stats) memset(stats, 0, sizeof(mbed_stats_sys_t)); #if defined(MBED_SYS_STATS_ENABLED) + stats->os_version = MBED_VERSION; #if defined(__CORTEX_M) stats->cpu_id = SCB->CPUID; #endif diff --git a/platform/mbed_stats.h b/platform/mbed_stats.h index 5eaef3cadc8..4532041379c 100644 --- a/platform/mbed_stats.h +++ b/platform/mbed_stats.h @@ -6,7 +6,7 @@ * @{ */ /* mbed Microcontroller Library - * Copyright (c) 2016-2016 ARM Limited + * Copyright (c) 2016-2018 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/platform/mbed_toolchain.h b/platform/mbed_toolchain.h index c26ad9fda72..d5864295dac 100644 --- a/platform/mbed_toolchain.h +++ b/platform/mbed_toolchain.h @@ -396,7 +396,7 @@ #endif #ifndef FILEHANDLE - typedef int FILEHANDLE; +typedef int FILEHANDLE; #endif // Backwards compatibility diff --git a/platform/mbed_version.h b/platform/mbed_version.h new file mode 100644 index 00000000000..24cc608b7d1 --- /dev/null +++ b/platform/mbed_version.h @@ -0,0 +1,71 @@ + +/** \addtogroup platform */ +/** @{*/ +/** + * \defgroup platform_version Version macros + * @{ + */ +/* mbed Microcontroller Library + * Copyright (c) 2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef MBED_VERSION_H +#define MBED_VERSION_H + +/** MBED_MAJOR_VERSION + * Mbed OS major version + * + * @note 99 is default value for development version (master branch) + */ +#define MBED_MAJOR_VERSION 5 + +/** MBED_MINOR_VERSION + * Mbed OS minor version + * + * @note 99 is default value for development version (master branch) + */ +#define MBED_MINOR_VERSION 9 + +/** MBED_PATCH_VERSION + * Mbed OS patch version + * + * @note 99 is default value for development version (master branch) + */ +#define MBED_PATCH_VERSION 3 + +#define MBED_ENCODE_VERSION(major, minor, patch) ((major)*10000 + (minor)*100 + (patch)) + +/** MBED_VERSION + * Mbed OS 5 version (MMmmpp - M(Major); m(minor); p(patch)) + * + * @note 999999 is default value for development version (master branch) + */ +#define MBED_VERSION MBED_ENCODE_VERSION(MBED_MAJOR_VERSION, MBED_MINOR_VERSION, MBED_PATCH_VERSION) + +/** MBED_VERSION_CHECK + * Macro can be used to check minimum Mbed OS version required for feature/library. If current version + * is less than required, it will assert. + * + * @note: Version of master branch will be 999999 as default, hence no assert/warning is provided for + * master branch code + */ +#define MBED_VERSION_CHECK(major, minor, patch) do { \ + MBED_STATIC_ASSERT((MBED_VERSION >= MBED_ENCODE_VERSION((major),(minor),(patch))), "Incompatible mbed-os version detected!!"); \ + } while(0) + +#endif + +/** @}*/ +/** @}*/ diff --git a/platform/mbed_wait_api.h b/platform/mbed_wait_api.h index 10948c84ef5..3a458ac1551 100644 --- a/platform/mbed_wait_api.h +++ b/platform/mbed_wait_api.h @@ -5,7 +5,7 @@ * \defgroup platform_wait_api wait_api functions * @{ */ - + /* mbed Microcontroller Library * Copyright (c) 2006-2013 ARM Limited * @@ -53,10 +53,10 @@ extern "C" { * the accuracy of single precision floating point). * * @param s number of seconds to wait - * + * * @note - * If the RTOS is present, this function always spins to get the exact number of microseconds, - * which potentially affects power (such as preventing deep sleep) and multithread performance. + * If the RTOS is present, 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(). */ void wait(float s); @@ -64,10 +64,10 @@ void wait(float s); /** Waits a number of milliseconds. * * @param ms the whole number of milliseconds to wait - * + * * @note - * If the RTOS is present, this function always spins to get the exact number of microseconds, - * which potentially affects power (such as preventing deep sleep) and multithread performance. + * If the RTOS is present, 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(). */ void wait_ms(int ms); @@ -75,9 +75,9 @@ void wait_ms(int ms); /** Waits a number of microseconds. * * @param us the whole number of microseconds to wait - * + * * @note - * If the RTOS is present, this function always spins to get the exact number of microseconds, + * If the RTOS is present, this function always spins to get the exact number of microseconds, * which potentially affects power (such as preventing deep sleep) and multithread performance. */ void wait_us(int us); diff --git a/platform/mbed_wait_api_no_rtos.c b/platform/mbed_wait_api_no_rtos.c index a78dd8bc799..c29ba17217d 100644 --- a/platform/mbed_wait_api_no_rtos.c +++ b/platform/mbed_wait_api_no_rtos.c @@ -21,15 +21,18 @@ #include "platform/mbed_wait_api.h" #include "hal/us_ticker_api.h" -void wait(float s) { +void wait(float s) +{ wait_us(s * 1000000.0f); } -void wait_ms(int ms) { +void wait_ms(int ms) +{ wait_us(ms * 1000); } -void wait_us(int us) { +void wait_us(int us) +{ const ticker_data_t *const ticker = get_us_ticker_data(); uint32_t start = ticker_read(ticker); while ((ticker_read(ticker) - start) < (uint32_t)us); diff --git a/platform/mbed_wait_api_rtos.cpp b/platform/mbed_wait_api_rtos.cpp index 3c082f2fe69..b5359378400 100644 --- a/platform/mbed_wait_api_rtos.cpp +++ b/platform/mbed_wait_api_rtos.cpp @@ -24,15 +24,18 @@ #include "platform/mbed_critical.h" #include "platform/mbed_power_mgmt.h" -void wait(float s) { +void wait(float s) +{ wait_us(s * 1000000.0f); } -void wait_ms(int ms) { +void wait_ms(int ms) +{ wait_us(ms * 1000); } -void wait_us(int us) { +void wait_us(int us) +{ const ticker_data_t *const ticker = get_us_ticker_data(); uint32_t start = ticker_read(ticker); diff --git a/rtos/mbed_lib.json b/rtos/mbed_lib.json index c0d9e20bdc8..f0a46677596 100644 --- a/rtos/mbed_lib.json +++ b/rtos/mbed_lib.json @@ -2,5 +2,6 @@ "name": "rtos", "config": { "present": 1 - } + }, + "macros": ["_RTE_"] } diff --git a/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/flash_api.c b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/flash_api.c new file mode 100644 index 00000000000..2a96377aeb5 --- /dev/null +++ b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/flash_api.c @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2017-2018 ARM Limited + * + * Licensed under the Apache License Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "device.h" +#include "flash_api.h" +#include "memory_zones.h" + +/* CM3DS is deployed on MPS2 board with an FPGA image (AN511). + * It doesn't have physical flash memory,the implementation emulates + * flash over SRAM. + */ +#define FLASH_PAGE_SIZE 256 +#define FLASH_OFS_START ZBT_SSRAM1_START +#define FLASH_SECTOR_SIZE 0x1000 +#define FLASH_OFS_END (FLASH_OFS_START + FLASH_SIZE) + +int32_t flash_init(flash_t *obj) +{ + (void)obj; + + return 0; +} + +int32_t flash_free(flash_t *obj) +{ + (void)obj; + + return 0; +} + +int32_t flash_erase_sector(flash_t *obj, uint32_t address) +{ + (void)obj; + + memset((void *)address, 0xff, FLASH_SECTOR_SIZE); + + return 0; +} + +int32_t flash_read(flash_t *obj, uint32_t address, + uint8_t *data, uint32_t size) +{ + (void)obj; + + memcpy(data, (void *)address, size); + + return 0; +} + +int32_t flash_program_page(flash_t *obj, uint32_t address, + const uint8_t *data, uint32_t size) +{ + (void)obj; + + memcpy((void *)address, data, size); + + return 0; +} + +uint32_t flash_get_sector_size(const flash_t *obj, uint32_t address) +{ + (void)obj; + + if (address < FLASH_OFS_START || address >= FLASH_OFS_END) { + return MBED_FLASH_INVALID_SIZE; + } + + return FLASH_SECTOR_SIZE; +} + +uint32_t flash_get_page_size(const flash_t *obj) +{ + (void)obj; + + return FLASH_PAGE_SIZE; +} + +uint32_t flash_get_start_address(const flash_t *obj) +{ + (void)obj; + + return FLASH_OFS_START; +} + +uint32_t flash_get_size(const flash_t *obj) +{ + (void)obj; + + return FLASH_SIZE; +} diff --git a/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/objects.h b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/objects.h index 64e08a8ebbd..9cf7f7fbed3 100644 --- a/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/objects.h +++ b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/objects.h @@ -70,6 +70,11 @@ struct analogin_s { uint16_t ctrl_register; /* Control bits with the channel identifier */ }; +/* This structure is not used by the HAL implementation. */ +struct flash_s { + uint8_t not_used; +}; + /* This TRNG structure is not used by the HAL implementation. */ struct trng_s { uint8_t not_used; diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/README.md b/targets/TARGET_NORDIC/TARGET_NRF5x/README.md index c51674cfee9..fb2f9cc8407 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/README.md +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/README.md @@ -108,15 +108,15 @@ All buffers can be resized to fit the application: ``` "name": "nordic", "config": { - "uart-dma-size": { + "uart_dma_size": { "help": "UART DMA buffer. 2 buffers per instance. DMA buffer is filled by UARTE", "value": 8 }, - "uart-0-fifo-size": { + "uart_0_fifo_size": { "help": "UART0 FIFO buffer. FIFO buffer is filled from DMA buffer.", "value": 32 }, - "uart-1-fifo-size": { + "uart_1_fifo_size": { "help": "UART1 FIFO buffer. FIFO buffer is filled from DMA buffer.", "value": 32 } @@ -143,9 +143,9 @@ The table must be placed in a C compilation file. Because each DMA buffer must be at least 5 bytes deep, each buffer is automatically flushed after a certain idle period to ensure low latency and correctness. This idle timeout is implemented using 2 of the 4 channels on RTC instance 2. This leaves RTC0 for the SoftDevice and RTC1 for Mbed tickers. -#### SWI2, SWI3, SWI4, and SWI5 +#### SWI0 -To minimize the time spend in the highest priority interrupt handler all callbacks to the user provided IRQ handlers are deferred through Software Interrupts running at lowest priority. SWI 2-5 are reserved by the serial implementation. +To minimize the time spend in the highest priority interrupt handler all callbacks to the user provided IRQ handlers are deferred through Software Interrupts running at lowest priority. SWI0 is reserved by the serial implementation. #### Asserts @@ -156,13 +156,14 @@ The SDK file `mbed-os/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/librari The assert handler is defined in mbed-os/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5x/source/btle/btle.cpp : assert_nrf_callback() which forwards assert failures to thye mbed error() handler. - #### Limitations * The UARTE hardware only supports 8-bit, None/Even parity, and 1 stop bit. * The asynchronous read and write implementation currently only support 255 byte transfers. * The EasyDMA hardware can only read from RAM, which means all Tx buffers must reside in RAM. If a Tx buffer residing in flash is passed to the asynchronous write function, the function will try to copy the Tx buffer to a temporary internal buffer and transmit the data from there. * It is not possible to do an asynchronous write from flash and receive non-asynchronously at the same time since the non-asynchronous receive buffer is being used as the temporary transmission buffer. + * The driver will flush the DMA buffer after a configurable timeout. During this process the UART will be halted and therefor unable to receive data. Hardware flow control should be enabled to avoid missing any data during this window. + ## SoftDevice diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/config/sdk_config.h b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/config/sdk_config.h index cf4a3c0805f..451c125b35d 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/config/sdk_config.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/config/sdk_config.h @@ -1,30 +1,30 @@ /** * Copyright (c) 2017 - 2017, Nordic Semiconductor ASA - * + * * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form, except as embedded into a Nordic * Semiconductor ASA integrated circuit in a product or a software update for * such product, must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other * materials provided with the distribution. - * + * * 3. Neither the name of Nordic Semiconductor ASA nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. - * + * * 4. This software, with or without modification, must only be used with a * Nordic Semiconductor ASA integrated circuit. - * + * * 5. Any software provided in binary form under this license must not be reverse * engineered, decompiled, modified and/or disassembled. - * + * * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -35,7 +35,7 @@ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * */ @@ -46,7 +46,7 @@ #ifdef USE_APP_CONFIG #include "app_config.h" #endif -// Board Support +// Board Support // Enable NRF Asserts when Mbed NDEBUG is not set #if !defined(NDEBUG) && !defined(DEBUG_NRF_USER) @@ -55,16 +55,16 @@ //========================================================== // BSP_BTN_BLE_ENABLED - bsp_btn_ble - Button Control for BLE - + #ifndef BSP_BTN_BLE_ENABLED #define BSP_BTN_BLE_ENABLED 0 #endif -// +// //========================================================== -// nRF_ANT +// nRF_ANT //========================================================== // ANTFS_ENABLED - ant_fs - ANT File Share module. @@ -72,96 +72,96 @@ #ifndef ANTFS_ENABLED #define ANTFS_ENABLED 0 #endif -// ANTFS_CONFIG_NETWORK_NUMBER - ANT-FS network number. +// ANTFS_CONFIG_NETWORK_NUMBER - ANT-FS network number. #ifndef ANTFS_CONFIG_NETWORK_NUMBER #define ANTFS_CONFIG_NETWORK_NUMBER 0 #endif -// ANTFS_CONFIG_CHANNEL_NUMBER - ANT-FS channel number. +// ANTFS_CONFIG_CHANNEL_NUMBER - ANT-FS channel number. #ifndef ANTFS_CONFIG_CHANNEL_NUMBER #define ANTFS_CONFIG_CHANNEL_NUMBER 0 #endif -// ANTFS_CONFIG_PAIRING_TIMEOUT - Pairing timeout - how long the UI will wait for a response to a pairing request before switching to the link layer, in seconds. +// ANTFS_CONFIG_PAIRING_TIMEOUT - Pairing timeout - how long the UI will wait for a response to a pairing request before switching to the link layer, in seconds. #ifndef ANTFS_CONFIG_PAIRING_TIMEOUT #define ANTFS_CONFIG_PAIRING_TIMEOUT 120 #endif -// ANTFS_CONFIG_LINK_COMMAND_TIMEOUT - Command timeout - how long the client will wait without receiving any commands before switching to the link layer, in seconds. +// ANTFS_CONFIG_LINK_COMMAND_TIMEOUT - Command timeout - how long the client will wait without receiving any commands before switching to the link layer, in seconds. #ifndef ANTFS_CONFIG_LINK_COMMAND_TIMEOUT #define ANTFS_CONFIG_LINK_COMMAND_TIMEOUT 10 #endif -// ANTFS_CONFIG_TRANS_TYPE - ANT-FS Transmission Type. +// ANTFS_CONFIG_TRANS_TYPE - ANT-FS Transmission Type. #ifndef ANTFS_CONFIG_TRANS_TYPE #define ANTFS_CONFIG_TRANS_TYPE 10 #endif -// ANTFS_CONFIG_DEVICE_TYPE - ANT device type for channel configuration. +// ANTFS_CONFIG_DEVICE_TYPE - ANT device type for channel configuration. #ifndef ANTFS_CONFIG_DEVICE_TYPE #define ANTFS_CONFIG_DEVICE_TYPE 1 #endif // ANTFS_CONFIG_BEACON_STATUS_PERIOD - ANT-FS Beacon Message Period. - -// <0=> 0.5 Hz -// <1=> 1 Hz -// <2=> 2 Hz -// <3=> 4 Hz -// <4=> 8 Hz + +// <0=> 0.5 Hz +// <1=> 1 Hz +// <2=> 2 Hz +// <3=> 4 Hz +// <4=> 8 Hz #ifndef ANTFS_CONFIG_BEACON_STATUS_PERIOD #define ANTFS_CONFIG_BEACON_STATUS_PERIOD 3 #endif // ANTFS_CONFIG_TRANSMIT_POWER - ANT Transmit Power. - -// <0=> Lowest ANT Tx power level setting. (-20dBm) -// <1=> ANT Tx power > Lvl 0. (-12dBm) -// <2=> ANT Tx power > Lvl 1. (-4dBm) -// <3=> ANT Tx power > Lvl 2. Default tx power level. (0dBm) -// <4=> ANT Tx power > Lvl 3. (+4dBm) -// <128=> Custom tx power selection + +// <0=> Lowest ANT Tx power level setting. (-20dBm) +// <1=> ANT Tx power > Lvl 0. (-12dBm) +// <2=> ANT Tx power > Lvl 1. (-4dBm) +// <3=> ANT Tx power > Lvl 2. Default tx power level. (0dBm) +// <4=> ANT Tx power > Lvl 3. (+4dBm) +// <128=> Custom tx power selection #ifndef ANTFS_CONFIG_TRANSMIT_POWER #define ANTFS_CONFIG_TRANSMIT_POWER 3 #endif -// ANTFS_CONFIG_CUSTOM_TRANSMIT_POWER - ANT Custom Transmit Power. +// ANTFS_CONFIG_CUSTOM_TRANSMIT_POWER - ANT Custom Transmit Power. #ifndef ANTFS_CONFIG_CUSTOM_TRANSMIT_POWER #define ANTFS_CONFIG_CUSTOM_TRANSMIT_POWER 0 #endif // ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED - Use pairing and key exchange authentication. - + #ifndef ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED #define ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED 0 #endif // ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED - Use passkey authentication. - + #ifndef ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED #define ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED 0 #endif // ANTFS_CONFIG_AUTH_TYPE_PASSTHROUGH_ENABLED - Allow host to bypass authentication. - + #ifndef ANTFS_CONFIG_AUTH_TYPE_PASSTHROUGH_ENABLED #define ANTFS_CONFIG_AUTH_TYPE_PASSTHROUGH_ENABLED 0 #endif // ANTFS_CONFIG_UPLOAD_ENABLED - Support upload operation. - + #ifndef ANTFS_CONFIG_UPLOAD_ENABLED #define ANTFS_CONFIG_UPLOAD_ENABLED 0 #endif // ANTFS_CONFIG_DEBUG_LED_ENABLED - Enables LED debug in the module. - + #ifndef ANTFS_CONFIG_DEBUG_LED_ENABLED #define ANTFS_CONFIG_DEBUG_LED_ENABLED 0 @@ -180,28 +180,28 @@ #define ANT_BPWR_LOG_ENABLED 0 #endif // ANT_BPWR_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_LOG_LEVEL #define ANT_BPWR_LOG_LEVEL 3 #endif // ANT_BPWR_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_INFO_COLOR #define ANT_BPWR_INFO_COLOR 0 @@ -215,28 +215,28 @@ #define ANT_BPWR_COMMON_LOG_ENABLED 0 #endif // ANT_BPWR_COMMON_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_COMMON_LOG_LEVEL #define ANT_BPWR_COMMON_LOG_LEVEL 3 #endif // ANT_BPWR_COMMON_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_COMMON_INFO_COLOR #define ANT_BPWR_COMMON_INFO_COLOR 0 @@ -250,28 +250,28 @@ #define ANT_BPWR_PAGE_TORQUE_LOG_ENABLED 0 #endif // ANT_BPWR_PAGE_TORQUE_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_PAGE_TORQUE_LOG_LEVEL #define ANT_BPWR_PAGE_TORQUE_LOG_LEVEL 3 #endif // ANT_BPWR_PAGE_TORQUE_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_PAGE_TORQUE_INFO_COLOR #define ANT_BPWR_PAGE_TORQUE_INFO_COLOR 0 @@ -285,28 +285,28 @@ #define ANT_BPWR_PAGE_1_LOG_ENABLED 0 #endif // ANT_BPWR_PAGE_1_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_PAGE_1_LOG_LEVEL #define ANT_BPWR_PAGE_1_LOG_LEVEL 3 #endif // ANT_BPWR_PAGE_1_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_PAGE_1_INFO_COLOR #define ANT_BPWR_PAGE_1_INFO_COLOR 0 @@ -320,28 +320,28 @@ #define ANT_BPWR_PAGE_16_LOG_ENABLED 0 #endif // ANT_BPWR_PAGE_16_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_PAGE_16_LOG_LEVEL #define ANT_BPWR_PAGE_16_LOG_LEVEL 3 #endif // ANT_BPWR_PAGE_16_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_PAGE_16_INFO_COLOR #define ANT_BPWR_PAGE_16_INFO_COLOR 0 @@ -355,28 +355,28 @@ #define ANT_BPWR_PAGE_17_LOG_ENABLED 0 #endif // ANT_BPWR_PAGE_17_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_PAGE_17_LOG_LEVEL #define ANT_BPWR_PAGE_17_LOG_LEVEL 3 #endif // ANT_BPWR_PAGE_17_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_PAGE_17_INFO_COLOR #define ANT_BPWR_PAGE_17_INFO_COLOR 0 @@ -390,28 +390,28 @@ #define ANT_BPWR_PAGE_18_LOG_ENABLED 0 #endif // ANT_BPWR_PAGE_18_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_PAGE_18_LOG_LEVEL #define ANT_BPWR_PAGE_18_LOG_LEVEL 3 #endif // ANT_BPWR_PAGE_18_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_PAGE_18_INFO_COLOR #define ANT_BPWR_PAGE_18_INFO_COLOR 0 @@ -432,28 +432,28 @@ #define ANT_BSC_LOG_ENABLED 0 #endif // ANT_BSC_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_LOG_LEVEL #define ANT_BSC_LOG_LEVEL 3 #endif // ANT_BSC_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_INFO_COLOR #define ANT_BSC_INFO_COLOR 0 @@ -467,28 +467,28 @@ #define ANT_BSC_COMBINED_PAGE_0_LOG_ENABLED 0 #endif // ANT_BSC_COMBINED_PAGE_0_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_COMBINED_PAGE_0_LOG_LEVEL #define ANT_BSC_COMBINED_PAGE_0_LOG_LEVEL 3 #endif // ANT_BSC_COMBINED_PAGE_0_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_COMBINED_PAGE_0_INFO_COLOR #define ANT_BSC_COMBINED_PAGE_0_INFO_COLOR 0 @@ -502,28 +502,28 @@ #define ANT_BSC_PAGE_0_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_0_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_0_LOG_LEVEL #define ANT_BSC_PAGE_0_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_0_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_0_INFO_COLOR #define ANT_BSC_PAGE_0_INFO_COLOR 0 @@ -537,28 +537,28 @@ #define ANT_BSC_PAGE_1_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_1_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_1_LOG_LEVEL #define ANT_BSC_PAGE_1_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_1_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_1_INFO_COLOR #define ANT_BSC_PAGE_1_INFO_COLOR 0 @@ -572,28 +572,28 @@ #define ANT_BSC_PAGE_2_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_2_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_2_LOG_LEVEL #define ANT_BSC_PAGE_2_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_2_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_2_INFO_COLOR #define ANT_BSC_PAGE_2_INFO_COLOR 0 @@ -607,28 +607,28 @@ #define ANT_BSC_PAGE_3_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_3_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_3_LOG_LEVEL #define ANT_BSC_PAGE_3_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_3_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_3_INFO_COLOR #define ANT_BSC_PAGE_3_INFO_COLOR 0 @@ -642,28 +642,28 @@ #define ANT_BSC_PAGE_4_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_4_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_4_LOG_LEVEL #define ANT_BSC_PAGE_4_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_4_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_4_INFO_COLOR #define ANT_BSC_PAGE_4_INFO_COLOR 0 @@ -677,28 +677,28 @@ #define ANT_BSC_PAGE_5_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_5_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_5_LOG_LEVEL #define ANT_BSC_PAGE_5_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_5_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_5_INFO_COLOR #define ANT_BSC_PAGE_5_INFO_COLOR 0 @@ -709,7 +709,7 @@ // // ANT_CHANNEL_CONFIG_ENABLED - ant_channel_config - ANT common channel configuration - + #ifndef ANT_CHANNEL_CONFIG_ENABLED #define ANT_CHANNEL_CONFIG_ENABLED 0 @@ -726,28 +726,28 @@ #define ANT_COMMON_PAGE_70_LOG_ENABLED 0 #endif // ANT_COMMON_PAGE_70_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_COMMON_PAGE_70_LOG_LEVEL #define ANT_COMMON_PAGE_70_LOG_LEVEL 3 #endif // ANT_COMMON_PAGE_70_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_COMMON_PAGE_70_INFO_COLOR #define ANT_COMMON_PAGE_70_INFO_COLOR 0 @@ -768,28 +768,28 @@ #define ANT_COMMON_PAGE_80_LOG_ENABLED 0 #endif // ANT_COMMON_PAGE_80_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_COMMON_PAGE_80_LOG_LEVEL #define ANT_COMMON_PAGE_80_LOG_LEVEL 3 #endif // ANT_COMMON_PAGE_80_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_COMMON_PAGE_80_INFO_COLOR #define ANT_COMMON_PAGE_80_INFO_COLOR 0 @@ -810,28 +810,28 @@ #define ANT_COMMON_PAGE_81_LOG_ENABLED 0 #endif // ANT_COMMON_PAGE_81_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_COMMON_PAGE_81_LOG_LEVEL #define ANT_COMMON_PAGE_81_LOG_LEVEL 3 #endif // ANT_COMMON_PAGE_81_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_COMMON_PAGE_81_INFO_COLOR #define ANT_COMMON_PAGE_81_INFO_COLOR 0 @@ -842,7 +842,7 @@ // // ANT_ENCRYPT_CONFIG_ENABLED - ant_encrypt_config - Cryptographic ANT stack configuration - + #ifndef ANT_ENCRYPT_CONFIG_ENABLED #define ANT_ENCRYPT_CONFIG_ENABLED 0 @@ -859,28 +859,28 @@ #define ANT_HRM_LOG_ENABLED 0 #endif // ANT_HRM_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_LOG_LEVEL #define ANT_HRM_LOG_LEVEL 3 #endif // ANT_HRM_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_INFO_COLOR #define ANT_HRM_INFO_COLOR 0 @@ -894,28 +894,28 @@ #define ANT_HRM_PAGE_0_LOG_ENABLED 0 #endif // ANT_HRM_PAGE_0_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_PAGE_0_LOG_LEVEL #define ANT_HRM_PAGE_0_LOG_LEVEL 3 #endif // ANT_HRM_PAGE_0_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_PAGE_0_INFO_COLOR #define ANT_HRM_PAGE_0_INFO_COLOR 0 @@ -929,28 +929,28 @@ #define ANT_HRM_PAGE_1_LOG_ENABLED 0 #endif // ANT_HRM_PAGE_1_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_PAGE_1_LOG_LEVEL #define ANT_HRM_PAGE_1_LOG_LEVEL 3 #endif // ANT_HRM_PAGE_1_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_PAGE_1_INFO_COLOR #define ANT_HRM_PAGE_1_INFO_COLOR 0 @@ -964,28 +964,28 @@ #define ANT_HRM_PAGE_2_LOG_ENABLED 0 #endif // ANT_HRM_PAGE_2_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_PAGE_2_LOG_LEVEL #define ANT_HRM_PAGE_2_LOG_LEVEL 3 #endif // ANT_HRM_PAGE_2_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_PAGE_2_INFO_COLOR #define ANT_HRM_PAGE_2_INFO_COLOR 0 @@ -999,28 +999,28 @@ #define ANT_HRM_PAGE_3_LOG_ENABLED 0 #endif // ANT_HRM_PAGE_3_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_PAGE_3_LOG_LEVEL #define ANT_HRM_PAGE_3_LOG_LEVEL 3 #endif // ANT_HRM_PAGE_3_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_PAGE_3_INFO_COLOR #define ANT_HRM_PAGE_3_INFO_COLOR 0 @@ -1034,28 +1034,28 @@ #define ANT_HRM_PAGE_4_LOG_ENABLED 0 #endif // ANT_HRM_PAGE_4_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_PAGE_4_LOG_LEVEL #define ANT_HRM_PAGE_4_LOG_LEVEL 3 #endif // ANT_HRM_PAGE_4_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_PAGE_4_INFO_COLOR #define ANT_HRM_PAGE_4_INFO_COLOR 0 @@ -1066,14 +1066,14 @@ // // ANT_KEY_MANAGER_ENABLED - ant_key_manager - Software Component - + #ifndef ANT_KEY_MANAGER_ENABLED #define ANT_KEY_MANAGER_ENABLED 0 #endif // ANT_REQUEST_CONTROLLER_ENABLED - ant_request_controller - ANT+ request controller - + #ifndef ANT_REQUEST_CONTROLLER_ENABLED #define ANT_REQUEST_CONTROLLER_ENABLED 0 @@ -1090,28 +1090,28 @@ #define ANT_SDM_LOG_ENABLED 0 #endif // ANT_SDM_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_SDM_LOG_LEVEL #define ANT_SDM_LOG_LEVEL 3 #endif // ANT_SDM_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_SDM_INFO_COLOR #define ANT_SDM_INFO_COLOR 0 @@ -1126,14 +1126,14 @@ #ifndef ANT_SEARCH_CONFIG_ENABLED #define ANT_SEARCH_CONFIG_ENABLED 0 #endif -// ANT_DEFAULT_LOW_PRIORITY_TIMEOUT - Default low priority search time-out. <0-255> +// ANT_DEFAULT_LOW_PRIORITY_TIMEOUT - Default low priority search time-out. <0-255> #ifndef ANT_DEFAULT_LOW_PRIORITY_TIMEOUT #define ANT_DEFAULT_LOW_PRIORITY_TIMEOUT 2 #endif -// ANT_DEFAULT_HIGH_PRIORITY_TIMEOUT - Default high priority search time-out. <0-255> +// ANT_DEFAULT_HIGH_PRIORITY_TIMEOUT - Default high priority search time-out. <0-255> #ifndef ANT_DEFAULT_HIGH_PRIORITY_TIMEOUT @@ -1147,22 +1147,22 @@ #ifndef ANT_STACK_CONFIG_ENABLED #define ANT_STACK_CONFIG_ENABLED 0 #endif -// ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED - Allocated ANT channels +// ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED - Allocated ANT channels #ifndef ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED #define ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED 0 #endif -// ANT_CONFIG_ENCRYPTED_CHANNELS - Encrypted ANT channels +// ANT_CONFIG_ENCRYPTED_CHANNELS - Encrypted ANT channels #ifndef ANT_CONFIG_ENCRYPTED_CHANNELS #define ANT_CONFIG_ENCRYPTED_CHANNELS 0 #endif -// ANT_CONFIG_EVENT_QUEUE_SIZE - Event queue size +// ANT_CONFIG_EVENT_QUEUE_SIZE - Event queue size #ifndef ANT_CONFIG_EVENT_QUEUE_SIZE #define ANT_CONFIG_EVENT_QUEUE_SIZE 32 #endif -// ANT_CONFIG_BURST_QUEUE_SIZE - ANT burst queue size +// ANT_CONFIG_BURST_QUEUE_SIZE - ANT burst queue size #ifndef ANT_CONFIG_BURST_QUEUE_SIZE #define ANT_CONFIG_BURST_QUEUE_SIZE 128 #endif @@ -1174,35 +1174,35 @@ #ifndef ANT_STATE_INDICATOR_ENABLED #define ANT_STATE_INDICATOR_ENABLED 0 #endif -// ANT_STATE_INDICATOR_CONFIG_SHUTDOWN_HANDLER_PRIORITY - Shutdown observer priority. +// ANT_STATE_INDICATOR_CONFIG_SHUTDOWN_HANDLER_PRIORITY - Shutdown observer priority. #ifndef ANT_STATE_INDICATOR_CONFIG_SHUTDOWN_HANDLER_PRIORITY #define ANT_STATE_INDICATOR_CONFIG_SHUTDOWN_HANDLER_PRIORITY 1 #endif // -// +// //========================================================== -// nRF_BLE +// nRF_BLE //========================================================== // BLE_ADVERTISING_ENABLED - ble_advertising - Advertising module - + #ifndef BLE_ADVERTISING_ENABLED #define BLE_ADVERTISING_ENABLED 0 #endif // BLE_DTM_ENABLED - ble_dtm - Module for testing RF/PHY using DTM commands - + #ifndef BLE_DTM_ENABLED #define BLE_DTM_ENABLED 0 #endif // BLE_RACP_ENABLED - ble_racp - Record Access Control Point library - + #ifndef BLE_RACP_ENABLED #define BLE_RACP_ENABLED 0 @@ -1213,14 +1213,14 @@ #ifndef NRF_BLE_CONN_PARAMS_ENABLED #define NRF_BLE_CONN_PARAMS_ENABLED 0 #endif -// NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION - The largest acceptable deviation in slave latency. +// NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION - The largest acceptable deviation in slave latency. // The largest deviation (+ or -) from the requested slave latency that will not be renegotiated. #ifndef NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION #define NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION 499 #endif -// NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION - The largest acceptable deviation (in 10 ms units) in supervision timeout. +// NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION - The largest acceptable deviation (in 10 ms units) in supervision timeout. // The largest deviation (+ or -, in 10 ms units) from the requested supervision timeout that will not be renegotiated. #ifndef NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION @@ -1230,7 +1230,7 @@ // // NRF_BLE_QWR_ENABLED - nrf_ble_qwr - Queued writes support module (prepare/execute write) - + #ifndef NRF_BLE_QWR_ENABLED #define NRF_BLE_QWR_ENABLED 0 @@ -1241,14 +1241,14 @@ #ifndef PEER_MANAGER_ENABLED #define PEER_MANAGER_ENABLED 0 #endif -// PM_MAX_REGISTRANTS +// PM_MAX_REGISTRANTS // Number of event handlers that can be registered. #ifndef PM_MAX_REGISTRANTS #define PM_MAX_REGISTRANTS 3 #endif -// PM_FLASH_BUFFERS +// PM_FLASH_BUFFERS // Number of internal buffers for flash operations. // Decrease this value to lower RAM usage. @@ -1258,170 +1258,170 @@ // -// +// //========================================================== -// nRF_BLE_Services +// nRF_BLE_Services //========================================================== // BLE_ANCS_C_ENABLED - ble_ancs_c - Apple Notification Service Client - + #ifndef BLE_ANCS_C_ENABLED #define BLE_ANCS_C_ENABLED 0 #endif // BLE_ANS_C_ENABLED - ble_ans_c - Alert Notification Service Client - + #ifndef BLE_ANS_C_ENABLED #define BLE_ANS_C_ENABLED 0 #endif // BLE_BAS_C_ENABLED - ble_bas_c - Battery Service Client - + #ifndef BLE_BAS_C_ENABLED #define BLE_BAS_C_ENABLED 0 #endif // BLE_BAS_ENABLED - ble_bas - Battery Service - + #ifndef BLE_BAS_ENABLED #define BLE_BAS_ENABLED 0 #endif // BLE_CSCS_ENABLED - ble_cscs - Cycling Speed and Cadence Service - + #ifndef BLE_CSCS_ENABLED #define BLE_CSCS_ENABLED 0 #endif // BLE_CTS_C_ENABLED - ble_cts_c - Current Time Service Client - + #ifndef BLE_CTS_C_ENABLED #define BLE_CTS_C_ENABLED 0 #endif // BLE_DIS_ENABLED - ble_dis - Device Information Service - + #ifndef BLE_DIS_ENABLED #define BLE_DIS_ENABLED 0 #endif // BLE_GLS_ENABLED - ble_gls - Glucose Service - + #ifndef BLE_GLS_ENABLED #define BLE_GLS_ENABLED 0 #endif // BLE_HIDS_ENABLED - ble_hids - Human Interface Device Service - + #ifndef BLE_HIDS_ENABLED #define BLE_HIDS_ENABLED 0 #endif // BLE_HRS_C_ENABLED - ble_hrs_c - Heart Rate Service Client - + #ifndef BLE_HRS_C_ENABLED #define BLE_HRS_C_ENABLED 0 #endif // BLE_HRS_ENABLED - ble_hrs - Heart Rate Service - + #ifndef BLE_HRS_ENABLED #define BLE_HRS_ENABLED 0 #endif // BLE_HTS_ENABLED - ble_hts - Health Thermometer Service - + #ifndef BLE_HTS_ENABLED #define BLE_HTS_ENABLED 0 #endif // BLE_IAS_C_ENABLED - ble_ias_c - Immediate Alert Service Client - + #ifndef BLE_IAS_C_ENABLED #define BLE_IAS_C_ENABLED 0 #endif // BLE_IAS_ENABLED - ble_ias - Immediate Alert Service - + #ifndef BLE_IAS_ENABLED #define BLE_IAS_ENABLED 0 #endif // BLE_LBS_C_ENABLED - ble_lbs_c - Nordic LED Button Service Client - + #ifndef BLE_LBS_C_ENABLED #define BLE_LBS_C_ENABLED 0 #endif // BLE_LBS_ENABLED - ble_lbs - LED Button Service - + #ifndef BLE_LBS_ENABLED #define BLE_LBS_ENABLED 0 #endif // BLE_LLS_ENABLED - ble_lls - Link Loss Service - + #ifndef BLE_LLS_ENABLED #define BLE_LLS_ENABLED 0 #endif // BLE_NUS_C_ENABLED - ble_nus_c - Nordic UART Central Service - + #ifndef BLE_NUS_C_ENABLED #define BLE_NUS_C_ENABLED 0 #endif // BLE_NUS_ENABLED - ble_nus - Nordic UART Service - + #ifndef BLE_NUS_ENABLED #define BLE_NUS_ENABLED 0 #endif // BLE_RSCS_C_ENABLED - ble_rscs_c - Running Speed and Cadence Client - + #ifndef BLE_RSCS_C_ENABLED #define BLE_RSCS_C_ENABLED 0 #endif // BLE_RSCS_ENABLED - ble_rscs - Running Speed and Cadence Service - + #ifndef BLE_RSCS_ENABLED #define BLE_RSCS_ENABLED 0 #endif // BLE_TPS_ENABLED - ble_tps - TX Power Service - + #ifndef BLE_TPS_ENABLED #define BLE_TPS_ENABLED 0 #endif -// +// //========================================================== -// nRF_Core +// nRF_Core //========================================================== // NRF_MPU_ENABLED - nrf_mpu - Module for MPU @@ -1430,7 +1430,7 @@ #define NRF_MPU_ENABLED 0 #endif // NRF_MPU_CLI_CMDS - Enable CLI commands specific to the module - + #ifndef NRF_MPU_CLI_CMDS #define NRF_MPU_CLI_CMDS 1 @@ -1444,15 +1444,15 @@ #define NRF_STACK_GUARD_ENABLED 0 #endif // NRF_STACK_GUARD_CONFIG_SIZE - Size of stack guard - -// <5=> 32 bytes -// <6=> 64 bytes -// <7=> 128 bytes -// <8=> 256 bytes -// <9=> 512 bytes -// <10=> 1024 bytes -// <11=> 2048 bytes -// <12=> 4096 bytes + +// <5=> 32 bytes +// <6=> 64 bytes +// <7=> 128 bytes +// <8=> 256 bytes +// <9=> 512 bytes +// <10=> 1024 bytes +// <11=> 2048 bytes +// <12=> 4096 bytes #ifndef NRF_STACK_GUARD_CONFIG_SIZE #define NRF_STACK_GUARD_CONFIG_SIZE 7 @@ -1460,10 +1460,10 @@ // -// +// //========================================================== -// nRF_Crypto +// nRF_Crypto //========================================================== // NRF_CRYPTO_ENABLED - nrf_crypto - Cryptography library @@ -1472,7 +1472,7 @@ #define NRF_CRYPTO_ENABLED 0 #endif // NRF_CRYPTO_BACKEND_CC310_LIB - Enable the ARM Cryptocell CC310 backend - + // The hardware-accelerated cryptography backend is available only on nRF52840. @@ -1488,7 +1488,7 @@ #define NRF_CRYPTO_BACKEND_MICRO_ECC 0 #endif // NRF_CRYPTO_BACKEND_MICRO_ECC_SHA256 - Enable SHA256 - + // Enable SHA256 cryptographic hash functionality. // Enable this setting if you need SHA256 support, for example to verify signatures. @@ -1498,7 +1498,7 @@ #endif // NRF_CRYPTO_BACKEND_MICRO_ECC_RNG - Enable random number generator - + // Enable random number generation. // Enable this setting if you need to generate cryptographic keys. @@ -1512,36 +1512,36 @@ // -// +// //========================================================== -// nRF_DFU +// nRF_DFU //========================================================== // ble_dfu - Device Firmware Update //========================================================== // BLE_DFU_ENABLED - Enable DFU Service. - + #ifndef BLE_DFU_ENABLED #define BLE_DFU_ENABLED 0 #endif // NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS - Buttonless DFU supports bonds. - + #ifndef NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS #define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 0 #endif -// +// //========================================================== -// +// //========================================================== -// nRF_Drivers +// nRF_Drivers //========================================================== // APP_USBD_ENABLED - app_usbd - USB Device library @@ -1549,7 +1549,7 @@ #ifndef APP_USBD_ENABLED #define APP_USBD_ENABLED 0 #endif -// APP_USBD_VID - Vendor ID <0x0000-0xFFFF> +// APP_USBD_VID - Vendor ID <0x0000-0xFFFF> // Vendor ID ordered from USB IF: http://www.usb.org/developers/vendor/ @@ -1558,7 +1558,7 @@ #define APP_USBD_VID 0 #endif -// APP_USBD_PID - Product ID <0x0000-0xFFFF> +// APP_USBD_PID - Product ID <0x0000-0xFFFF> // Selected Product ID @@ -1567,7 +1567,7 @@ #define APP_USBD_PID 0 #endif -// APP_USBD_DEVICE_VER_MAJOR - Device version, major part <0-99> +// APP_USBD_DEVICE_VER_MAJOR - Device version, major part <0-99> // Device version, will be converted automatically to BCD notation. Use just decimal values. @@ -1576,7 +1576,7 @@ #define APP_USBD_DEVICE_VER_MAJOR 1 #endif -// APP_USBD_DEVICE_VER_MINOR - Device version, minor part <0-99> +// APP_USBD_DEVICE_VER_MINOR - Device version, minor part <0-99> // Device version, will be converted automatically to BCD notation. Use just decimal values. @@ -1595,7 +1595,7 @@ #ifndef APP_USBD_EVENT_QUEUE_ENABLE #define APP_USBD_EVENT_QUEUE_ENABLE 1 #endif -// APP_USBD_EVENT_QUEUE_SIZE - The size of event queue <16-64> +// APP_USBD_EVENT_QUEUE_SIZE - The size of event queue <16-64> // The size of the queue for the events that would be processed in the main loop. @@ -1612,44 +1612,44 @@ #define APP_USBD_CONFIG_LOG_ENABLED 0 #endif // APP_USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef APP_USBD_CONFIG_LOG_LEVEL #define APP_USBD_CONFIG_LOG_LEVEL 3 #endif // APP_USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_CONFIG_INFO_COLOR #define APP_USBD_CONFIG_INFO_COLOR 0 #endif // APP_USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_CONFIG_DEBUG_COLOR #define APP_USBD_CONFIG_DEBUG_COLOR 0 @@ -1665,35 +1665,35 @@ #define CLOCK_ENABLED 0 #endif // CLOCK_CONFIG_XTAL_FREQ - HF XTAL Frequency - -// <0=> Default (64 MHz) + +// <0=> Default (64 MHz) #ifndef CLOCK_CONFIG_XTAL_FREQ #define CLOCK_CONFIG_XTAL_FREQ 0 #endif // CLOCK_CONFIG_LF_SRC - LF Clock Source - -// <0=> RC -// <1=> XTAL -// <2=> Synth + +// <0=> RC +// <1=> XTAL +// <2=> Synth #ifndef CLOCK_CONFIG_LF_SRC #define CLOCK_CONFIG_LF_SRC 1 #endif // CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef CLOCK_CONFIG_IRQ_PRIORITY #define CLOCK_CONFIG_IRQ_PRIORITY 7 @@ -1707,83 +1707,83 @@ #define COMP_ENABLED 0 #endif // COMP_CONFIG_REF - Reference voltage - -// <0=> Internal 1.2V -// <1=> Internal 1.8V -// <2=> Internal 2.4V -// <4=> VDD -// <7=> ARef + +// <0=> Internal 1.2V +// <1=> Internal 1.8V +// <2=> Internal 2.4V +// <4=> VDD +// <7=> ARef #ifndef COMP_CONFIG_REF #define COMP_CONFIG_REF 1 #endif // COMP_CONFIG_MAIN_MODE - Main mode - -// <0=> Single ended -// <1=> Differential + +// <0=> Single ended +// <1=> Differential #ifndef COMP_CONFIG_MAIN_MODE #define COMP_CONFIG_MAIN_MODE 0 #endif // COMP_CONFIG_SPEED_MODE - Speed mode - -// <0=> Low power -// <1=> Normal -// <2=> High speed + +// <0=> Low power +// <1=> Normal +// <2=> High speed #ifndef COMP_CONFIG_SPEED_MODE #define COMP_CONFIG_SPEED_MODE 2 #endif // COMP_CONFIG_HYST - Hystheresis - -// <0=> No -// <1=> 50mV + +// <0=> No +// <1=> 50mV #ifndef COMP_CONFIG_HYST #define COMP_CONFIG_HYST 0 #endif // COMP_CONFIG_ISOURCE - Current Source - -// <0=> Off -// <1=> 2.5 uA -// <2=> 5 uA -// <3=> 10 uA + +// <0=> Off +// <1=> 2.5 uA +// <2=> 5 uA +// <3=> 10 uA #ifndef COMP_CONFIG_ISOURCE #define COMP_CONFIG_ISOURCE 0 #endif // COMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 + +// <0=> 0 +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef COMP_CONFIG_INPUT #define COMP_CONFIG_INPUT 0 #endif // COMP_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef COMP_CONFIG_IRQ_PRIORITY #define COMP_CONFIG_IRQ_PRIORITY 7 @@ -1792,10 +1792,10 @@ // // EGU_ENABLED - nrf_drv_swi - SWI(EGU) peripheral driver - + #ifndef EGU_ENABLED -#define EGU_ENABLED 0 +#define EGU_ENABLED 1 #endif // GPIOTE_ENABLED - nrf_drv_gpiote - GPIOTE peripheral driver @@ -1803,23 +1803,23 @@ #ifndef GPIOTE_ENABLED #define GPIOTE_ENABLED 1 #endif -// GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins +// GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins #ifndef GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS #define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 4 #endif // GPIOTE_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef GPIOTE_CONFIG_IRQ_PRIORITY #define GPIOTE_CONFIG_IRQ_PRIORITY 7 @@ -1832,33 +1832,33 @@ #ifndef I2S_ENABLED #define I2S_ENABLED 0 #endif -// I2S_CONFIG_SCK_PIN - SCK pin <0-31> +// I2S_CONFIG_SCK_PIN - SCK pin <0-31> #ifndef I2S_CONFIG_SCK_PIN #define I2S_CONFIG_SCK_PIN 31 #endif -// I2S_CONFIG_LRCK_PIN - LRCK pin <1-31> +// I2S_CONFIG_LRCK_PIN - LRCK pin <1-31> #ifndef I2S_CONFIG_LRCK_PIN #define I2S_CONFIG_LRCK_PIN 30 #endif -// I2S_CONFIG_MCK_PIN - MCK pin +// I2S_CONFIG_MCK_PIN - MCK pin #ifndef I2S_CONFIG_MCK_PIN #define I2S_CONFIG_MCK_PIN 255 #endif -// I2S_CONFIG_SDOUT_PIN - SDOUT pin <0-31> +// I2S_CONFIG_SDOUT_PIN - SDOUT pin <0-31> #ifndef I2S_CONFIG_SDOUT_PIN #define I2S_CONFIG_SDOUT_PIN 29 #endif -// I2S_CONFIG_SDIN_PIN - SDIN pin <0-31> +// I2S_CONFIG_SDIN_PIN - SDIN pin <0-31> #ifndef I2S_CONFIG_SDIN_PIN @@ -1866,106 +1866,106 @@ #endif // I2S_CONFIG_MASTER - Mode - -// <0=> Master -// <1=> Slave + +// <0=> Master +// <1=> Slave #ifndef I2S_CONFIG_MASTER #define I2S_CONFIG_MASTER 0 #endif // I2S_CONFIG_FORMAT - Format - -// <0=> I2S -// <1=> Aligned + +// <0=> I2S +// <1=> Aligned #ifndef I2S_CONFIG_FORMAT #define I2S_CONFIG_FORMAT 0 #endif // I2S_CONFIG_ALIGN - Alignment - -// <0=> Left -// <1=> Right + +// <0=> Left +// <1=> Right #ifndef I2S_CONFIG_ALIGN #define I2S_CONFIG_ALIGN 0 #endif // I2S_CONFIG_SWIDTH - Sample width (bits) - -// <0=> 8 -// <1=> 16 -// <2=> 24 + +// <0=> 8 +// <1=> 16 +// <2=> 24 #ifndef I2S_CONFIG_SWIDTH #define I2S_CONFIG_SWIDTH 1 #endif // I2S_CONFIG_CHANNELS - Channels - -// <0=> Stereo -// <1=> Left -// <2=> Right + +// <0=> Stereo +// <1=> Left +// <2=> Right #ifndef I2S_CONFIG_CHANNELS #define I2S_CONFIG_CHANNELS 1 #endif // I2S_CONFIG_MCK_SETUP - MCK behavior - -// <0=> Disabled -// <2147483648=> 32MHz/2 -// <1342177280=> 32MHz/3 -// <1073741824=> 32MHz/4 -// <805306368=> 32MHz/5 -// <671088640=> 32MHz/6 -// <536870912=> 32MHz/8 -// <402653184=> 32MHz/10 -// <369098752=> 32MHz/11 -// <285212672=> 32MHz/15 -// <268435456=> 32MHz/16 -// <201326592=> 32MHz/21 -// <184549376=> 32MHz/23 -// <142606336=> 32MHz/30 -// <138412032=> 32MHz/31 -// <134217728=> 32MHz/32 -// <100663296=> 32MHz/42 -// <68157440=> 32MHz/63 -// <34340864=> 32MHz/125 + +// <0=> Disabled +// <2147483648=> 32MHz/2 +// <1342177280=> 32MHz/3 +// <1073741824=> 32MHz/4 +// <805306368=> 32MHz/5 +// <671088640=> 32MHz/6 +// <536870912=> 32MHz/8 +// <402653184=> 32MHz/10 +// <369098752=> 32MHz/11 +// <285212672=> 32MHz/15 +// <268435456=> 32MHz/16 +// <201326592=> 32MHz/21 +// <184549376=> 32MHz/23 +// <142606336=> 32MHz/30 +// <138412032=> 32MHz/31 +// <134217728=> 32MHz/32 +// <100663296=> 32MHz/42 +// <68157440=> 32MHz/63 +// <34340864=> 32MHz/125 #ifndef I2S_CONFIG_MCK_SETUP #define I2S_CONFIG_MCK_SETUP 536870912 #endif // I2S_CONFIG_RATIO - MCK/LRCK ratio - -// <0=> 32x -// <1=> 48x -// <2=> 64x -// <3=> 96x -// <4=> 128x -// <5=> 192x -// <6=> 256x -// <7=> 384x -// <8=> 512x + +// <0=> 32x +// <1=> 48x +// <2=> 64x +// <3=> 96x +// <4=> 128x +// <5=> 192x +// <6=> 256x +// <7=> 384x +// <8=> 512x #ifndef I2S_CONFIG_RATIO #define I2S_CONFIG_RATIO 2000 #endif // I2S_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef I2S_CONFIG_IRQ_PRIORITY #define I2S_CONFIG_IRQ_PRIORITY 7 @@ -1979,73 +1979,73 @@ #define LPCOMP_ENABLED 0 #endif // LPCOMP_CONFIG_REFERENCE - Reference voltage - -// <0=> Supply 1/8 -// <1=> Supply 2/8 -// <2=> Supply 3/8 -// <3=> Supply 4/8 -// <4=> Supply 5/8 -// <5=> Supply 6/8 -// <6=> Supply 7/8 -// <8=> Supply 1/16 (nRF52) -// <9=> Supply 3/16 (nRF52) -// <10=> Supply 5/16 (nRF52) -// <11=> Supply 7/16 (nRF52) -// <12=> Supply 9/16 (nRF52) -// <13=> Supply 11/16 (nRF52) -// <14=> Supply 13/16 (nRF52) -// <15=> Supply 15/16 (nRF52) -// <7=> External Ref 0 -// <65543=> External Ref 1 + +// <0=> Supply 1/8 +// <1=> Supply 2/8 +// <2=> Supply 3/8 +// <3=> Supply 4/8 +// <4=> Supply 5/8 +// <5=> Supply 6/8 +// <6=> Supply 7/8 +// <8=> Supply 1/16 (nRF52) +// <9=> Supply 3/16 (nRF52) +// <10=> Supply 5/16 (nRF52) +// <11=> Supply 7/16 (nRF52) +// <12=> Supply 9/16 (nRF52) +// <13=> Supply 11/16 (nRF52) +// <14=> Supply 13/16 (nRF52) +// <15=> Supply 15/16 (nRF52) +// <7=> External Ref 0 +// <65543=> External Ref 1 #ifndef LPCOMP_CONFIG_REFERENCE #define LPCOMP_CONFIG_REFERENCE 3 #endif // LPCOMP_CONFIG_DETECTION - Detection - -// <0=> Crossing -// <1=> Up -// <2=> Down + +// <0=> Crossing +// <1=> Up +// <2=> Down #ifndef LPCOMP_CONFIG_DETECTION #define LPCOMP_CONFIG_DETECTION 2 #endif // LPCOMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 + +// <0=> 0 +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef LPCOMP_CONFIG_INPUT #define LPCOMP_CONFIG_INPUT 0 #endif // LPCOMP_CONFIG_HYST - Hysteresis - + #ifndef LPCOMP_CONFIG_HYST #define LPCOMP_CONFIG_HYST 0 #endif // LPCOMP_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef LPCOMP_CONFIG_IRQ_PRIORITY #define LPCOMP_CONFIG_IRQ_PRIORITY 7 @@ -2059,45 +2059,45 @@ #define PDM_ENABLED 0 #endif // PDM_CONFIG_MODE - Mode - -// <0=> Stereo -// <1=> Mono + +// <0=> Stereo +// <1=> Mono #ifndef PDM_CONFIG_MODE #define PDM_CONFIG_MODE 1 #endif // PDM_CONFIG_EDGE - Edge - -// <0=> Left falling -// <1=> Left rising + +// <0=> Left falling +// <1=> Left rising #ifndef PDM_CONFIG_EDGE #define PDM_CONFIG_EDGE 0 #endif // PDM_CONFIG_CLOCK_FREQ - Clock frequency - -// <134217728=> 1000k -// <138412032=> 1032k (default) -// <142606336=> 1067k + +// <134217728=> 1000k +// <138412032=> 1032k (default) +// <142606336=> 1067k #ifndef PDM_CONFIG_CLOCK_FREQ #define PDM_CONFIG_CLOCK_FREQ 138412032 #endif // PDM_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef PDM_CONFIG_IRQ_PRIORITY #define PDM_CONFIG_IRQ_PRIORITY 7 @@ -2106,7 +2106,7 @@ // // PERIPHERAL_RESOURCE_SHARING_ENABLED - nrf_drv_common - Peripheral drivers common module - + #ifndef PERIPHERAL_RESOURCE_SHARING_ENABLED #define PERIPHERAL_RESOURCE_SHARING_ENABLED 1 @@ -2118,24 +2118,24 @@ #define POWER_ENABLED 0 #endif // POWER_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef POWER_CONFIG_IRQ_PRIORITY #define POWER_CONFIG_IRQ_PRIORITY 7 #endif // POWER_CONFIG_DEFAULT_DCDCEN - The default configuration of main DCDC regulator - + // This settings means only that components for DCDC regulator are installed and it can be enabled. @@ -2144,7 +2144,7 @@ #endif // POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator - + // This settings means only that components for DCDC regulator are installed and it can be enabled. @@ -2155,7 +2155,7 @@ // // PPI_ENABLED - nrf_drv_ppi - PPI peripheral driver - + #ifndef PPI_ENABLED #define PPI_ENABLED 0 @@ -2166,28 +2166,28 @@ #ifndef PWM_ENABLED #define PWM_ENABLED 1 #endif -// PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31> +// PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31> #ifndef PWM_DEFAULT_CONFIG_OUT0_PIN #define PWM_DEFAULT_CONFIG_OUT0_PIN 31 #endif -// PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31> +// PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31> #ifndef PWM_DEFAULT_CONFIG_OUT1_PIN #define PWM_DEFAULT_CONFIG_OUT1_PIN 31 #endif -// PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31> +// PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31> #ifndef PWM_DEFAULT_CONFIG_OUT2_PIN #define PWM_DEFAULT_CONFIG_OUT2_PIN 31 #endif -// PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31> +// PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31> #ifndef PWM_DEFAULT_CONFIG_OUT3_PIN @@ -2195,94 +2195,94 @@ #endif // PWM_DEFAULT_CONFIG_BASE_CLOCK - Base clock - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz + +// <0=> 16 MHz +// <1=> 8 MHz +// <2=> 4 MHz +// <3=> 2 MHz +// <4=> 1 MHz +// <5=> 500 kHz +// <6=> 250 kHz +// <7=> 125 kHz #ifndef PWM_DEFAULT_CONFIG_BASE_CLOCK #define PWM_DEFAULT_CONFIG_BASE_CLOCK 4 #endif // PWM_DEFAULT_CONFIG_COUNT_MODE - Count mode - -// <0=> Up -// <1=> Up and Down + +// <0=> Up +// <1=> Up and Down #ifndef PWM_DEFAULT_CONFIG_COUNT_MODE #define PWM_DEFAULT_CONFIG_COUNT_MODE 0 #endif -// PWM_DEFAULT_CONFIG_TOP_VALUE - Top value +// PWM_DEFAULT_CONFIG_TOP_VALUE - Top value #ifndef PWM_DEFAULT_CONFIG_TOP_VALUE #define PWM_DEFAULT_CONFIG_TOP_VALUE 1000 #endif // PWM_DEFAULT_CONFIG_LOAD_MODE - Load mode - -// <0=> Common -// <1=> Grouped -// <2=> Individual -// <3=> Waveform + +// <0=> Common +// <1=> Grouped +// <2=> Individual +// <3=> Waveform #ifndef PWM_DEFAULT_CONFIG_LOAD_MODE #define PWM_DEFAULT_CONFIG_LOAD_MODE 0 #endif // PWM_DEFAULT_CONFIG_STEP_MODE - Step mode - -// <0=> Auto -// <1=> Triggered + +// <0=> Auto +// <1=> Triggered #ifndef PWM_DEFAULT_CONFIG_STEP_MODE #define PWM_DEFAULT_CONFIG_STEP_MODE 0 #endif // PWM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef PWM_DEFAULT_CONFIG_IRQ_PRIORITY #define PWM_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // PWM0_ENABLED - Enable PWM0 instance - + #ifndef PWM0_ENABLED #define PWM0_ENABLED 1 #endif // PWM1_ENABLED - Enable PWM1 instance - + #ifndef PWM1_ENABLED #define PWM1_ENABLED 1 #endif // PWM2_ENABLED - Enable PWM2 instance - + #ifndef PWM2_ENABLED #define PWM2_ENABLED 1 #endif // PWM3_ENABLED - Enable PWM3 instance - + #ifndef PWM3_ENABLED #define PWM3_ENABLED 0 @@ -2296,96 +2296,96 @@ #define QDEC_ENABLED 0 #endif // QDEC_CONFIG_REPORTPER - Report period - -// <0=> 10 Samples -// <1=> 40 Samples -// <2=> 80 Samples -// <3=> 120 Samples -// <4=> 160 Samples -// <5=> 200 Samples -// <6=> 240 Samples -// <7=> 280 Samples + +// <0=> 10 Samples +// <1=> 40 Samples +// <2=> 80 Samples +// <3=> 120 Samples +// <4=> 160 Samples +// <5=> 200 Samples +// <6=> 240 Samples +// <7=> 280 Samples #ifndef QDEC_CONFIG_REPORTPER #define QDEC_CONFIG_REPORTPER 0 #endif // QDEC_CONFIG_SAMPLEPER - Sample period - -// <0=> 128 us -// <1=> 256 us -// <2=> 512 us -// <3=> 1024 us -// <4=> 2048 us -// <5=> 4096 us -// <6=> 8192 us -// <7=> 16384 us + +// <0=> 128 us +// <1=> 256 us +// <2=> 512 us +// <3=> 1024 us +// <4=> 2048 us +// <5=> 4096 us +// <6=> 8192 us +// <7=> 16384 us #ifndef QDEC_CONFIG_SAMPLEPER #define QDEC_CONFIG_SAMPLEPER 7 #endif -// QDEC_CONFIG_PIO_A - A pin <0-31> +// QDEC_CONFIG_PIO_A - A pin <0-31> #ifndef QDEC_CONFIG_PIO_A #define QDEC_CONFIG_PIO_A 31 #endif -// QDEC_CONFIG_PIO_B - B pin <0-31> +// QDEC_CONFIG_PIO_B - B pin <0-31> #ifndef QDEC_CONFIG_PIO_B #define QDEC_CONFIG_PIO_B 31 #endif -// QDEC_CONFIG_PIO_LED - LED pin <0-31> +// QDEC_CONFIG_PIO_LED - LED pin <0-31> #ifndef QDEC_CONFIG_PIO_LED #define QDEC_CONFIG_PIO_LED 31 #endif -// QDEC_CONFIG_LEDPRE - LED pre +// QDEC_CONFIG_LEDPRE - LED pre #ifndef QDEC_CONFIG_LEDPRE #define QDEC_CONFIG_LEDPRE 511 #endif // QDEC_CONFIG_LEDPOL - LED polarity - -// <0=> Active low -// <1=> Active high + +// <0=> Active low +// <1=> Active high #ifndef QDEC_CONFIG_LEDPOL #define QDEC_CONFIG_LEDPOL 1 #endif // QDEC_CONFIG_DBFEN - Debouncing enable - + #ifndef QDEC_CONFIG_DBFEN #define QDEC_CONFIG_DBFEN 0 #endif // QDEC_CONFIG_SAMPLE_INTEN - Sample ready interrupt enable - + #ifndef QDEC_CONFIG_SAMPLE_INTEN #define QDEC_CONFIG_SAMPLE_INTEN 0 #endif // QDEC_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef QDEC_CONFIG_IRQ_PRIORITY #define QDEC_CONFIG_IRQ_PRIORITY 7 @@ -2399,29 +2399,29 @@ #define RNG_ENABLED 1 #endif // RNG_CONFIG_ERROR_CORRECTION - Error correction - + #ifndef RNG_CONFIG_ERROR_CORRECTION #define RNG_CONFIG_ERROR_CORRECTION 1 #endif -// RNG_CONFIG_POOL_SIZE - Pool size +// RNG_CONFIG_POOL_SIZE - Pool size #ifndef RNG_CONFIG_POOL_SIZE #define RNG_CONFIG_POOL_SIZE 64 #endif // RNG_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef RNG_CONFIG_IRQ_PRIORITY #define RNG_CONFIG_IRQ_PRIORITY 7 @@ -2434,7 +2434,7 @@ #ifndef RTC_ENABLED #define RTC_ENABLED 0 #endif -// RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768> +// RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768> #ifndef RTC_DEFAULT_CONFIG_FREQUENCY @@ -2442,51 +2442,51 @@ #endif // RTC_DEFAULT_CONFIG_RELIABLE - Ensures safe compare event triggering - + #ifndef RTC_DEFAULT_CONFIG_RELIABLE #define RTC_DEFAULT_CONFIG_RELIABLE 0 #endif // RTC_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef RTC_DEFAULT_CONFIG_IRQ_PRIORITY #define RTC_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // RTC0_ENABLED - Enable RTC0 instance - + #ifndef RTC0_ENABLED #define RTC0_ENABLED 0 #endif // RTC1_ENABLED - Enable RTC1 instance - + #ifndef RTC1_ENABLED #define RTC1_ENABLED 0 #endif // RTC2_ENABLED - Enable RTC2 instance - + #ifndef RTC2_ENABLED #define RTC2_ENABLED 0 #endif -// NRF_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt +// NRF_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt #ifndef NRF_MAXIMUM_LATENCY_US #define NRF_MAXIMUM_LATENCY_US 2000 #endif @@ -2499,51 +2499,51 @@ #define SAADC_ENABLED 1 #endif // SAADC_CONFIG_RESOLUTION - Resolution - -// <0=> 8 bit -// <1=> 10 bit -// <2=> 12 bit -// <3=> 14 bit + +// <0=> 8 bit +// <1=> 10 bit +// <2=> 12 bit +// <3=> 14 bit #ifndef SAADC_CONFIG_RESOLUTION #define SAADC_CONFIG_RESOLUTION 2 #endif // SAADC_CONFIG_OVERSAMPLE - Sample period - -// <0=> Disabled -// <1=> 2x -// <2=> 4x -// <3=> 8x -// <4=> 16x -// <5=> 32x -// <6=> 64x -// <7=> 128x -// <8=> 256x + +// <0=> Disabled +// <1=> 2x +// <2=> 4x +// <3=> 8x +// <4=> 16x +// <5=> 32x +// <6=> 64x +// <7=> 128x +// <8=> 256x #ifndef SAADC_CONFIG_OVERSAMPLE #define SAADC_CONFIG_OVERSAMPLE 0 #endif // SAADC_CONFIG_LP_MODE - Enabling low power mode - + #ifndef SAADC_CONFIG_LP_MODE #define SAADC_CONFIG_LP_MODE 0 #endif // SAADC_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef SAADC_CONFIG_IRQ_PRIORITY #define SAADC_CONFIG_IRQ_PRIORITY 7 @@ -2557,50 +2557,50 @@ #define SPIS_ENABLED 1 #endif // SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef SPIS_DEFAULT_CONFIG_IRQ_PRIORITY #define SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // SPIS_DEFAULT_MODE - Mode - -// <0=> MODE_0 -// <1=> MODE_1 -// <2=> MODE_2 -// <3=> MODE_3 + +// <0=> MODE_0 +// <1=> MODE_1 +// <2=> MODE_2 +// <3=> MODE_3 #ifndef SPIS_DEFAULT_MODE #define SPIS_DEFAULT_MODE 0 #endif // SPIS_DEFAULT_BIT_ORDER - SPIS default bit order - -// <0=> MSB first -// <1=> LSB first + +// <0=> MSB first +// <1=> LSB first #ifndef SPIS_DEFAULT_BIT_ORDER #define SPIS_DEFAULT_BIT_ORDER 0 #endif -// SPIS_DEFAULT_DEF - SPIS default DEF character <0-255> +// SPIS_DEFAULT_DEF - SPIS default DEF character <0-255> #ifndef SPIS_DEFAULT_DEF #define SPIS_DEFAULT_DEF 255 #endif -// SPIS_DEFAULT_ORC - SPIS default ORC character <0-255> +// SPIS_DEFAULT_ORC - SPIS default ORC character <0-255> #ifndef SPIS_DEFAULT_ORC @@ -2608,21 +2608,21 @@ #endif // SPIS0_ENABLED - Enable SPIS0 instance - + #ifndef SPIS0_ENABLED #define SPIS0_ENABLED 1 #endif // SPIS1_ENABLED - Enable SPIS1 instance - + #ifndef SPIS1_ENABLED #define SPIS1_ENABLED 0 #endif // SPIS2_ENABLED - Enable SPIS2 instance - + #ifndef SPIS2_ENABLED #define SPIS2_ENABLED 0 @@ -2636,27 +2636,27 @@ #define SPI_ENABLED 1 #endif // SPI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef SPI_DEFAULT_CONFIG_IRQ_PRIORITY #define SPI_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // NRF_SPI_DRV_MISO_PULLUP_CFG - MISO PIN pull-up configuration. - -// <0=> NRF_GPIO_PIN_NOPULL -// <1=> NRF_GPIO_PIN_PULLDOWN -// <3=> NRF_GPIO_PIN_PULLUP + +// <0=> NRF_GPIO_PIN_NOPULL +// <1=> NRF_GPIO_PIN_PULLDOWN +// <3=> NRF_GPIO_PIN_PULLUP #ifndef NRF_SPI_DRV_MISO_PULLUP_CFG #define NRF_SPI_DRV_MISO_PULLUP_CFG 1 @@ -2668,21 +2668,21 @@ #define SPI0_ENABLED 1 #endif // SPI0_USE_EASY_DMA - Use EasyDMA - + #ifndef SPI0_USE_EASY_DMA #define SPI0_USE_EASY_DMA 0 #endif // SPI0_DEFAULT_FREQUENCY - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz + +// <33554432=> 125 kHz +// <67108864=> 250 kHz +// <134217728=> 500 kHz +// <268435456=> 1 MHz +// <536870912=> 2 MHz +// <1073741824=> 4 MHz +// <2147483648=> 8 MHz #ifndef SPI0_DEFAULT_FREQUENCY #define SPI0_DEFAULT_FREQUENCY 1073741824 @@ -2696,21 +2696,21 @@ #define SPI1_ENABLED 1 #endif // SPI1_USE_EASY_DMA - Use EasyDMA - + #ifndef SPI1_USE_EASY_DMA #define SPI1_USE_EASY_DMA 0 #endif // SPI1_DEFAULT_FREQUENCY - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz + +// <33554432=> 125 kHz +// <67108864=> 250 kHz +// <134217728=> 500 kHz +// <268435456=> 1 MHz +// <536870912=> 2 MHz +// <1073741824=> 4 MHz +// <2147483648=> 8 MHz #ifndef SPI1_DEFAULT_FREQUENCY #define SPI1_DEFAULT_FREQUENCY 1073741824 @@ -2724,21 +2724,21 @@ #define SPI2_ENABLED 1 #endif // SPI2_USE_EASY_DMA - Use EasyDMA - + #ifndef SPI2_USE_EASY_DMA #define SPI2_USE_EASY_DMA 0 #endif // SPI2_DEFAULT_FREQUENCY - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz + +// <33554432=> 125 kHz +// <67108864=> 250 kHz +// <134217728=> 500 kHz +// <268435456=> 1 MHz +// <536870912=> 2 MHz +// <1073741824=> 4 MHz +// <2147483648=> 8 MHz #ifndef SPI2_DEFAULT_FREQUENCY #define SPI2_DEFAULT_FREQUENCY 1073741824 @@ -2754,89 +2754,89 @@ #define TIMER_ENABLED 0 #endif // TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz -// <8=> 62.5 kHz -// <9=> 31.25 kHz + +// <0=> 16 MHz +// <1=> 8 MHz +// <2=> 4 MHz +// <3=> 2 MHz +// <4=> 1 MHz +// <5=> 500 kHz +// <6=> 250 kHz +// <7=> 125 kHz +// <8=> 62.5 kHz +// <9=> 31.25 kHz #ifndef TIMER_DEFAULT_CONFIG_FREQUENCY #define TIMER_DEFAULT_CONFIG_FREQUENCY 0 #endif // TIMER_DEFAULT_CONFIG_MODE - Timer mode or operation - -// <0=> Timer -// <1=> Counter + +// <0=> Timer +// <1=> Counter #ifndef TIMER_DEFAULT_CONFIG_MODE #define TIMER_DEFAULT_CONFIG_MODE 0 #endif // TIMER_DEFAULT_CONFIG_BIT_WIDTH - Timer counter bit width - -// <0=> 16 bit -// <1=> 8 bit -// <2=> 24 bit -// <3=> 32 bit + +// <0=> 16 bit +// <1=> 8 bit +// <2=> 24 bit +// <3=> 32 bit #ifndef TIMER_DEFAULT_CONFIG_BIT_WIDTH #define TIMER_DEFAULT_CONFIG_BIT_WIDTH 0 #endif // TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef TIMER_DEFAULT_CONFIG_IRQ_PRIORITY #define TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // TIMER0_ENABLED - Enable TIMER0 instance - + #ifndef TIMER0_ENABLED #define TIMER0_ENABLED 0 #endif // TIMER1_ENABLED - Enable TIMER1 instance - + #ifndef TIMER1_ENABLED #define TIMER1_ENABLED 0 #endif // TIMER2_ENABLED - Enable TIMER2 instance - + #ifndef TIMER2_ENABLED #define TIMER2_ENABLED 0 #endif // TIMER3_ENABLED - Enable TIMER3 instance - + #ifndef TIMER3_ENABLED #define TIMER3_ENABLED 0 #endif // TIMER4_ENABLED - Enable TIMER4 instance - + #ifndef TIMER4_ENABLED #define TIMER4_ENABLED 0 @@ -2849,69 +2849,69 @@ #ifndef TWIS_ENABLED #define TWIS_ENABLED 0 #endif -// TWIS_DEFAULT_CONFIG_ADDR0 - Address0 +// TWIS_DEFAULT_CONFIG_ADDR0 - Address0 #ifndef TWIS_DEFAULT_CONFIG_ADDR0 #define TWIS_DEFAULT_CONFIG_ADDR0 0 #endif -// TWIS_DEFAULT_CONFIG_ADDR1 - Address1 +// TWIS_DEFAULT_CONFIG_ADDR1 - Address1 #ifndef TWIS_DEFAULT_CONFIG_ADDR1 #define TWIS_DEFAULT_CONFIG_ADDR1 0 #endif // TWIS_DEFAULT_CONFIG_SCL_PULL - SCL pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up + +// <0=> Disabled +// <1=> Pull down +// <3=> Pull up #ifndef TWIS_DEFAULT_CONFIG_SCL_PULL #define TWIS_DEFAULT_CONFIG_SCL_PULL 0 #endif // TWIS_DEFAULT_CONFIG_SDA_PULL - SDA pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up + +// <0=> Disabled +// <1=> Pull down +// <3=> Pull up #ifndef TWIS_DEFAULT_CONFIG_SDA_PULL #define TWIS_DEFAULT_CONFIG_SDA_PULL 0 #endif // TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef TWIS_DEFAULT_CONFIG_IRQ_PRIORITY #define TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // TWIS0_ENABLED - Enable TWIS0 instance - + #ifndef TWIS0_ENABLED #define TWIS0_ENABLED 0 #endif // TWIS1_ENABLED - Enable TWIS1 instance - + #ifndef TWIS1_ENABLED #define TWIS1_ENABLED 0 #endif // TWIS_ASSUME_INIT_AFTER_RESET_ONLY - Assume that any instance would be initialized only once - + // Optimization flag. Registers used by TWIS are shared by other peripherals. Normally, during initialization driver tries to clear all registers to known state before doing the initialization itself. This gives initialization safe procedure, no matter when it would be called. If you activate TWIS only once and do never uninitialize it - set this flag to 1 what gives more optimal code. @@ -2920,7 +2920,7 @@ #endif // TWIS_NO_SYNC_MODE - Remove support for synchronous mode - + // Synchronous mode would be used in specific situations. And it uses some additional code and data memory to safely process state machine by polling it in status functions. If this functionality is not required it may be disabled to free some resources. @@ -2936,41 +2936,41 @@ #define TWI_ENABLED 1 #endif // TWI_DEFAULT_CONFIG_FREQUENCY - Frequency - -// <26738688=> 100k -// <67108864=> 250k -// <104857600=> 400k + +// <26738688=> 100k +// <67108864=> 250k +// <104857600=> 400k #ifndef TWI_DEFAULT_CONFIG_FREQUENCY #define TWI_DEFAULT_CONFIG_FREQUENCY 26738688 #endif // TWI_DEFAULT_CONFIG_CLR_BUS_INIT - Enables bus clearing procedure during init - + #ifndef TWI_DEFAULT_CONFIG_CLR_BUS_INIT #define TWI_DEFAULT_CONFIG_CLR_BUS_INIT 0 #endif // TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit - + #ifndef TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT #define TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 #endif // TWI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef TWI_DEFAULT_CONFIG_IRQ_PRIORITY #define TWI_DEFAULT_CONFIG_IRQ_PRIORITY 7 @@ -2982,7 +2982,7 @@ #define TWI0_ENABLED 1 #endif // TWI0_USE_EASY_DMA - Use EasyDMA (if present) - + #ifndef TWI0_USE_EASY_DMA #define TWI0_USE_EASY_DMA 0 @@ -2996,7 +2996,7 @@ #define TWI1_ENABLED 1 #endif // TWI1_USE_EASY_DMA - Use EasyDMA (if present) - + #ifndef TWI1_USE_EASY_DMA #define TWI1_USE_EASY_DMA 0 @@ -3012,72 +3012,72 @@ #define UART_ENABLED 1 #endif // UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled + +// <0=> Disabled +// <1=> Enabled #ifndef UART_DEFAULT_CONFIG_HWFC #define UART_DEFAULT_CONFIG_HWFC 1 #endif // UART_DEFAULT_CONFIG_PARITY - Parity - -// <0=> Excluded -// <14=> Included + +// <0=> Excluded +// <14=> Included #ifndef UART_DEFAULT_CONFIG_PARITY #define UART_DEFAULT_CONFIG_PARITY 0 #endif // UART_DEFAULT_CONFIG_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud + +// <323584=> 1200 baud +// <643072=> 2400 baud +// <1290240=> 4800 baud +// <2576384=> 9600 baud +// <3862528=> 14400 baud +// <5152768=> 19200 baud +// <7716864=> 28800 baud +// <10289152=> 38400 baud +// <15400960=> 57600 baud +// <20615168=> 76800 baud +// <30801920=> 115200 baud +// <61865984=> 230400 baud +// <67108864=> 250000 baud +// <121634816=> 460800 baud +// <251658240=> 921600 baud +// <268435456=> 1000000 baud #ifndef UART_DEFAULT_CONFIG_BAUDRATE #define UART_DEFAULT_CONFIG_BAUDRATE 2576384 #endif // UART_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef UART_DEFAULT_CONFIG_IRQ_PRIORITY #define UART_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // UART_EASY_DMA_SUPPORT - Driver supporting EasyDMA - + #ifndef UART_EASY_DMA_SUPPORT #define UART_EASY_DMA_SUPPORT 1 #endif // UART_LEGACY_SUPPORT - Driver supporting Legacy mode - + #ifndef UART_LEGACY_SUPPORT #define UART_LEGACY_SUPPORT 1 @@ -3089,7 +3089,7 @@ #define UART0_ENABLED 1 #endif // UART0_CONFIG_USE_EASY_DMA - Default setting for using EasyDMA - + #ifndef UART0_CONFIG_USE_EASY_DMA #define UART0_CONFIG_USE_EASY_DMA 1 @@ -3103,7 +3103,7 @@ #define UART1_ENABLED 0 #endif // UART1_CONFIG_USE_EASY_DMA - Default setting for using EasyDMA - + #ifndef UART1_CONFIG_USE_EASY_DMA #define UART1_CONFIG_USE_EASY_DMA 1 @@ -3119,26 +3119,26 @@ #define USBD_ENABLED 0 #endif // USBD_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef USBD_CONFIG_IRQ_PRIORITY #define USBD_CONFIG_IRQ_PRIORITY 7 #endif // NRF_DRV_USBD_DMASCHEDULER_MODE - USBD SMA scheduler working scheme - -// <0=> Prioritized access -// <1=> Round Robin + +// <0=> Prioritized access +// <1=> Round Robin #ifndef NRF_DRV_USBD_DMASCHEDULER_MODE #define NRF_DRV_USBD_DMASCHEDULER_MODE 0 @@ -3152,17 +3152,17 @@ #define WDT_ENABLED 0 #endif // WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode - -// <1=> Run in SLEEP, Pause in HALT -// <8=> Pause in SLEEP, Run in HALT -// <9=> Run in SLEEP and HALT -// <0=> Pause in SLEEP and HALT + +// <1=> Run in SLEEP, Pause in HALT +// <8=> Pause in SLEEP, Run in HALT +// <9=> Run in SLEEP and HALT +// <0=> Pause in SLEEP and HALT #ifndef WDT_CONFIG_BEHAVIOUR #define WDT_CONFIG_BEHAVIOUR 1 #endif -// WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> +// WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> #ifndef WDT_CONFIG_RELOAD_VALUE @@ -3170,17 +3170,17 @@ #endif // WDT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef WDT_CONFIG_IRQ_PRIORITY #define WDT_CONFIG_IRQ_PRIORITY 7 @@ -3188,21 +3188,21 @@ // -// +// //========================================================== -// nRF_Libraries +// nRF_Libraries //========================================================== // APP_GPIOTE_ENABLED - app_gpiote - GPIOTE events dispatcher - + #ifndef APP_GPIOTE_ENABLED #define APP_GPIOTE_ENABLED 0 #endif // APP_PWM_ENABLED - app_pwm - PWM functionality - + #ifndef APP_PWM_ENABLED #define APP_PWM_ENABLED 0 @@ -3214,14 +3214,14 @@ #define APP_SCHEDULER_ENABLED 0 #endif // APP_SCHEDULER_WITH_PAUSE - Enabling pause feature - + #ifndef APP_SCHEDULER_WITH_PAUSE #define APP_SCHEDULER_WITH_PAUSE 0 #endif // APP_SCHEDULER_WITH_PROFILER - Enabling scheduler profiling - + #ifndef APP_SCHEDULER_WITH_PROFILER #define APP_SCHEDULER_WITH_PROFILER 0 @@ -3235,36 +3235,36 @@ #define APP_TIMER_ENABLED 0 #endif // APP_TIMER_CONFIG_RTC_FREQUENCY - Configure RTC prescaler. - -// <0=> 32768 Hz -// <1=> 16384 Hz -// <3=> 8192 Hz -// <7=> 4096 Hz -// <15=> 2048 Hz -// <31=> 1024 Hz + +// <0=> 32768 Hz +// <1=> 16384 Hz +// <3=> 8192 Hz +// <7=> 4096 Hz +// <15=> 2048 Hz +// <31=> 1024 Hz #ifndef APP_TIMER_CONFIG_RTC_FREQUENCY #define APP_TIMER_CONFIG_RTC_FREQUENCY 0 #endif // APP_TIMER_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef APP_TIMER_CONFIG_IRQ_PRIORITY #define APP_TIMER_CONFIG_IRQ_PRIORITY 7 #endif -// APP_TIMER_CONFIG_OP_QUEUE_SIZE - Capacity of timer requests queue. +// APP_TIMER_CONFIG_OP_QUEUE_SIZE - Capacity of timer requests queue. // Size of the queue depends on how many timers are used // in the system, how often timers are started and overall // system latency. If queue size is too small app_timer calls @@ -3275,21 +3275,21 @@ #endif // APP_TIMER_CONFIG_USE_SCHEDULER - Enable scheduling app_timer events to app_scheduler - + #ifndef APP_TIMER_CONFIG_USE_SCHEDULER #define APP_TIMER_CONFIG_USE_SCHEDULER 0 #endif // APP_TIMER_WITH_PROFILER - Enable app_timer profiling - + #ifndef APP_TIMER_WITH_PROFILER #define APP_TIMER_WITH_PROFILER 0 #endif // APP_TIMER_KEEPS_RTC_ACTIVE - Enable RTC always on - + // If option is enabled RTC is kept running even if there is no active timers. // This option can be used when app_timer is used for timestamping. @@ -3299,9 +3299,9 @@ #endif // APP_TIMER_CONFIG_SWI_NUMBER - Configure SWI instance used. - -// <0=> 0 -// <1=> 1 + +// <0=> 0 +// <1=> 1 #ifndef APP_TIMER_CONFIG_SWI_NUMBER #define APP_TIMER_CONFIG_SWI_NUMBER 0 @@ -3310,7 +3310,7 @@ // // NRF_TWI_MNGR_ENABLED - nrf_twi_mngr - TWI transaction manager - + #ifndef NRF_TWI_MNGR_ENABLED #define NRF_TWI_MNGR_ENABLED 0 @@ -3322,8 +3322,8 @@ #define APP_UART_ENABLED 0 #endif // APP_UART_DRIVER_INSTANCE - UART instance used - -// <0=> 0 + +// <0=> 0 #ifndef APP_UART_DRIVER_INSTANCE #define APP_UART_DRIVER_INSTANCE 0 @@ -3332,77 +3332,77 @@ // // APP_USBD_CLASS_AUDIO_ENABLED - app_usbd_audio - USB AUDIO class - + #ifndef APP_USBD_CLASS_AUDIO_ENABLED #define APP_USBD_CLASS_AUDIO_ENABLED 0 #endif // APP_USBD_CLASS_CDC_ACM_ENABLED - app_usbd_cdc_acm - USB CDC ACM class - + #ifndef APP_USBD_CLASS_CDC_ACM_ENABLED #define APP_USBD_CLASS_CDC_ACM_ENABLED 0 #endif // APP_USBD_CLASS_HID_ENABLED - app_usbd_hid - USB HID class - + #ifndef APP_USBD_CLASS_HID_ENABLED #define APP_USBD_CLASS_HID_ENABLED 0 #endif // APP_USBD_HID_GENERIC_ENABLED - app_usbd_hid_generic - USB HID generic - + #ifndef APP_USBD_HID_GENERIC_ENABLED #define APP_USBD_HID_GENERIC_ENABLED 0 #endif // APP_USBD_HID_KBD_ENABLED - app_usbd_hid_kbd - USB HID keyboard - + #ifndef APP_USBD_HID_KBD_ENABLED #define APP_USBD_HID_KBD_ENABLED 0 #endif // APP_USBD_HID_MOUSE_ENABLED - app_usbd_hid_mouse - USB HID mouse - + #ifndef APP_USBD_HID_MOUSE_ENABLED #define APP_USBD_HID_MOUSE_ENABLED 0 #endif // APP_USBD_MSC_ENABLED - app_usbd_msc - USB MSC class - + #ifndef APP_USBD_MSC_ENABLED #define APP_USBD_MSC_ENABLED 0 #endif // BUTTON_ENABLED - app_button - buttons handling module - + #ifndef BUTTON_ENABLED #define BUTTON_ENABLED 0 #endif // CRC16_ENABLED - crc16 - CRC16 calculation routines - + #ifndef CRC16_ENABLED #define CRC16_ENABLED 0 #endif // CRC32_ENABLED - crc32 - CRC32 calculation routines - + #ifndef CRC32_ENABLED #define CRC32_ENABLED 0 #endif // ECC_ENABLED - ecc - Elliptic Curve Cryptography Library - + #ifndef ECC_ENABLED #define ECC_ENABLED 0 @@ -3417,7 +3417,7 @@ // Configure the number of virtual pages to use and their size. //========================================================== -// FDS_VIRTUAL_PAGES - Number of virtual flash pages to use. +// FDS_VIRTUAL_PAGES - Number of virtual flash pages to use. // One of the virtual pages is reserved by the system for garbage collection. // Therefore, the minimum is two virtual pages: one page to store data and one page to be used by the system for garbage collection. // The total amount of flash memory that is used by FDS amounts to @ref FDS_VIRTUAL_PAGES * @ref FDS_VIRTUAL_PAGE_SIZE * 4 bytes. @@ -3427,19 +3427,19 @@ #endif // FDS_VIRTUAL_PAGE_SIZE - The size of a virtual flash page. - + // Expressed in number of 4-byte words. // By default, a virtual page is the same size as a physical page. // The size of a virtual page must be a multiple of the size of a physical page. -// <1024=> 1024 -// <2048=> 2048 +// <1024=> 1024 +// <2048=> 2048 #ifndef FDS_VIRTUAL_PAGE_SIZE #define FDS_VIRTUAL_PAGE_SIZE 1024 #endif -// +// //========================================================== // Backend - Backend configuration @@ -3447,31 +3447,31 @@ // Configure which nrf_fstorage backend is used by FDS to write to flash. //========================================================== // FDS_BACKEND - FDS flash backend. - + // NRF_FSTORAGE_SD uses the nrf_fstorage_sd backend implementation using the SoftDevice API. Use this if you have a SoftDevice present. // NRF_FSTORAGE_NVMC uses the nrf_fstorage_nvmc implementation. Use this setting if you don't use the SoftDevice. -// <1=> NRF_FSTORAGE_NVMC -// <2=> NRF_FSTORAGE_SD +// <1=> NRF_FSTORAGE_NVMC +// <2=> NRF_FSTORAGE_SD #ifndef FDS_BACKEND #define FDS_BACKEND 1 #endif -// +// //========================================================== // Queue - Queue settings //========================================================== -// FDS_OP_QUEUE_SIZE - Size of the internal queue. +// FDS_OP_QUEUE_SIZE - Size of the internal queue. // Increase this value if you frequently get synchronous FDS_ERR_NO_SPACE_IN_QUEUES errors. #ifndef FDS_OP_QUEUE_SIZE #define FDS_OP_QUEUE_SIZE 4 #endif -// +// //========================================================== // CRC - CRC functionality @@ -3487,12 +3487,12 @@ #define FDS_CRC_CHECK_ON_READ 0 #endif // FDS_CRC_CHECK_ON_WRITE - Perform a CRC check on newly written records. - + // Perform a CRC check on newly written records. // This setting can be used to make sure that the record data was not altered while being written to flash. -// <1=> Enabled -// <0=> Disabled +// <1=> Enabled +// <0=> Disabled #ifndef FDS_CRC_CHECK_ON_WRITE #define FDS_CRC_CHECK_ON_WRITE 0 @@ -3500,18 +3500,18 @@ // -// +// //========================================================== // Users - Number of users //========================================================== -// FDS_MAX_USERS - Maximum number of callbacks that can be registered. +// FDS_MAX_USERS - Maximum number of callbacks that can be registered. #ifndef FDS_MAX_USERS #define FDS_MAX_USERS 4 #endif -// +// //========================================================== // @@ -3522,7 +3522,7 @@ #define HARDFAULT_HANDLER_ENABLED 0 #endif // HARDFAULT_HANDLER_GDB_PSP_BACKTRACE - Bypass the GDB problem with multiple stack pointers backtrace - + // There is a known bug in GDB which causes it to incorrectly backtrace the code // when multiple stack pointers are used (main and process stack pointers). @@ -3543,17 +3543,17 @@ #ifndef HCI_MEM_POOL_ENABLED #define HCI_MEM_POOL_ENABLED 0 #endif -// HCI_TX_BUF_SIZE - TX buffer size in bytes. +// HCI_TX_BUF_SIZE - TX buffer size in bytes. #ifndef HCI_TX_BUF_SIZE #define HCI_TX_BUF_SIZE 600 #endif -// HCI_RX_BUF_SIZE - RX buffer size in bytes. +// HCI_RX_BUF_SIZE - RX buffer size in bytes. #ifndef HCI_RX_BUF_SIZE #define HCI_RX_BUF_SIZE 600 #endif -// HCI_RX_BUF_QUEUE_SIZE - RX buffer queue size. +// HCI_RX_BUF_QUEUE_SIZE - RX buffer queue size. #ifndef HCI_RX_BUF_QUEUE_SIZE #define HCI_RX_BUF_QUEUE_SIZE 4 #endif @@ -3566,53 +3566,53 @@ #define HCI_SLIP_ENABLED 0 #endif // HCI_UART_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud + +// <323584=> 1200 baud +// <643072=> 2400 baud +// <1290240=> 4800 baud +// <2576384=> 9600 baud +// <3862528=> 14400 baud +// <5152768=> 19200 baud +// <7716864=> 28800 baud +// <10289152=> 38400 baud +// <15400960=> 57600 baud +// <20615168=> 76800 baud +// <30801920=> 115200 baud +// <61865984=> 230400 baud +// <67108864=> 250000 baud +// <121634816=> 460800 baud +// <251658240=> 921600 baud +// <268435456=> 1000000 baud #ifndef HCI_UART_BAUDRATE #define HCI_UART_BAUDRATE 30801920 #endif // HCI_UART_FLOW_CONTROL - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled + +// <0=> Disabled +// <1=> Enabled #ifndef HCI_UART_FLOW_CONTROL #define HCI_UART_FLOW_CONTROL 0 #endif -// HCI_UART_RX_PIN - UART RX pin +// HCI_UART_RX_PIN - UART RX pin #ifndef HCI_UART_RX_PIN #define HCI_UART_RX_PIN 8 #endif -// HCI_UART_TX_PIN - UART TX pin +// HCI_UART_TX_PIN - UART TX pin #ifndef HCI_UART_TX_PIN #define HCI_UART_TX_PIN 6 #endif -// HCI_UART_RTS_PIN - UART RTS pin +// HCI_UART_RTS_PIN - UART RTS pin #ifndef HCI_UART_RTS_PIN #define HCI_UART_RTS_PIN 5 #endif -// HCI_UART_CTS_PIN - UART CTS pin +// HCI_UART_CTS_PIN - UART CTS pin #ifndef HCI_UART_CTS_PIN #define HCI_UART_CTS_PIN 7 #endif @@ -3624,7 +3624,7 @@ #ifndef HCI_TRANSPORT_ENABLED #define HCI_TRANSPORT_ENABLED 0 #endif -// HCI_MAX_PACKET_SIZE_IN_BITS - Maximum size of a single application packet in bits. +// HCI_MAX_PACKET_SIZE_IN_BITS - Maximum size of a single application packet in bits. #ifndef HCI_MAX_PACKET_SIZE_IN_BITS #define HCI_MAX_PACKET_SIZE_IN_BITS 8000 #endif @@ -3632,14 +3632,14 @@ // // LED_SOFTBLINK_ENABLED - led_softblink - led_softblink module - + #ifndef LED_SOFTBLINK_ENABLED #define LED_SOFTBLINK_ENABLED 0 #endif // LOW_POWER_PWM_ENABLED - low_power_pwm - low_power_pwm module - + #ifndef LOW_POWER_PWM_ENABLED #define LOW_POWER_PWM_ENABLED 0 @@ -3650,98 +3650,98 @@ #ifndef MEM_MANAGER_ENABLED #define MEM_MANAGER_ENABLED 0 #endif -// MEMORY_MANAGER_SMALL_BLOCK_COUNT - Size of each memory blocks identified as 'small' block. <0-255> +// MEMORY_MANAGER_SMALL_BLOCK_COUNT - Size of each memory blocks identified as 'small' block. <0-255> #ifndef MEMORY_MANAGER_SMALL_BLOCK_COUNT #define MEMORY_MANAGER_SMALL_BLOCK_COUNT 1 #endif -// MEMORY_MANAGER_SMALL_BLOCK_SIZE - Size of each memory blocks identified as 'small' block. +// MEMORY_MANAGER_SMALL_BLOCK_SIZE - Size of each memory blocks identified as 'small' block. // Size of each memory blocks identified as 'small' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_SMALL_BLOCK_SIZE #define MEMORY_MANAGER_SMALL_BLOCK_SIZE 32 #endif -// MEMORY_MANAGER_MEDIUM_BLOCK_COUNT - Size of each memory blocks identified as 'medium' block. <0-255> +// MEMORY_MANAGER_MEDIUM_BLOCK_COUNT - Size of each memory blocks identified as 'medium' block. <0-255> #ifndef MEMORY_MANAGER_MEDIUM_BLOCK_COUNT #define MEMORY_MANAGER_MEDIUM_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_MEDIUM_BLOCK_SIZE - Size of each memory blocks identified as 'medium' block. +// MEMORY_MANAGER_MEDIUM_BLOCK_SIZE - Size of each memory blocks identified as 'medium' block. // Size of each memory blocks identified as 'medium' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_MEDIUM_BLOCK_SIZE #define MEMORY_MANAGER_MEDIUM_BLOCK_SIZE 256 #endif -// MEMORY_MANAGER_LARGE_BLOCK_COUNT - Size of each memory blocks identified as 'large' block. <0-255> +// MEMORY_MANAGER_LARGE_BLOCK_COUNT - Size of each memory blocks identified as 'large' block. <0-255> #ifndef MEMORY_MANAGER_LARGE_BLOCK_COUNT #define MEMORY_MANAGER_LARGE_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_LARGE_BLOCK_SIZE - Size of each memory blocks identified as 'large' block. +// MEMORY_MANAGER_LARGE_BLOCK_SIZE - Size of each memory blocks identified as 'large' block. // Size of each memory blocks identified as 'large' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_LARGE_BLOCK_SIZE #define MEMORY_MANAGER_LARGE_BLOCK_SIZE 256 #endif -// MEMORY_MANAGER_XLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra large' block. <0-255> +// MEMORY_MANAGER_XLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra large' block. <0-255> #ifndef MEMORY_MANAGER_XLARGE_BLOCK_COUNT #define MEMORY_MANAGER_XLARGE_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_XLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra large' block. +// MEMORY_MANAGER_XLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra large' block. // Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_XLARGE_BLOCK_SIZE #define MEMORY_MANAGER_XLARGE_BLOCK_SIZE 1320 #endif -// MEMORY_MANAGER_XXLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra large' block. <0-255> +// MEMORY_MANAGER_XXLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra large' block. <0-255> #ifndef MEMORY_MANAGER_XXLARGE_BLOCK_COUNT #define MEMORY_MANAGER_XXLARGE_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_XXLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra large' block. +// MEMORY_MANAGER_XXLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra large' block. // Size of each memory blocks identified as 'extra extra large' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_XXLARGE_BLOCK_SIZE #define MEMORY_MANAGER_XXLARGE_BLOCK_SIZE 3444 #endif -// MEMORY_MANAGER_XSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra small' block. <0-255> +// MEMORY_MANAGER_XSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra small' block. <0-255> #ifndef MEMORY_MANAGER_XSMALL_BLOCK_COUNT #define MEMORY_MANAGER_XSMALL_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_XSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra small' block. +// MEMORY_MANAGER_XSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra small' block. // Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_XSMALL_BLOCK_SIZE #define MEMORY_MANAGER_XSMALL_BLOCK_SIZE 64 #endif -// MEMORY_MANAGER_XXSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra small' block. <0-255> +// MEMORY_MANAGER_XXSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra small' block. <0-255> #ifndef MEMORY_MANAGER_XXSMALL_BLOCK_COUNT #define MEMORY_MANAGER_XXSMALL_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_XXSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra small' block. +// MEMORY_MANAGER_XXSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra small' block. // Size of each memory blocks identified as 'extra extra small' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_XXSMALL_BLOCK_SIZE @@ -3749,7 +3749,7 @@ #endif // MEM_MANAGER_DISABLE_API_PARAM_CHECK - Disable API parameter checks in the module. - + #ifndef MEM_MANAGER_DISABLE_API_PARAM_CHECK #define MEM_MANAGER_DISABLE_API_PARAM_CHECK 0 @@ -3767,14 +3767,14 @@ #ifndef NRF_BALLOC_CONFIG_DEBUG_ENABLED #define NRF_BALLOC_CONFIG_DEBUG_ENABLED 0 #endif -// NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS - Number of words used as head guard. <0-255> +// NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS - Number of words used as head guard. <0-255> #ifndef NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS #define NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS 1 #endif -// NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS - Number of words used as tail guard. <0-255> +// NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS - Number of words used as tail guard. <0-255> #ifndef NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS @@ -3782,21 +3782,21 @@ #endif // NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED - Enables basic checks in this module. - + #ifndef NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED #define NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED 0 #endif // NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED - Enables double memory free check in this module. - + #ifndef NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED #define NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED 0 #endif // NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED - Enables free memory corruption check in this module. - + #ifndef NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED #define NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED 0 @@ -3811,32 +3811,32 @@ #ifndef NRF_CSENSE_ENABLED #define NRF_CSENSE_ENABLED 0 #endif -// NRF_CSENSE_PAD_HYSTERESIS - Minimum value of change required to determine that a pad was touched. +// NRF_CSENSE_PAD_HYSTERESIS - Minimum value of change required to determine that a pad was touched. #ifndef NRF_CSENSE_PAD_HYSTERESIS #define NRF_CSENSE_PAD_HYSTERESIS 15 #endif -// NRF_CSENSE_PAD_DEVIATION - Minimum value measured on a pad required to take it into account while calculating the step. +// NRF_CSENSE_PAD_DEVIATION - Minimum value measured on a pad required to take it into account while calculating the step. #ifndef NRF_CSENSE_PAD_DEVIATION #define NRF_CSENSE_PAD_DEVIATION 70 #endif -// NRF_CSENSE_MIN_PAD_VALUE - Minimum normalized value on a pad required to take its value into account. +// NRF_CSENSE_MIN_PAD_VALUE - Minimum normalized value on a pad required to take its value into account. #ifndef NRF_CSENSE_MIN_PAD_VALUE #define NRF_CSENSE_MIN_PAD_VALUE 20 #endif -// NRF_CSENSE_MAX_PADS_NUMBER - Maximum number of pads used for one instance. +// NRF_CSENSE_MAX_PADS_NUMBER - Maximum number of pads used for one instance. #ifndef NRF_CSENSE_MAX_PADS_NUMBER #define NRF_CSENSE_MAX_PADS_NUMBER 20 #endif -// NRF_CSENSE_MAX_VALUE - Maximum normalized value obtained from measurement. +// NRF_CSENSE_MAX_VALUE - Maximum normalized value obtained from measurement. #ifndef NRF_CSENSE_MAX_VALUE #define NRF_CSENSE_MAX_VALUE 1000 #endif -// NRF_CSENSE_OUTPUT_PIN - Output pin used by the low-level module. +// NRF_CSENSE_OUTPUT_PIN - Output pin used by the low-level module. // This is used when capacitive sensor does not use COMP. #ifndef NRF_CSENSE_OUTPUT_PIN @@ -3857,17 +3857,17 @@ #ifndef USE_COMP #define USE_COMP 0 #endif -// TIMER0_FOR_CSENSE - First TIMER instance used by the driver (not used on nRF51). +// TIMER0_FOR_CSENSE - First TIMER instance used by the driver (not used on nRF51). #ifndef TIMER0_FOR_CSENSE #define TIMER0_FOR_CSENSE 1 #endif -// TIMER1_FOR_CSENSE - Second TIMER instance used by the driver (not used on nRF51). +// TIMER1_FOR_CSENSE - Second TIMER instance used by the driver (not used on nRF51). #ifndef TIMER1_FOR_CSENSE #define TIMER1_FOR_CSENSE 2 #endif -// MEASUREMENT_PERIOD - Single measurement period. +// MEASUREMENT_PERIOD - Single measurement period. // Time of a single measurement can be calculated as // T = (1/2)*MEASUREMENT_PERIOD*(1/f_OSC) where f_OSC = I_SOURCE / (2C*(VUP-VDOWN) ). // I_SOURCE, VUP, and VDOWN are values used to initialize COMP and C is the capacitance of the used pad. @@ -3881,7 +3881,7 @@ // // NRF_FPRINTF_ENABLED - nrf_fprintf - fprintf function. - + #ifndef NRF_FPRINTF_ENABLED #define NRF_FPRINTF_ENABLED 0 @@ -3896,14 +3896,14 @@ // Configuration options for the fstorage implementation using the SoftDevice. //========================================================== -// NRF_FSTORAGE_SD_QUEUE_SIZE - Size of the internal queue of operations. +// NRF_FSTORAGE_SD_QUEUE_SIZE - Size of the internal queue of operations. // Increase this value if API calls frequently return the error @ref NRF_ERROR_NO_MEM. #ifndef NRF_FSTORAGE_SD_QUEUE_SIZE #define NRF_FSTORAGE_SD_QUEUE_SIZE 4 #endif -// NRF_FSTORAGE_SD_MAX_RETRIES - Maximum number of attempts at executing an operation when the SoftDevice is busy. +// NRF_FSTORAGE_SD_MAX_RETRIES - Maximum number of attempts at executing an operation when the SoftDevice is busy. // Increase this value if events frequently return the @ref NRF_ERROR_TIMEOUT error. // The SoftDevice might fail to schedule flash access due to high BLE activity. @@ -3911,7 +3911,7 @@ #define NRF_FSTORAGE_SD_MAX_RETRIES 8 #endif -// NRF_FSTORAGE_SD_MAX_WRITE_SIZE - Maximum number of bytes to be written to flash in a single operation. +// NRF_FSTORAGE_SD_MAX_WRITE_SIZE - Maximum number of bytes to be written to flash in a single operation. // This value must be a multiple of four. // Lowering this value can increase the chances of the SoftDevice being able to execute flash operations in between radio activity. // This value is bound by the maximum number of bytes that can be written to flash in a single call to @ref sd_flash_write. @@ -3921,13 +3921,13 @@ #define NRF_FSTORAGE_SD_MAX_WRITE_SIZE 4096 #endif -// +// //========================================================== // // NRF_MEMOBJ_ENABLED - nrf_memobj - Linked memory allocator module - + #ifndef NRF_MEMOBJ_ENABLED #define NRF_MEMOBJ_ENABLED 0 @@ -3946,56 +3946,56 @@ #define NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED 0 #endif // NRF_PWR_MGMT_SLEEP_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef NRF_PWR_MGMT_SLEEP_DEBUG_PIN #define NRF_PWR_MGMT_SLEEP_DEBUG_PIN 31 @@ -4004,7 +4004,7 @@ // // NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED - Enables CPU usage monitor. - + // Module will trace percentage of CPU usage in one second intervals. @@ -4017,7 +4017,7 @@ #ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED #define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED 0 #endif -// NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S - Standby timeout (in seconds). +// NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S - Standby timeout (in seconds). // Shutdown procedure will begin no earlier than after this number of seconds. #ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S @@ -4027,27 +4027,27 @@ // // NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED - Enables FPU event cleaning. - + #ifndef NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED #define NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED 1 #endif // NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY - Blocked shutdown procedure will be retried every second. - + #ifndef NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY #define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 0 #endif // NRF_PWR_MGMT_CONFIG_USE_SCHEDULER - Module will use @ref app_scheduler. - + #ifndef NRF_PWR_MGMT_CONFIG_USE_SCHEDULER #define NRF_PWR_MGMT_CONFIG_USE_SCHEDULER 0 #endif -// NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT - The number of priorities for module handlers. +// NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT - The number of priorities for module handlers. // The number of stages of the shutdown process. #ifndef NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT @@ -4057,28 +4057,28 @@ // // NRF_QUEUE_ENABLED - nrf_queue - Queue module - + #ifndef NRF_QUEUE_ENABLED #define NRF_QUEUE_ENABLED 1 #endif // NRF_SECTION_ITER_ENABLED - nrf_section_iter - Section iterator - + #ifndef NRF_SECTION_ITER_ENABLED #define NRF_SECTION_ITER_ENABLED 1 #endif // NRF_STRERROR_ENABLED - nrf_strerror - Library for converting error code to string. - + #ifndef NRF_STRERROR_ENABLED #define NRF_STRERROR_ENABLED 0 #endif // SLIP_ENABLED - slip - SLIP encoding and decoding - + #ifndef SLIP_ENABLED #define SLIP_ENABLED 0 @@ -4090,37 +4090,37 @@ #define TASK_MANAGER_ENABLED 0 #endif // TASK_MANAGER_CLI_CMDS - Enable CLI commands specific to the module - + #ifndef TASK_MANAGER_CLI_CMDS #define TASK_MANAGER_CLI_CMDS 1 #endif -// TASK_MANAGER_CONFIG_MAX_TASKS - Maximum number of tasks which can be created +// TASK_MANAGER_CONFIG_MAX_TASKS - Maximum number of tasks which can be created #ifndef TASK_MANAGER_CONFIG_MAX_TASKS #define TASK_MANAGER_CONFIG_MAX_TASKS 2 #endif -// TASK_MANAGER_CONFIG_STACK_SIZE - Stack size for every task (power of 2) +// TASK_MANAGER_CONFIG_STACK_SIZE - Stack size for every task (power of 2) #ifndef TASK_MANAGER_CONFIG_STACK_SIZE #define TASK_MANAGER_CONFIG_STACK_SIZE 1024 #endif // TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED - Enable stack profiling. - + #ifndef TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED #define TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED 1 #endif // TASK_MANAGER_CONFIG_STACK_GUARD - Configures stack guard. - -// <0=> Disabled -// <4=> 32 bytes -// <5=> 64 bytes -// <6=> 128 bytes -// <7=> 256 bytes -// <8=> 512 bytes + +// <0=> Disabled +// <4=> 32 bytes +// <5=> 64 bytes +// <6=> 128 bytes +// <7=> 256 bytes +// <8=> 512 bytes #ifndef TASK_MANAGER_CONFIG_STACK_GUARD #define TASK_MANAGER_CONFIG_STACK_GUARD 7 @@ -4132,30 +4132,30 @@ //========================================================== // NRF_CLI_ENABLED - Enable/disable CLI module. - + #ifndef NRF_CLI_ENABLED #define NRF_CLI_ENABLED 0 #endif -// NRF_CLI_ARGC_MAX - Maximum number of parameters passed to command handler. +// NRF_CLI_ARGC_MAX - Maximum number of parameters passed to command handler. #ifndef NRF_CLI_ARGC_MAX #define NRF_CLI_ARGC_MAX 12 #endif // NRF_CLI_BUILD_IN_CMDS_ENABLED - CLI build in commands. - + #ifndef NRF_CLI_BUILD_IN_CMDS_ENABLED #define NRF_CLI_BUILD_IN_CMDS_ENABLED 1 #endif -// NRF_CLI_CMD_BUFF_SIZE - Maximum buffer size for single command. +// NRF_CLI_CMD_BUFF_SIZE - Maximum buffer size for single command. #ifndef NRF_CLI_CMD_BUFF_SIZE #define NRF_CLI_CMD_BUFF_SIZE 128 #endif -// NRF_CLI_PRINTF_BUFF_SIZE - Maximum print buffer size. +// NRF_CLI_PRINTF_BUFF_SIZE - Maximum print buffer size. #ifndef NRF_CLI_PRINTF_BUFF_SIZE #define NRF_CLI_PRINTF_BUFF_SIZE 23 #endif @@ -4165,12 +4165,12 @@ #ifndef NRF_CLI_HISTORY_ENABLED #define NRF_CLI_HISTORY_ENABLED 1 #endif -// NRF_CLI_HISTORY_ELEMENT_SIZE - Size of one memory object reserved for CLI history +// NRF_CLI_HISTORY_ELEMENT_SIZE - Size of one memory object reserved for CLI history #ifndef NRF_CLI_HISTORY_ELEMENT_SIZE #define NRF_CLI_HISTORY_ELEMENT_SIZE 32 #endif -// NRF_CLI_HISTORY_ELEMENT_COUNT - Number of history memory objects +// NRF_CLI_HISTORY_ELEMENT_COUNT - Number of history memory objects #ifndef NRF_CLI_HISTORY_ELEMENT_COUNT #define NRF_CLI_HISTORY_ELEMENT_COUNT 8 #endif @@ -4178,51 +4178,51 @@ // // NRF_CLI_VT100_COLORS_ENABLED - CLI VT100 colors. - + #ifndef NRF_CLI_VT100_COLORS_ENABLED #define NRF_CLI_VT100_COLORS_ENABLED 1 #endif // NRF_CLI_LOG_BACKEND - Enable logger backend interface. - + #ifndef NRF_CLI_LOG_BACKEND #define NRF_CLI_LOG_BACKEND 1 #endif // NRF_CLI_USES_TASK_MANAGER_ENABLED - Enable CLI to use task_manager - + #ifndef NRF_CLI_USES_TASK_MANAGER_ENABLED #define NRF_CLI_USES_TASK_MANAGER_ENABLED 0 #endif -// +// //========================================================== // nrf_cli_rtt - RTT command line interface transport. //========================================================== // NRF_CLI_RTT_ENABLED - Enable/disable CLI RTT module. - + #ifndef NRF_CLI_RTT_ENABLED #define NRF_CLI_RTT_ENABLED 0 #endif -// NRF_CLI_RTT_TERMINAL_ID - RTT terminal ID for CLI. +// NRF_CLI_RTT_TERMINAL_ID - RTT terminal ID for CLI. #ifndef NRF_CLI_RTT_TERMINAL_ID #define NRF_CLI_RTT_TERMINAL_ID 0 #endif -// +// //========================================================== -// +// //========================================================== -// nRF_Log +// nRF_Log //========================================================== // NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend @@ -4230,7 +4230,7 @@ #ifndef NRF_LOG_BACKEND_RTT_ENABLED #define NRF_LOG_BACKEND_RTT_ENABLED 0 #endif -// NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. +// NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. // Size of the buffer is a trade-off between RAM usage and processing. // if buffer is smaller then strings will often be fragmented. // It is recommended to use size which will fit typical log and only the @@ -4247,35 +4247,35 @@ #ifndef NRF_LOG_BACKEND_UART_ENABLED #define NRF_LOG_BACKEND_UART_ENABLED 0 #endif -// NRF_LOG_BACKEND_UART_TX_PIN - UART TX pin +// NRF_LOG_BACKEND_UART_TX_PIN - UART TX pin #ifndef NRF_LOG_BACKEND_UART_TX_PIN #define NRF_LOG_BACKEND_UART_TX_PIN 6 #endif // NRF_LOG_BACKEND_UART_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud + +// <323584=> 1200 baud +// <643072=> 2400 baud +// <1290240=> 4800 baud +// <2576384=> 9600 baud +// <3862528=> 14400 baud +// <5152768=> 19200 baud +// <7716864=> 28800 baud +// <10289152=> 38400 baud +// <15400960=> 57600 baud +// <20615168=> 76800 baud +// <30801920=> 115200 baud +// <61865984=> 230400 baud +// <67108864=> 250000 baud +// <121634816=> 460800 baud +// <251658240=> 921600 baud +// <268435456=> 1000000 baud #ifndef NRF_LOG_BACKEND_UART_BAUDRATE #define NRF_LOG_BACKEND_UART_BAUDRATE 30801920 #endif -// NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. +// NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. // Size of the buffer is a trade-off between RAM usage and processing. // if buffer is smaller then strings will often be fragmented. // It is recommended to use size which will fit typical log and only the @@ -4302,48 +4302,48 @@ #define NRF_LOG_USES_COLORS 0 #endif // NRF_LOG_COLOR_DEFAULT - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_LOG_COLOR_DEFAULT #define NRF_LOG_COLOR_DEFAULT 0 #endif // NRF_LOG_ERROR_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_LOG_ERROR_COLOR #define NRF_LOG_ERROR_COLOR 0 #endif // NRF_LOG_WARNING_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_LOG_WARNING_COLOR #define NRF_LOG_WARNING_COLOR 0 @@ -4352,19 +4352,19 @@ // // NRF_LOG_DEFAULT_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_LOG_DEFAULT_LEVEL #define NRF_LOG_DEFAULT_LEVEL 3 #endif // NRF_LOG_DEFERRED - Enable deffered logger. - + // Log data is buffered and can be processed in idle. @@ -4373,27 +4373,27 @@ #endif // NRF_LOG_BUFSIZE - Size of the buffer for storing logs (in bytes). - + // Must be power of 2 and multiple of 4. // If NRF_LOG_DEFERRED = 0 then buffer size can be reduced to minimum. -// <128=> 128 -// <256=> 256 -// <512=> 512 -// <1024=> 1024 -// <2048=> 2048 -// <4096=> 4096 -// <8192=> 8192 -// <16384=> 16384 +// <128=> 128 +// <256=> 256 +// <512=> 512 +// <1024=> 1024 +// <2048=> 2048 +// <4096=> 4096 +// <8192=> 8192 +// <16384=> 16384 #ifndef NRF_LOG_BUFSIZE #define NRF_LOG_BUFSIZE 1024 #endif // NRF_LOG_ALLOW_OVERFLOW - Configures behavior when circular buffer is full. - -// If set then oldest logs are overwritten. Otherwise a + +// If set then oldest logs are overwritten. Otherwise a // marker is injected informing about overflow. #ifndef NRF_LOG_ALLOW_OVERFLOW @@ -4401,7 +4401,7 @@ #endif // NRF_LOG_USES_TIMESTAMP - Enable timestamping - + // Function for getting the timestamp is provided by the user @@ -4410,14 +4410,14 @@ #endif // NRF_LOG_FILTERS_ENABLED - Enable dynamic filtering of logs. - + #ifndef NRF_LOG_FILTERS_ENABLED #define NRF_LOG_FILTERS_ENABLED 1 #endif // NRF_LOG_CLI_CMDS - Enable CLI commands for the module. - + #ifndef NRF_LOG_CLI_CMDS #define NRF_LOG_CLI_CMDS 1 @@ -4426,7 +4426,7 @@ // Log message pool - Configuration of log message pool //========================================================== -// NRF_LOG_MSGPOOL_ELEMENT_SIZE - Size of a single element in the pool of memory objects. +// NRF_LOG_MSGPOOL_ELEMENT_SIZE - Size of a single element in the pool of memory objects. // If a small value is set, then performance of logs processing // is degraded because data is fragmented. Bigger value impacts // RAM memory utilization. The size is set to fit a message with @@ -4436,7 +4436,7 @@ #define NRF_LOG_MSGPOOL_ELEMENT_SIZE 20 #endif -// NRF_LOG_MSGPOOL_ELEMENT_COUNT - Number of elements in the pool of memory objects +// NRF_LOG_MSGPOOL_ELEMENT_COUNT - Number of elements in the pool of memory objects // If a small value is set, then it may lead to a deadlock // in certain cases if backend has high latency and holds // multiple messages for long time. Bigger value impacts @@ -4446,15 +4446,15 @@ #define NRF_LOG_MSGPOOL_ELEMENT_COUNT 8 #endif -// +// //========================================================== // -// nrf_log module configuration +// nrf_log module configuration //========================================================== -// nrf_log in nRF_Core +// nrf_log in nRF_Core //========================================================== // NRF_MPU_CONFIG_LOG_ENABLED - Enables logging in the module. @@ -4463,44 +4463,44 @@ #define NRF_MPU_CONFIG_LOG_ENABLED 0 #endif // NRF_MPU_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_MPU_CONFIG_LOG_LEVEL #define NRF_MPU_CONFIG_LOG_LEVEL 3 #endif // NRF_MPU_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_MPU_CONFIG_INFO_COLOR #define NRF_MPU_CONFIG_INFO_COLOR 0 #endif // NRF_MPU_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_MPU_CONFIG_DEBUG_COLOR #define NRF_MPU_CONFIG_DEBUG_COLOR 0 @@ -4514,44 +4514,44 @@ #define NRF_STACK_GUARD_CONFIG_LOG_ENABLED 0 #endif // NRF_STACK_GUARD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_STACK_GUARD_CONFIG_LOG_LEVEL #define NRF_STACK_GUARD_CONFIG_LOG_LEVEL 3 #endif // NRF_STACK_GUARD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_STACK_GUARD_CONFIG_INFO_COLOR #define NRF_STACK_GUARD_CONFIG_INFO_COLOR 0 #endif // NRF_STACK_GUARD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_STACK_GUARD_CONFIG_DEBUG_COLOR #define NRF_STACK_GUARD_CONFIG_DEBUG_COLOR 0 @@ -4565,44 +4565,44 @@ #define TASK_MANAGER_CONFIG_LOG_ENABLED 0 #endif // TASK_MANAGER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef TASK_MANAGER_CONFIG_LOG_LEVEL #define TASK_MANAGER_CONFIG_LOG_LEVEL 3 #endif // TASK_MANAGER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TASK_MANAGER_CONFIG_INFO_COLOR #define TASK_MANAGER_CONFIG_INFO_COLOR 0 #endif // TASK_MANAGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TASK_MANAGER_CONFIG_DEBUG_COLOR #define TASK_MANAGER_CONFIG_DEBUG_COLOR 0 @@ -4610,10 +4610,10 @@ // -// +// //========================================================== -// nrf_log in nRF_Drivers +// nrf_log in nRF_Drivers //========================================================== // CLOCK_CONFIG_LOG_ENABLED - Enables logging in the module. @@ -4622,44 +4622,44 @@ #define CLOCK_CONFIG_LOG_ENABLED 0 #endif // CLOCK_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef CLOCK_CONFIG_LOG_LEVEL #define CLOCK_CONFIG_LOG_LEVEL 3 #endif // CLOCK_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef CLOCK_CONFIG_INFO_COLOR #define CLOCK_CONFIG_INFO_COLOR 0 #endif // CLOCK_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef CLOCK_CONFIG_DEBUG_COLOR #define CLOCK_CONFIG_DEBUG_COLOR 0 @@ -4673,44 +4673,44 @@ #define COMMON_CONFIG_LOG_ENABLED 0 #endif // COMMON_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef COMMON_CONFIG_LOG_LEVEL #define COMMON_CONFIG_LOG_LEVEL 3 #endif // COMMON_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef COMMON_CONFIG_INFO_COLOR #define COMMON_CONFIG_INFO_COLOR 0 #endif // COMMON_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef COMMON_CONFIG_DEBUG_COLOR #define COMMON_CONFIG_DEBUG_COLOR 0 @@ -4724,44 +4724,44 @@ #define COMP_CONFIG_LOG_ENABLED 0 #endif // COMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef COMP_CONFIG_LOG_LEVEL #define COMP_CONFIG_LOG_LEVEL 3 #endif // COMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef COMP_CONFIG_INFO_COLOR #define COMP_CONFIG_INFO_COLOR 0 #endif // COMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef COMP_CONFIG_DEBUG_COLOR #define COMP_CONFIG_DEBUG_COLOR 0 @@ -4775,44 +4775,44 @@ #define GPIOTE_CONFIG_LOG_ENABLED 0 #endif // GPIOTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef GPIOTE_CONFIG_LOG_LEVEL #define GPIOTE_CONFIG_LOG_LEVEL 3 #endif // GPIOTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef GPIOTE_CONFIG_INFO_COLOR #define GPIOTE_CONFIG_INFO_COLOR 0 #endif // GPIOTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef GPIOTE_CONFIG_DEBUG_COLOR #define GPIOTE_CONFIG_DEBUG_COLOR 0 @@ -4826,44 +4826,44 @@ #define I2S_CONFIG_LOG_ENABLED 0 #endif // I2S_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef I2S_CONFIG_LOG_LEVEL #define I2S_CONFIG_LOG_LEVEL 3 #endif // I2S_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef I2S_CONFIG_INFO_COLOR #define I2S_CONFIG_INFO_COLOR 0 #endif // I2S_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef I2S_CONFIG_DEBUG_COLOR #define I2S_CONFIG_DEBUG_COLOR 0 @@ -4877,44 +4877,44 @@ #define LPCOMP_CONFIG_LOG_ENABLED 0 #endif // LPCOMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef LPCOMP_CONFIG_LOG_LEVEL #define LPCOMP_CONFIG_LOG_LEVEL 3 #endif // LPCOMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef LPCOMP_CONFIG_INFO_COLOR #define LPCOMP_CONFIG_INFO_COLOR 0 #endif // LPCOMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef LPCOMP_CONFIG_DEBUG_COLOR #define LPCOMP_CONFIG_DEBUG_COLOR 0 @@ -4928,44 +4928,44 @@ #define PDM_CONFIG_LOG_ENABLED 0 #endif // PDM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef PDM_CONFIG_LOG_LEVEL #define PDM_CONFIG_LOG_LEVEL 3 #endif // PDM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PDM_CONFIG_INFO_COLOR #define PDM_CONFIG_INFO_COLOR 0 #endif // PDM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PDM_CONFIG_DEBUG_COLOR #define PDM_CONFIG_DEBUG_COLOR 0 @@ -4979,44 +4979,44 @@ #define PPI_CONFIG_LOG_ENABLED 0 #endif // PPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef PPI_CONFIG_LOG_LEVEL #define PPI_CONFIG_LOG_LEVEL 3 #endif // PPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PPI_CONFIG_INFO_COLOR #define PPI_CONFIG_INFO_COLOR 0 #endif // PPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PPI_CONFIG_DEBUG_COLOR #define PPI_CONFIG_DEBUG_COLOR 0 @@ -5030,44 +5030,44 @@ #define PWM_CONFIG_LOG_ENABLED 0 #endif // PWM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef PWM_CONFIG_LOG_LEVEL #define PWM_CONFIG_LOG_LEVEL 3 #endif // PWM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PWM_CONFIG_INFO_COLOR #define PWM_CONFIG_INFO_COLOR 0 #endif // PWM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PWM_CONFIG_DEBUG_COLOR #define PWM_CONFIG_DEBUG_COLOR 0 @@ -5081,44 +5081,44 @@ #define QDEC_CONFIG_LOG_ENABLED 0 #endif // QDEC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef QDEC_CONFIG_LOG_LEVEL #define QDEC_CONFIG_LOG_LEVEL 3 #endif // QDEC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef QDEC_CONFIG_INFO_COLOR #define QDEC_CONFIG_INFO_COLOR 0 #endif // QDEC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef QDEC_CONFIG_DEBUG_COLOR #define QDEC_CONFIG_DEBUG_COLOR 0 @@ -5132,51 +5132,51 @@ #define RNG_CONFIG_LOG_ENABLED 0 #endif // RNG_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef RNG_CONFIG_LOG_LEVEL #define RNG_CONFIG_LOG_LEVEL 3 #endif // RNG_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef RNG_CONFIG_INFO_COLOR #define RNG_CONFIG_INFO_COLOR 0 #endif // RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef RNG_CONFIG_DEBUG_COLOR #define RNG_CONFIG_DEBUG_COLOR 0 #endif // RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED - Enables logging of random numbers. - + #ifndef RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED #define RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED 0 @@ -5190,44 +5190,44 @@ #define RTC_CONFIG_LOG_ENABLED 0 #endif // RTC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef RTC_CONFIG_LOG_LEVEL #define RTC_CONFIG_LOG_LEVEL 3 #endif // RTC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef RTC_CONFIG_INFO_COLOR #define RTC_CONFIG_INFO_COLOR 0 #endif // RTC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef RTC_CONFIG_DEBUG_COLOR #define RTC_CONFIG_DEBUG_COLOR 0 @@ -5241,44 +5241,44 @@ #define SAADC_CONFIG_LOG_ENABLED 0 #endif // SAADC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef SAADC_CONFIG_LOG_LEVEL #define SAADC_CONFIG_LOG_LEVEL 3 #endif // SAADC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SAADC_CONFIG_INFO_COLOR #define SAADC_CONFIG_INFO_COLOR 0 #endif // SAADC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SAADC_CONFIG_DEBUG_COLOR #define SAADC_CONFIG_DEBUG_COLOR 0 @@ -5292,44 +5292,44 @@ #define SPIS_CONFIG_LOG_ENABLED 0 #endif // SPIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef SPIS_CONFIG_LOG_LEVEL #define SPIS_CONFIG_LOG_LEVEL 3 #endif // SPIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SPIS_CONFIG_INFO_COLOR #define SPIS_CONFIG_INFO_COLOR 0 #endif // SPIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SPIS_CONFIG_DEBUG_COLOR #define SPIS_CONFIG_DEBUG_COLOR 0 @@ -5343,44 +5343,44 @@ #define SPI_CONFIG_LOG_ENABLED 0 #endif // SPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef SPI_CONFIG_LOG_LEVEL #define SPI_CONFIG_LOG_LEVEL 3 #endif // SPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SPI_CONFIG_INFO_COLOR #define SPI_CONFIG_INFO_COLOR 0 #endif // SPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SPI_CONFIG_DEBUG_COLOR #define SPI_CONFIG_DEBUG_COLOR 0 @@ -5394,44 +5394,44 @@ #define SWI_CONFIG_LOG_ENABLED 0 #endif // SWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef SWI_CONFIG_LOG_LEVEL #define SWI_CONFIG_LOG_LEVEL 3 #endif // SWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SWI_CONFIG_INFO_COLOR #define SWI_CONFIG_INFO_COLOR 0 #endif // SWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SWI_CONFIG_DEBUG_COLOR #define SWI_CONFIG_DEBUG_COLOR 0 @@ -5445,44 +5445,44 @@ #define TIMER_CONFIG_LOG_ENABLED 0 #endif // TIMER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef TIMER_CONFIG_LOG_LEVEL #define TIMER_CONFIG_LOG_LEVEL 3 #endif // TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TIMER_CONFIG_INFO_COLOR #define TIMER_CONFIG_INFO_COLOR 0 #endif // TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TIMER_CONFIG_DEBUG_COLOR #define TIMER_CONFIG_DEBUG_COLOR 0 @@ -5496,44 +5496,44 @@ #define TWIS_CONFIG_LOG_ENABLED 0 #endif // TWIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef TWIS_CONFIG_LOG_LEVEL #define TWIS_CONFIG_LOG_LEVEL 3 #endif // TWIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TWIS_CONFIG_INFO_COLOR #define TWIS_CONFIG_INFO_COLOR 0 #endif // TWIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TWIS_CONFIG_DEBUG_COLOR #define TWIS_CONFIG_DEBUG_COLOR 0 @@ -5547,44 +5547,44 @@ #define TWI_CONFIG_LOG_ENABLED 0 #endif // TWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef TWI_CONFIG_LOG_LEVEL #define TWI_CONFIG_LOG_LEVEL 3 #endif // TWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TWI_CONFIG_INFO_COLOR #define TWI_CONFIG_INFO_COLOR 0 #endif // TWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TWI_CONFIG_DEBUG_COLOR #define TWI_CONFIG_DEBUG_COLOR 0 @@ -5598,44 +5598,44 @@ #define UART_CONFIG_LOG_ENABLED 0 #endif // UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef UART_CONFIG_LOG_LEVEL #define UART_CONFIG_LOG_LEVEL 3 #endif // UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef UART_CONFIG_INFO_COLOR #define UART_CONFIG_INFO_COLOR 0 #endif // UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef UART_CONFIG_DEBUG_COLOR #define UART_CONFIG_DEBUG_COLOR 0 @@ -5649,44 +5649,44 @@ #define USBD_CONFIG_LOG_ENABLED 0 #endif // USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef USBD_CONFIG_LOG_LEVEL #define USBD_CONFIG_LOG_LEVEL 3 #endif // USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef USBD_CONFIG_INFO_COLOR #define USBD_CONFIG_INFO_COLOR 0 #endif // USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef USBD_CONFIG_DEBUG_COLOR #define USBD_CONFIG_DEBUG_COLOR 0 @@ -5700,44 +5700,44 @@ #define WDT_CONFIG_LOG_ENABLED 0 #endif // WDT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef WDT_CONFIG_LOG_LEVEL #define WDT_CONFIG_LOG_LEVEL 3 #endif // WDT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef WDT_CONFIG_INFO_COLOR #define WDT_CONFIG_INFO_COLOR 0 #endif // WDT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef WDT_CONFIG_DEBUG_COLOR #define WDT_CONFIG_DEBUG_COLOR 0 @@ -5745,10 +5745,10 @@ // -// +// //========================================================== -// nrf_log in nRF_Libraries +// nrf_log in nRF_Libraries //========================================================== // APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED - Enables logging in the module. @@ -5757,44 +5757,44 @@ #define APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED 0 #endif // APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL #define APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL 3 #endif // APP_USBD_CDC_ACM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_CDC_ACM_CONFIG_INFO_COLOR #define APP_USBD_CDC_ACM_CONFIG_INFO_COLOR 0 #endif // APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR #define APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR 0 @@ -5808,44 +5808,44 @@ #define APP_USBD_MSC_CONFIG_LOG_ENABLED 0 #endif // APP_USBD_MSC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef APP_USBD_MSC_CONFIG_LOG_LEVEL #define APP_USBD_MSC_CONFIG_LOG_LEVEL 3 #endif // APP_USBD_MSC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_MSC_CONFIG_INFO_COLOR #define APP_USBD_MSC_CONFIG_INFO_COLOR 0 #endif // APP_USBD_MSC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_MSC_CONFIG_DEBUG_COLOR #define APP_USBD_MSC_CONFIG_DEBUG_COLOR 0 @@ -5854,7 +5854,7 @@ // // MEM_MANAGER_ENABLE_LOGS - Enable debug trace in the module. - + #ifndef MEM_MANAGER_ENABLE_LOGS #define MEM_MANAGER_ENABLE_LOGS 0 @@ -5866,44 +5866,44 @@ #define NRF_BALLOC_CONFIG_LOG_ENABLED 0 #endif // NRF_BALLOC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_BALLOC_CONFIG_LOG_LEVEL #define NRF_BALLOC_CONFIG_LOG_LEVEL 3 #endif // NRF_BALLOC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_BALLOC_CONFIG_INFO_COLOR #define NRF_BALLOC_CONFIG_INFO_COLOR 0 #endif // NRF_BALLOC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_BALLOC_CONFIG_DEBUG_COLOR #define NRF_BALLOC_CONFIG_DEBUG_COLOR 0 @@ -5917,44 +5917,44 @@ #define NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED 0 #endif // NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL #define NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL 3 #endif // NRF_CLI_BLE_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_CLI_BLE_UART_CONFIG_INFO_COLOR #define NRF_CLI_BLE_UART_CONFIG_INFO_COLOR 0 #endif // NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR #define NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR 0 @@ -5968,44 +5968,44 @@ #define NRF_CLI_UART_CONFIG_LOG_ENABLED 0 #endif // NRF_CLI_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_CLI_UART_CONFIG_LOG_LEVEL #define NRF_CLI_UART_CONFIG_LOG_LEVEL 3 #endif // NRF_CLI_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_CLI_UART_CONFIG_INFO_COLOR #define NRF_CLI_UART_CONFIG_INFO_COLOR 0 #endif // NRF_CLI_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_CLI_UART_CONFIG_DEBUG_COLOR #define NRF_CLI_UART_CONFIG_DEBUG_COLOR 0 @@ -6019,44 +6019,44 @@ #define NRF_MEMOBJ_CONFIG_LOG_ENABLED 0 #endif // NRF_MEMOBJ_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_MEMOBJ_CONFIG_LOG_LEVEL #define NRF_MEMOBJ_CONFIG_LOG_LEVEL 3 #endif // NRF_MEMOBJ_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_MEMOBJ_CONFIG_INFO_COLOR #define NRF_MEMOBJ_CONFIG_INFO_COLOR 0 #endif // NRF_MEMOBJ_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_MEMOBJ_CONFIG_DEBUG_COLOR #define NRF_MEMOBJ_CONFIG_DEBUG_COLOR 0 @@ -6070,44 +6070,44 @@ #define NRF_PWR_MGMT_CONFIG_LOG_ENABLED 0 #endif // NRF_PWR_MGMT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_PWR_MGMT_CONFIG_LOG_LEVEL #define NRF_PWR_MGMT_CONFIG_LOG_LEVEL 3 #endif // NRF_PWR_MGMT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_PWR_MGMT_CONFIG_INFO_COLOR #define NRF_PWR_MGMT_CONFIG_INFO_COLOR 0 #endif // NRF_PWR_MGMT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_PWR_MGMT_CONFIG_DEBUG_COLOR #define NRF_PWR_MGMT_CONFIG_DEBUG_COLOR 0 @@ -6121,44 +6121,44 @@ #define NRF_SDH_ANT_LOG_ENABLED 1 #endif // NRF_SDH_ANT_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_SDH_ANT_LOG_LEVEL #define NRF_SDH_ANT_LOG_LEVEL 3 #endif // NRF_SDH_ANT_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_ANT_INFO_COLOR #define NRF_SDH_ANT_INFO_COLOR 0 #endif // NRF_SDH_ANT_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_ANT_DEBUG_COLOR #define NRF_SDH_ANT_DEBUG_COLOR 0 @@ -6172,44 +6172,44 @@ #define NRF_SDH_BLE_LOG_ENABLED 1 #endif // NRF_SDH_BLE_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_SDH_BLE_LOG_LEVEL #define NRF_SDH_BLE_LOG_LEVEL 3 #endif // NRF_SDH_BLE_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_BLE_INFO_COLOR #define NRF_SDH_BLE_INFO_COLOR 0 #endif // NRF_SDH_BLE_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_BLE_DEBUG_COLOR #define NRF_SDH_BLE_DEBUG_COLOR 0 @@ -6223,44 +6223,44 @@ #define NRF_SDH_LOG_ENABLED 1 #endif // NRF_SDH_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_SDH_LOG_LEVEL #define NRF_SDH_LOG_LEVEL 3 #endif // NRF_SDH_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_INFO_COLOR #define NRF_SDH_INFO_COLOR 0 #endif // NRF_SDH_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_DEBUG_COLOR #define NRF_SDH_DEBUG_COLOR 0 @@ -6274,44 +6274,44 @@ #define NRF_SDH_SOC_LOG_ENABLED 1 #endif // NRF_SDH_SOC_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_SDH_SOC_LOG_LEVEL #define NRF_SDH_SOC_LOG_LEVEL 3 #endif // NRF_SDH_SOC_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_SOC_INFO_COLOR #define NRF_SDH_SOC_INFO_COLOR 0 #endif // NRF_SDH_SOC_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_SOC_DEBUG_COLOR #define NRF_SDH_SOC_DEBUG_COLOR 0 @@ -6319,19 +6319,19 @@ // -// +// //========================================================== -// +// //========================================================== -// +// //========================================================== -// +// //========================================================== -// nRF_NFC +// nRF_NFC //========================================================== // NFC_BLE_OOB_ADVDATA_ENABLED - nfc_ble_oob_advdata - Encoding the advertising data and/or scan response data which is specific for OOB pairing @@ -6340,9 +6340,9 @@ #define NFC_BLE_OOB_ADVDATA_ENABLED 0 #endif // ADVANCED_ADVDATA_SUPPORT - Non-mandatory AD types for BLE OOB pairing are encoded inside the NDEF message (e.g. service UUIDs) - -// <1=> Enabled -// <0=> Disabled + +// <1=> Enabled +// <0=> Disabled #ifndef ADVANCED_ADVDATA_SUPPORT #define ADVANCED_ADVDATA_SUPPORT 0 @@ -6361,44 +6361,44 @@ #define NFC_BLE_PAIR_LIB_LOG_ENABLED 0 #endif // NFC_BLE_PAIR_LIB_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NFC_BLE_PAIR_LIB_LOG_LEVEL #define NFC_BLE_PAIR_LIB_LOG_LEVEL 3 #endif // NFC_BLE_PAIR_LIB_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NFC_BLE_PAIR_LIB_INFO_COLOR #define NFC_BLE_PAIR_LIB_INFO_COLOR 0 #endif // NFC_BLE_PAIR_LIB_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NFC_BLE_PAIR_LIB_DEBUG_COLOR #define NFC_BLE_PAIR_LIB_DEBUG_COLOR 0 @@ -6417,84 +6417,84 @@ #define BLE_NFC_SEC_PARAM_BOND 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ENC - Enables Long Term Key and Master Identification distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ENC #define BLE_NFC_SEC_PARAM_KDIST_OWN_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ID - Enables Identity Resolving Key and Identity Address Information distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ID #define BLE_NFC_SEC_PARAM_KDIST_OWN_ID 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ENC - Enables Long Term Key and Master Identification distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ENC #define BLE_NFC_SEC_PARAM_KDIST_PEER_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ID - Enables Identity Resolving Key and Identity Address Information distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ID #define BLE_NFC_SEC_PARAM_KDIST_PEER_ID 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ENC - Enables Long Term Key and Master Identification distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ENC #define BLE_NFC_SEC_PARAM_KDIST_OWN_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ID - Enables Identity Resolving Key and Identity Address Information distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ID #define BLE_NFC_SEC_PARAM_KDIST_OWN_ID 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ENC - Enables Long Term Key and Master Identification distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ENC #define BLE_NFC_SEC_PARAM_KDIST_PEER_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ID - Enables Identity Resolving Key and Identity Address Information distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ID #define BLE_NFC_SEC_PARAM_KDIST_PEER_ID 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ENC - Enables Long Term Key and Master Identification distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ENC #define BLE_NFC_SEC_PARAM_KDIST_OWN_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ID - Enables Identity Resolving Key and Identity Address Information distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ID #define BLE_NFC_SEC_PARAM_KDIST_OWN_ID 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ENC - Enables Long Term Key and Master Identification distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ENC #define BLE_NFC_SEC_PARAM_KDIST_PEER_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ID - Enables Identity Resolving Key and Identity Address Information distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ID #define BLE_NFC_SEC_PARAM_KDIST_PEER_ID 1 @@ -6503,40 +6503,40 @@ // // BLE_NFC_SEC_PARAM_MIN_KEY_SIZE - Minimal size of a security key. - -// <7=> 7 -// <8=> 8 -// <9=> 9 -// <10=> 10 -// <11=> 11 -// <12=> 12 -// <13=> 13 -// <14=> 14 -// <15=> 15 -// <16=> 16 + +// <7=> 7 +// <8=> 8 +// <9=> 9 +// <10=> 10 +// <11=> 11 +// <12=> 12 +// <13=> 13 +// <14=> 14 +// <15=> 15 +// <16=> 16 #ifndef BLE_NFC_SEC_PARAM_MIN_KEY_SIZE #define BLE_NFC_SEC_PARAM_MIN_KEY_SIZE 7 #endif // BLE_NFC_SEC_PARAM_MAX_KEY_SIZE - Maximal size of a security key. - -// <7=> 7 -// <8=> 8 -// <9=> 9 -// <10=> 10 -// <11=> 11 -// <12=> 12 -// <13=> 13 -// <14=> 14 -// <15=> 15 -// <16=> 16 + +// <7=> 7 +// <8=> 8 +// <9=> 9 +// <10=> 10 +// <11=> 11 +// <12=> 12 +// <13=> 13 +// <14=> 14 +// <15=> 15 +// <16=> 16 #ifndef BLE_NFC_SEC_PARAM_MAX_KEY_SIZE #define BLE_NFC_SEC_PARAM_MAX_KEY_SIZE 16 #endif -// +// //========================================================== // @@ -6547,9 +6547,9 @@ #define NFC_NDEF_MSG_ENABLED 0 #endif // NFC_NDEF_MSG_TAG_TYPE - NFC Tag Type - -// <2=> Type 2 Tag -// <4=> Type 4 Tag + +// <2=> Type 2 Tag +// <4=> Type 4 Tag #ifndef NFC_NDEF_MSG_TAG_TYPE #define NFC_NDEF_MSG_TAG_TYPE 2 @@ -6568,28 +6568,28 @@ #define NFC_NDEF_MSG_PARSER_LOG_ENABLED 0 #endif // NFC_NDEF_MSG_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NFC_NDEF_MSG_PARSER_LOG_LEVEL #define NFC_NDEF_MSG_PARSER_LOG_LEVEL 3 #endif // NFC_NDEF_MSG_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NFC_NDEF_MSG_PARSER_INFO_COLOR #define NFC_NDEF_MSG_PARSER_INFO_COLOR 0 @@ -6610,28 +6610,28 @@ #define NFC_NDEF_RECORD_PARSER_LOG_ENABLED 0 #endif // NFC_NDEF_RECORD_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NFC_NDEF_RECORD_PARSER_LOG_LEVEL #define NFC_NDEF_RECORD_PARSER_LOG_LEVEL 3 #endif // NFC_NDEF_RECORD_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NFC_NDEF_RECORD_PARSER_INFO_COLOR #define NFC_NDEF_RECORD_PARSER_INFO_COLOR 0 @@ -6647,17 +6647,17 @@ #define NFC_T2T_HAL_ENABLED 0 #endif // NFCT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef NFCT_CONFIG_IRQ_PRIORITY #define NFCT_CONFIG_IRQ_PRIORITY 7 @@ -6669,88 +6669,88 @@ #define HAL_NFC_CONFIG_LOG_ENABLED 0 #endif // HAL_NFC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef HAL_NFC_CONFIG_LOG_LEVEL #define HAL_NFC_CONFIG_LOG_LEVEL 3 #endif // HAL_NFC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_INFO_COLOR #define HAL_NFC_CONFIG_INFO_COLOR 0 #endif // HAL_NFC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_DEBUG_COLOR #define HAL_NFC_CONFIG_DEBUG_COLOR 0 #endif // HAL_NFC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef HAL_NFC_CONFIG_LOG_LEVEL #define HAL_NFC_CONFIG_LOG_LEVEL 3 #endif // HAL_NFC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_INFO_COLOR #define HAL_NFC_CONFIG_INFO_COLOR 0 #endif // HAL_NFC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_DEBUG_COLOR #define HAL_NFC_CONFIG_DEBUG_COLOR 0 @@ -6764,560 +6764,560 @@ #define HAL_NFC_CONFIG_DEBUG_PIN_ENABLED 0 #endif // HAL_NFC_HCLOCK_ON_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_ON_DEBUG_PIN #define HAL_NFC_HCLOCK_ON_DEBUG_PIN 11 #endif // HAL_NFC_HCLOCK_OFF_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_OFF_DEBUG_PIN #define HAL_NFC_HCLOCK_OFF_DEBUG_PIN 12 #endif // HAL_NFC_NFC_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_NFC_EVENT_DEBUG_PIN #define HAL_NFC_NFC_EVENT_DEBUG_PIN 24 #endif // HAL_NFC_DETECT_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_DETECT_EVENT_DEBUG_PIN #define HAL_NFC_DETECT_EVENT_DEBUG_PIN 25 #endif // HAL_NFC_TIMER4_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_TIMER4_EVENT_DEBUG_PIN #define HAL_NFC_TIMER4_EVENT_DEBUG_PIN 28 #endif // HAL_NFC_HCLOCK_ON_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_ON_DEBUG_PIN #define HAL_NFC_HCLOCK_ON_DEBUG_PIN 31 #endif // HAL_NFC_HCLOCK_OFF_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_OFF_DEBUG_PIN #define HAL_NFC_HCLOCK_OFF_DEBUG_PIN 31 #endif // HAL_NFC_NFC_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_NFC_EVENT_DEBUG_PIN #define HAL_NFC_NFC_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_DETECT_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_DETECT_EVENT_DEBUG_PIN #define HAL_NFC_DETECT_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_TIMER4_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_TIMER4_EVENT_DEBUG_PIN #define HAL_NFC_TIMER4_EVENT_DEBUG_PIN 31 @@ -7333,17 +7333,17 @@ #define NFC_T4T_HAL_ENABLED 0 #endif // NFCT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef NFCT_CONFIG_IRQ_PRIORITY #define NFCT_CONFIG_IRQ_PRIORITY 7 @@ -7355,88 +7355,88 @@ #define HAL_NFC_CONFIG_LOG_ENABLED 0 #endif // HAL_NFC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef HAL_NFC_CONFIG_LOG_LEVEL #define HAL_NFC_CONFIG_LOG_LEVEL 3 #endif // HAL_NFC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_INFO_COLOR #define HAL_NFC_CONFIG_INFO_COLOR 0 #endif // HAL_NFC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_DEBUG_COLOR #define HAL_NFC_CONFIG_DEBUG_COLOR 0 #endif // HAL_NFC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef HAL_NFC_CONFIG_LOG_LEVEL #define HAL_NFC_CONFIG_LOG_LEVEL 3 #endif // HAL_NFC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_INFO_COLOR #define HAL_NFC_CONFIG_INFO_COLOR 0 #endif // HAL_NFC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_DEBUG_COLOR #define HAL_NFC_CONFIG_DEBUG_COLOR 0 @@ -7450,560 +7450,560 @@ #define HAL_NFC_CONFIG_DEBUG_PIN_ENABLED 0 #endif // HAL_NFC_HCLOCK_ON_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_ON_DEBUG_PIN #define HAL_NFC_HCLOCK_ON_DEBUG_PIN 31 #endif // HAL_NFC_HCLOCK_OFF_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_OFF_DEBUG_PIN #define HAL_NFC_HCLOCK_OFF_DEBUG_PIN 31 #endif // HAL_NFC_NFC_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_NFC_EVENT_DEBUG_PIN #define HAL_NFC_NFC_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_DETECT_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_DETECT_EVENT_DEBUG_PIN #define HAL_NFC_DETECT_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_TIMER4_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_TIMER4_EVENT_DEBUG_PIN #define HAL_NFC_TIMER4_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_HCLOCK_ON_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_ON_DEBUG_PIN #define HAL_NFC_HCLOCK_ON_DEBUG_PIN 31 #endif // HAL_NFC_HCLOCK_OFF_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_OFF_DEBUG_PIN #define HAL_NFC_HCLOCK_OFF_DEBUG_PIN 31 #endif // HAL_NFC_NFC_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_NFC_EVENT_DEBUG_PIN #define HAL_NFC_NFC_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_DETECT_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_DETECT_EVENT_DEBUG_PIN #define HAL_NFC_DETECT_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_TIMER4_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_TIMER4_EVENT_DEBUG_PIN #define HAL_NFC_TIMER4_EVENT_DEBUG_PIN 31 @@ -8013,16 +8013,16 @@ // -// +// //========================================================== -// nRF_Segger_RTT +// nRF_Segger_RTT //========================================================== // segger_rtt - SEGGER RTT //========================================================== -// SEGGER_RTT_CONFIG_BUFFER_SIZE_UP - Size of upstream buffer. +// SEGGER_RTT_CONFIG_BUFFER_SIZE_UP - Size of upstream buffer. // Note that either @ref NRF_LOG_BACKEND_RTT_OUTPUT_BUFFER_SIZE // or this value is actually used. It depends on which one is bigger. @@ -8030,43 +8030,43 @@ #define SEGGER_RTT_CONFIG_BUFFER_SIZE_UP 512 #endif -// SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS - Size of upstream buffer. +// SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS - Size of upstream buffer. #ifndef SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS #define SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS 2 #endif -// SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN - Size of upstream buffer. +// SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN - Size of upstream buffer. #ifndef SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN #define SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN 16 #endif -// SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS - Size of upstream buffer. +// SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS - Size of upstream buffer. #ifndef SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS #define SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS 2 #endif // SEGGER_RTT_CONFIG_DEFAULT_MODE - RTT behavior if the buffer is full. - + // The following modes are supported: // - SKIP - Do not block, output nothing. // - TRIM - Do not block, output as much as fits. // - BLOCK - Wait until there is space in the buffer. -// <0=> SKIP -// <1=> TRIM -// <2=> BLOCK_IF_FIFO_FULL +// <0=> SKIP +// <1=> TRIM +// <2=> BLOCK_IF_FIFO_FULL #ifndef SEGGER_RTT_CONFIG_DEFAULT_MODE #define SEGGER_RTT_CONFIG_DEFAULT_MODE 0 #endif -// +// //========================================================== -// +// //========================================================== -// nRF_SoftDevice +// nRF_SoftDevice //========================================================== // NRF_SDH_ANT_ENABLED - nrf_sdh_ant - SoftDevice ANT event handler @@ -8074,42 +8074,42 @@ #ifndef NRF_SDH_ANT_ENABLED #define NRF_SDH_ANT_ENABLED 0 #endif -// ANT Channels +// ANT Channels //========================================================== -// NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED - Allocated ANT channels. +// NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED - Allocated ANT channels. #ifndef NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED #define NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED 0 #endif -// NRF_SDH_ANT_ENCRYPTED_CHANNELS - Encrypted ANT channels. +// NRF_SDH_ANT_ENCRYPTED_CHANNELS - Encrypted ANT channels. #ifndef NRF_SDH_ANT_ENCRYPTED_CHANNELS #define NRF_SDH_ANT_ENCRYPTED_CHANNELS 0 #endif -// +// //========================================================== -// ANT Queues +// ANT Queues //========================================================== -// NRF_SDH_ANT_EVENT_QUEUE_SIZE - Event queue size. +// NRF_SDH_ANT_EVENT_QUEUE_SIZE - Event queue size. #ifndef NRF_SDH_ANT_EVENT_QUEUE_SIZE #define NRF_SDH_ANT_EVENT_QUEUE_SIZE 32 #endif -// NRF_SDH_ANT_BURST_QUEUE_SIZE - ANT burst queue size. +// NRF_SDH_ANT_BURST_QUEUE_SIZE - ANT burst queue size. #ifndef NRF_SDH_ANT_BURST_QUEUE_SIZE #define NRF_SDH_ANT_BURST_QUEUE_SIZE 128 #endif -// +// //========================================================== // ANT Observers - Observers and priority levels //========================================================== -// NRF_SDH_ANT_OBSERVER_PRIO_LEVELS - Total number of priority levels for ANT observers. +// NRF_SDH_ANT_OBSERVER_PRIO_LEVELS - Total number of priority levels for ANT observers. // This setting configures the number of priority levels available for the ANT event handlers. // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8120,59 +8120,59 @@ // ANT Observers priorities - Invididual priorities //========================================================== -// ANT_BPWR_ANT_OBSERVER_PRIO +// ANT_BPWR_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Bicycle Power Profile. #ifndef ANT_BPWR_ANT_OBSERVER_PRIO #define ANT_BPWR_ANT_OBSERVER_PRIO 1 #endif -// ANT_BSC_ANT_OBSERVER_PRIO +// ANT_BSC_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Bicycle Speed and Cadence Profile. #ifndef ANT_BSC_ANT_OBSERVER_PRIO #define ANT_BSC_ANT_OBSERVER_PRIO 1 #endif -// ANT_ENCRYPT_ANT_OBSERVER_PRIO +// ANT_ENCRYPT_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Cryptographic ANT stack configuration module. #ifndef ANT_ENCRYPT_ANT_OBSERVER_PRIO #define ANT_ENCRYPT_ANT_OBSERVER_PRIO 1 #endif -// ANT_HRM_ANT_OBSERVER_PRIO +// ANT_HRM_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Heart Rate Monitor. #ifndef ANT_HRM_ANT_OBSERVER_PRIO #define ANT_HRM_ANT_OBSERVER_PRIO 1 #endif -// ANT_SDM_ANT_OBSERVER_PRIO +// ANT_SDM_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Stride Based Speed and Distance Monitor Profile. #ifndef ANT_SDM_ANT_OBSERVER_PRIO #define ANT_SDM_ANT_OBSERVER_PRIO 1 #endif -// ANT_STATE_INDICATOR_ANT_OBSERVER_PRIO +// ANT_STATE_INDICATOR_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the ANT state indicator module. #ifndef ANT_STATE_INDICATOR_ANT_OBSERVER_PRIO #define ANT_STATE_INDICATOR_ANT_OBSERVER_PRIO 1 #endif -// BSP_BTN_ANT_OBSERVER_PRIO +// BSP_BTN_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Button Control module. #ifndef BSP_BTN_ANT_OBSERVER_PRIO #define BSP_BTN_ANT_OBSERVER_PRIO 1 #endif -// +// //========================================================== -// +// //========================================================== @@ -8188,55 +8188,55 @@ // These values are not used directly by the SoftDevice handler but the application or other libraries might depend on them. // Keep them up-to-date with the desired configuration. //========================================================== -// NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. +// NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. #ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 0 #endif -// NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. +// NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. #ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0 #endif -// NRF_SDH_BLE_TOTAL_LINK_COUNT - Maximum number of total concurrent connections using the default configuration. +// NRF_SDH_BLE_TOTAL_LINK_COUNT - Maximum number of total concurrent connections using the default configuration. #ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT #define NRF_SDH_BLE_TOTAL_LINK_COUNT 1 #endif -// NRF_SDH_BLE_GAP_EVENT_LENGTH - The time set aside for this connection on every connection interval in 1.25 ms units. +// NRF_SDH_BLE_GAP_EVENT_LENGTH - The time set aside for this connection on every connection interval in 1.25 ms units. #ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH #define NRF_SDH_BLE_GAP_EVENT_LENGTH 3 #endif -// NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. +// NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. #ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 23 #endif -// NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE - Attribute Table size in bytes. The size must be a multiple of 4. +// NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE - Attribute Table size in bytes. The size must be a multiple of 4. #ifndef NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE #define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408 #endif -// NRF_SDH_BLE_VS_UUID_COUNT - The number of vendor-specific UUIDs. +// NRF_SDH_BLE_VS_UUID_COUNT - The number of vendor-specific UUIDs. #ifndef NRF_SDH_BLE_VS_UUID_COUNT #define NRF_SDH_BLE_VS_UUID_COUNT 0 #endif // NRF_SDH_BLE_SERVICE_CHANGED - Include the Service Changed characteristic in the Attribute Table. - + #ifndef NRF_SDH_BLE_SERVICE_CHANGED #define NRF_SDH_BLE_SERVICE_CHANGED 0 #endif -// +// //========================================================== // BLE Observers - Observers and priority levels //========================================================== -// NRF_SDH_BLE_OBSERVER_PRIO_LEVELS - Total number of priority levels for BLE observers. +// NRF_SDH_BLE_OBSERVER_PRIO_LEVELS - Total number of priority levels for BLE observers. // This setting configures the number of priority levels available for BLE event handlers. // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8247,276 +8247,276 @@ // BLE Observers priorities - Invididual priorities //========================================================== -// BLE_ADV_BLE_OBSERVER_PRIO +// BLE_ADV_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Advertising module. #ifndef BLE_ADV_BLE_OBSERVER_PRIO #define BLE_ADV_BLE_OBSERVER_PRIO 2 #endif -// BLE_ANCS_C_BLE_OBSERVER_PRIO +// BLE_ANCS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Apple Notification Service Client. #ifndef BLE_ANCS_C_BLE_OBSERVER_PRIO #define BLE_ANCS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_ANS_C_BLE_OBSERVER_PRIO +// BLE_ANS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Alert Notification Service Client. #ifndef BLE_ANS_C_BLE_OBSERVER_PRIO #define BLE_ANS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_BAS_BLE_OBSERVER_PRIO +// BLE_BAS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Battery Service. #ifndef BLE_BAS_BLE_OBSERVER_PRIO #define BLE_BAS_BLE_OBSERVER_PRIO 2 #endif -// BLE_BAS_C_BLE_OBSERVER_PRIO +// BLE_BAS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Battery Service Client. #ifndef BLE_BAS_C_BLE_OBSERVER_PRIO #define BLE_BAS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_BPS_BLE_OBSERVER_PRIO +// BLE_BPS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Blood Pressure Service. #ifndef BLE_BPS_BLE_OBSERVER_PRIO #define BLE_BPS_BLE_OBSERVER_PRIO 2 #endif -// BLE_CONN_PARAMS_BLE_OBSERVER_PRIO +// BLE_CONN_PARAMS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Connection parameters module. #ifndef BLE_CONN_PARAMS_BLE_OBSERVER_PRIO #define BLE_CONN_PARAMS_BLE_OBSERVER_PRIO 2 #endif -// BLE_CONN_STATE_BLE_OBSERVER_PRIO +// BLE_CONN_STATE_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Connection State module. #ifndef BLE_CONN_STATE_BLE_OBSERVER_PRIO #define BLE_CONN_STATE_BLE_OBSERVER_PRIO 0 #endif -// BLE_CSCS_BLE_OBSERVER_PRIO +// BLE_CSCS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Cycling Speed and Cadence Service. #ifndef BLE_CSCS_BLE_OBSERVER_PRIO #define BLE_CSCS_BLE_OBSERVER_PRIO 2 #endif -// BLE_CTS_C_BLE_OBSERVER_PRIO +// BLE_CTS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Current Time Service Client. #ifndef BLE_CTS_C_BLE_OBSERVER_PRIO #define BLE_CTS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_DB_DISC_BLE_OBSERVER_PRIO +// BLE_DB_DISC_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Database Discovery module. #ifndef BLE_DB_DISC_BLE_OBSERVER_PRIO #define BLE_DB_DISC_BLE_OBSERVER_PRIO 1 #endif -// BLE_DFU_BLE_OBSERVER_PRIO +// BLE_DFU_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the DFU Service. #ifndef BLE_DFU_BLE_OBSERVER_PRIO #define BLE_DFU_BLE_OBSERVER_PRIO 2 #endif -// BLE_GLS_BLE_OBSERVER_PRIO +// BLE_GLS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Glucose Service. #ifndef BLE_GLS_BLE_OBSERVER_PRIO #define BLE_GLS_BLE_OBSERVER_PRIO 2 #endif -// BLE_HIDS_BLE_OBSERVER_PRIO +// BLE_HIDS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Human Interface Device Service. #ifndef BLE_HIDS_BLE_OBSERVER_PRIO #define BLE_HIDS_BLE_OBSERVER_PRIO 2 #endif -// BLE_HRS_BLE_OBSERVER_PRIO +// BLE_HRS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Heart Rate Service. #ifndef BLE_HRS_BLE_OBSERVER_PRIO #define BLE_HRS_BLE_OBSERVER_PRIO 2 #endif -// BLE_HRS_C_BLE_OBSERVER_PRIO +// BLE_HRS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Heart Rate Service Client. #ifndef BLE_HRS_C_BLE_OBSERVER_PRIO #define BLE_HRS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_HTS_BLE_OBSERVER_PRIO +// BLE_HTS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Health Thermometer Service. #ifndef BLE_HTS_BLE_OBSERVER_PRIO #define BLE_HTS_BLE_OBSERVER_PRIO 2 #endif -// BLE_IAS_BLE_OBSERVER_PRIO +// BLE_IAS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Immediate Alert Service. #ifndef BLE_IAS_BLE_OBSERVER_PRIO #define BLE_IAS_BLE_OBSERVER_PRIO 2 #endif -// BLE_IAS_C_BLE_OBSERVER_PRIO +// BLE_IAS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Immediate Alert Service Client. #ifndef BLE_IAS_C_BLE_OBSERVER_PRIO #define BLE_IAS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_LBS_BLE_OBSERVER_PRIO +// BLE_LBS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the LED Button Service. #ifndef BLE_LBS_BLE_OBSERVER_PRIO #define BLE_LBS_BLE_OBSERVER_PRIO 2 #endif -// BLE_LBS_C_BLE_OBSERVER_PRIO +// BLE_LBS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the LED Button Service Client. #ifndef BLE_LBS_C_BLE_OBSERVER_PRIO #define BLE_LBS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_LLS_BLE_OBSERVER_PRIO +// BLE_LLS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Link Loss Service. #ifndef BLE_LLS_BLE_OBSERVER_PRIO #define BLE_LLS_BLE_OBSERVER_PRIO 2 #endif -// BLE_LNS_BLE_OBSERVER_PRIO +// BLE_LNS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Location Navigation Service. #ifndef BLE_LNS_BLE_OBSERVER_PRIO #define BLE_LNS_BLE_OBSERVER_PRIO 2 #endif -// BLE_NUS_BLE_OBSERVER_PRIO +// BLE_NUS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the UART Service. #ifndef BLE_NUS_BLE_OBSERVER_PRIO #define BLE_NUS_BLE_OBSERVER_PRIO 2 #endif -// BLE_NUS_C_BLE_OBSERVER_PRIO +// BLE_NUS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the UART Central Service. #ifndef BLE_NUS_C_BLE_OBSERVER_PRIO #define BLE_NUS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_OTS_BLE_OBSERVER_PRIO +// BLE_OTS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Object transfer service. #ifndef BLE_OTS_BLE_OBSERVER_PRIO #define BLE_OTS_BLE_OBSERVER_PRIO 2 #endif -// BLE_OTS_C_BLE_OBSERVER_PRIO +// BLE_OTS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Object transfer service client. #ifndef BLE_OTS_C_BLE_OBSERVER_PRIO #define BLE_OTS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_RSCS_BLE_OBSERVER_PRIO +// BLE_RSCS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Running Speed and Cadence Service. #ifndef BLE_RSCS_BLE_OBSERVER_PRIO #define BLE_RSCS_BLE_OBSERVER_PRIO 2 #endif -// BLE_RSCS_C_BLE_OBSERVER_PRIO +// BLE_RSCS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Running Speed and Cadence Client. #ifndef BLE_RSCS_C_BLE_OBSERVER_PRIO #define BLE_RSCS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_TPS_BLE_OBSERVER_PRIO +// BLE_TPS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the TX Power Service. #ifndef BLE_TPS_BLE_OBSERVER_PRIO #define BLE_TPS_BLE_OBSERVER_PRIO 2 #endif -// BSP_BTN_BLE_OBSERVER_PRIO +// BSP_BTN_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Button Control module. #ifndef BSP_BTN_BLE_OBSERVER_PRIO #define BSP_BTN_BLE_OBSERVER_PRIO 1 #endif -// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO +// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the NFC pairing library. #ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO #define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 #endif -// NRF_BLE_BMS_BLE_OBSERVER_PRIO +// NRF_BLE_BMS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Bond Management Service. #ifndef NRF_BLE_BMS_BLE_OBSERVER_PRIO #define NRF_BLE_BMS_BLE_OBSERVER_PRIO 2 #endif -// NRF_BLE_CGMS_BLE_OBSERVER_PRIO +// NRF_BLE_CGMS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Contiuon Glucose Monitoring Service. #ifndef NRF_BLE_CGMS_BLE_OBSERVER_PRIO #define NRF_BLE_CGMS_BLE_OBSERVER_PRIO 2 #endif -// NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO +// NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the GATT Service Client. #ifndef NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO #define NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO 2 #endif -// NRF_BLE_GATT_BLE_OBSERVER_PRIO +// NRF_BLE_GATT_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the GATT module. #ifndef NRF_BLE_GATT_BLE_OBSERVER_PRIO #define NRF_BLE_GATT_BLE_OBSERVER_PRIO 2 #endif -// NRF_BLE_QWR_BLE_OBSERVER_PRIO +// NRF_BLE_QWR_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Queued writes module. #ifndef NRF_BLE_QWR_BLE_OBSERVER_PRIO #define NRF_BLE_QWR_BLE_OBSERVER_PRIO 2 #endif -// PM_BLE_OBSERVER_PRIO +// PM_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Peer Manager module. #ifndef PM_BLE_OBSERVER_PRIO #define PM_BLE_OBSERVER_PRIO 2 #endif -// +// //========================================================== -// +// //========================================================== @@ -8527,46 +8527,46 @@ #ifndef NRF_SDH_ENABLED #define NRF_SDH_ENABLED 1 #endif -// Dispatch model +// Dispatch model // This setting configures how Stack events are dispatched to the application. //========================================================== // NRF_SDH_DISPATCH_MODEL - + // NRF_SDH_DISPATCH_MODEL_INTERRUPT: SoftDevice events are passed to the application from the interrupt context. // NRF_SDH_DISPATCH_MODEL_APPSH: SoftDevice events are scheduled using @ref app_scheduler. // NRF_SDH_DISPATCH_MODEL_POLLING: SoftDevice events are to be fetched manually. -// <0=> NRF_SDH_DISPATCH_MODEL_INTERRUPT -// <1=> NRF_SDH_DISPATCH_MODEL_APPSH -// <2=> NRF_SDH_DISPATCH_MODEL_POLLING +// <0=> NRF_SDH_DISPATCH_MODEL_INTERRUPT +// <1=> NRF_SDH_DISPATCH_MODEL_APPSH +// <2=> NRF_SDH_DISPATCH_MODEL_POLLING #ifndef NRF_SDH_DISPATCH_MODEL #define NRF_SDH_DISPATCH_MODEL 0 #endif -// +// //========================================================== // Clock - SoftDevice clock configuration //========================================================== // NRF_SDH_CLOCK_LF_SRC - SoftDevice clock source. - -// <0=> NRF_CLOCK_LF_SRC_RC -// <1=> NRF_CLOCK_LF_SRC_XTAL -// <2=> NRF_CLOCK_LF_SRC_SYNTH + +// <0=> NRF_CLOCK_LF_SRC_RC +// <1=> NRF_CLOCK_LF_SRC_XTAL +// <2=> NRF_CLOCK_LF_SRC_SYNTH #ifndef NRF_SDH_CLOCK_LF_SRC #define NRF_SDH_CLOCK_LF_SRC 1 #endif -// NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. +// NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. #ifndef NRF_SDH_CLOCK_LF_RC_CTIV #define NRF_SDH_CLOCK_LF_RC_CTIV 0 #endif -// NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. +// NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. // How often (in number of calibration intervals) the RC oscillator shall be calibrated // if the temperature has not changed. @@ -8575,27 +8575,27 @@ #endif // NRF_SDH_CLOCK_LF_XTAL_ACCURACY - External crystal clock accuracy used in the LL to compute timing windows. - -// <0=> NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM -// <1=> NRF_CLOCK_LF_XTAL_ACCURACY_500_PPM -// <2=> NRF_CLOCK_LF_XTAL_ACCURACY_150_PPM -// <3=> NRF_CLOCK_LF_XTAL_ACCURACY_100_PPM -// <4=> NRF_CLOCK_LF_XTAL_ACCURACY_75_PPM -// <5=> NRF_CLOCK_LF_XTAL_ACCURACY_50_PPM -// <6=> NRF_CLOCK_LF_XTAL_ACCURACY_30_PPM -// <7=> NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM + +// <0=> NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM +// <1=> NRF_CLOCK_LF_XTAL_ACCURACY_500_PPM +// <2=> NRF_CLOCK_LF_XTAL_ACCURACY_150_PPM +// <3=> NRF_CLOCK_LF_XTAL_ACCURACY_100_PPM +// <4=> NRF_CLOCK_LF_XTAL_ACCURACY_75_PPM +// <5=> NRF_CLOCK_LF_XTAL_ACCURACY_50_PPM +// <6=> NRF_CLOCK_LF_XTAL_ACCURACY_30_PPM +// <7=> NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM #ifndef NRF_SDH_CLOCK_LF_XTAL_ACCURACY #define NRF_SDH_CLOCK_LF_XTAL_ACCURACY 7 #endif -// +// //========================================================== // SDH Observers - Observers and priority levels //========================================================== -// NRF_SDH_REQ_OBSERVER_PRIO_LEVELS - Total number of priority levels for request observers. +// NRF_SDH_REQ_OBSERVER_PRIO_LEVELS - Total number of priority levels for request observers. // This setting configures the number of priority levels available for the SoftDevice request event handlers. // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8603,7 +8603,7 @@ #define NRF_SDH_REQ_OBSERVER_PRIO_LEVELS 2 #endif -// NRF_SDH_STATE_OBSERVER_PRIO_LEVELS - Total number of priority levels for state observers. +// NRF_SDH_STATE_OBSERVER_PRIO_LEVELS - Total number of priority levels for state observers. // This setting configures the number of priority levels available for the SoftDevice state event handlers. // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8611,7 +8611,7 @@ #define NRF_SDH_STATE_OBSERVER_PRIO_LEVELS 2 #endif -// NRF_SDH_STACK_OBSERVER_PRIO_LEVELS - Total number of priority levels for stack event observers. +// NRF_SDH_STACK_OBSERVER_PRIO_LEVELS - Total number of priority levels for stack event observers. // This setting configures the number of priority levels available for the SoftDevice stack event handlers (ANT, BLE, SoC). // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8623,34 +8623,34 @@ // State Observers priorities - Invididual priorities //========================================================== -// CLOCK_CONFIG_STATE_OBSERVER_PRIO +// CLOCK_CONFIG_STATE_OBSERVER_PRIO // Priority with which state events are dispatched to the Clock driver. #ifndef CLOCK_CONFIG_STATE_OBSERVER_PRIO #define CLOCK_CONFIG_STATE_OBSERVER_PRIO 0 #endif -// POWER_CONFIG_STATE_OBSERVER_PRIO +// POWER_CONFIG_STATE_OBSERVER_PRIO // Priority with which state events are dispatched to the Power driver. #ifndef POWER_CONFIG_STATE_OBSERVER_PRIO #define POWER_CONFIG_STATE_OBSERVER_PRIO 0 #endif -// RNG_CONFIG_STATE_OBSERVER_PRIO +// RNG_CONFIG_STATE_OBSERVER_PRIO // Priority with which state events are dispatched to this module. #ifndef RNG_CONFIG_STATE_OBSERVER_PRIO #define RNG_CONFIG_STATE_OBSERVER_PRIO 0 #endif -// +// //========================================================== // Stack Event Observers priorities - Invididual priorities //========================================================== -// NRF_SDH_ANT_STACK_OBSERVER_PRIO +// NRF_SDH_ANT_STACK_OBSERVER_PRIO // This setting configures the priority with which ANT events are processed with respect to other events coming from the stack. // Modify this setting if you need to have ANT events dispatched before or after other stack events, such as BLE or SoC. // Zero is the highest priority. @@ -8659,7 +8659,7 @@ #define NRF_SDH_ANT_STACK_OBSERVER_PRIO 0 #endif -// NRF_SDH_BLE_STACK_OBSERVER_PRIO +// NRF_SDH_BLE_STACK_OBSERVER_PRIO // This setting configures the priority with which BLE events are processed with respect to other events coming from the stack. // Modify this setting if you need to have BLE events dispatched before or after other stack events, such as ANT or SoC. // Zero is the highest priority. @@ -8668,7 +8668,7 @@ #define NRF_SDH_BLE_STACK_OBSERVER_PRIO 0 #endif -// NRF_SDH_SOC_STACK_OBSERVER_PRIO +// NRF_SDH_SOC_STACK_OBSERVER_PRIO // This setting configures the priority with which SoC events are processed with respect to other events coming from the stack. // Modify this setting if you need to have SoC events dispatched before or after other stack events, such as ANT or BLE. // Zero is the highest priority. @@ -8677,10 +8677,10 @@ #define NRF_SDH_SOC_STACK_OBSERVER_PRIO 0 #endif -// +// //========================================================== -// +// //========================================================== @@ -8694,7 +8694,7 @@ // SoC Observers - Observers and priority levels //========================================================== -// NRF_SDH_SOC_OBSERVER_PRIO_LEVELS - Total number of priority levels for SoC observers. +// NRF_SDH_SOC_OBSERVER_PRIO_LEVELS - Total number of priority levels for SoC observers. // This setting configures the number of priority levels available for the SoC event handlers. // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8705,44 +8705,44 @@ // SoC Observers priorities - Invididual priorities //========================================================== -// BLE_ADV_SOC_OBSERVER_PRIO +// BLE_ADV_SOC_OBSERVER_PRIO // Priority with which SoC events are dispatched to the Advertising module. #ifndef BLE_ADV_SOC_OBSERVER_PRIO #define BLE_ADV_SOC_OBSERVER_PRIO 1 #endif -// BLE_DFU_SOC_OBSERVER_PRIO +// BLE_DFU_SOC_OBSERVER_PRIO // Priority with which BLE events are dispatched to the DFU Service. #ifndef BLE_DFU_SOC_OBSERVER_PRIO #define BLE_DFU_SOC_OBSERVER_PRIO 1 #endif -// CLOCK_CONFIG_SOC_OBSERVER_PRIO +// CLOCK_CONFIG_SOC_OBSERVER_PRIO // Priority with which SoC events are dispatched to the Clock driver. #ifndef CLOCK_CONFIG_SOC_OBSERVER_PRIO #define CLOCK_CONFIG_SOC_OBSERVER_PRIO 0 #endif -// POWER_CONFIG_SOC_OBSERVER_PRIO +// POWER_CONFIG_SOC_OBSERVER_PRIO // Priority with which SoC events are dispatched to the Power driver. #ifndef POWER_CONFIG_SOC_OBSERVER_PRIO #define POWER_CONFIG_SOC_OBSERVER_PRIO 0 #endif -// +// //========================================================== -// +// //========================================================== // -// +// //========================================================== // <<< end of configuration section >>> diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct index db643cd9903..569e7c86eab 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_ARM_STD/nRF52832.sct @@ -26,8 +26,8 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ER_IROM1 MBED_APP_START MBED_APP_SIZE { *.o (RESET, +First) - *(InRoot$$Sections) - .ANY (+RO) + *(InRoot$$Sections) + .ANY (+RO) } RW_IRAM0 MBED_RAM0_START UNINIT MBED_RAM0_SIZE { ;no init section diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_IAR/nRF52832.icf b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_IAR/nRF52832.icf index fd96dc69528..2131ab241ac 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_IAR/nRF52832.icf +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52832/device/TOOLCHAIN_IAR/nRF52832.icf @@ -55,7 +55,7 @@ define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; initialize by copy { readwrite }; do not initialize { section .noinit }; -place at address mem:__ICFEDIT_region_RAM_NVIC_start__ { section .noinit }; +place in RAM_region { section .noinit }; keep { section .intvec }; place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/config/sdk_config.h b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/config/sdk_config.h index 834e1991563..201402a18e2 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/config/sdk_config.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/config/sdk_config.h @@ -1,30 +1,30 @@ /** * Copyright (c) 2017 - 2017, Nordic Semiconductor ASA - * + * * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. - * + * * 2. Redistributions in binary form, except as embedded into a Nordic * Semiconductor ASA integrated circuit in a product or a software update for * such product, must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other * materials provided with the distribution. - * + * * 3. Neither the name of Nordic Semiconductor ASA nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. - * + * * 4. This software, with or without modification, must only be used with a * Nordic Semiconductor ASA integrated circuit. - * + * * 5. Any software provided in binary form under this license must not be reverse * engineered, decompiled, modified and/or disassembled. - * + * * THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE @@ -35,7 +35,7 @@ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * + * */ @@ -46,7 +46,7 @@ #ifdef USE_APP_CONFIG #include "app_config.h" #endif -// Board Support +// Board Support // Enable NRF Asserts when Mbed NDEBUG is not set #if !defined(NDEBUG) && !defined(DEBUG_NRF_USER) @@ -55,16 +55,16 @@ //========================================================== // BSP_BTN_BLE_ENABLED - bsp_btn_ble - Button Control for BLE - + #ifndef BSP_BTN_BLE_ENABLED #define BSP_BTN_BLE_ENABLED 0 #endif -// +// //========================================================== -// nRF_ANT +// nRF_ANT //========================================================== // ANTFS_ENABLED - ant_fs - ANT File Share module. @@ -72,96 +72,96 @@ #ifndef ANTFS_ENABLED #define ANTFS_ENABLED 0 #endif -// ANTFS_CONFIG_NETWORK_NUMBER - ANT-FS network number. +// ANTFS_CONFIG_NETWORK_NUMBER - ANT-FS network number. #ifndef ANTFS_CONFIG_NETWORK_NUMBER #define ANTFS_CONFIG_NETWORK_NUMBER 0 #endif -// ANTFS_CONFIG_CHANNEL_NUMBER - ANT-FS channel number. +// ANTFS_CONFIG_CHANNEL_NUMBER - ANT-FS channel number. #ifndef ANTFS_CONFIG_CHANNEL_NUMBER #define ANTFS_CONFIG_CHANNEL_NUMBER 0 #endif -// ANTFS_CONFIG_PAIRING_TIMEOUT - Pairing timeout - how long the UI will wait for a response to a pairing request before switching to the link layer, in seconds. +// ANTFS_CONFIG_PAIRING_TIMEOUT - Pairing timeout - how long the UI will wait for a response to a pairing request before switching to the link layer, in seconds. #ifndef ANTFS_CONFIG_PAIRING_TIMEOUT #define ANTFS_CONFIG_PAIRING_TIMEOUT 120 #endif -// ANTFS_CONFIG_LINK_COMMAND_TIMEOUT - Command timeout - how long the client will wait without receiving any commands before switching to the link layer, in seconds. +// ANTFS_CONFIG_LINK_COMMAND_TIMEOUT - Command timeout - how long the client will wait without receiving any commands before switching to the link layer, in seconds. #ifndef ANTFS_CONFIG_LINK_COMMAND_TIMEOUT #define ANTFS_CONFIG_LINK_COMMAND_TIMEOUT 10 #endif -// ANTFS_CONFIG_TRANS_TYPE - ANT-FS Transmission Type. +// ANTFS_CONFIG_TRANS_TYPE - ANT-FS Transmission Type. #ifndef ANTFS_CONFIG_TRANS_TYPE #define ANTFS_CONFIG_TRANS_TYPE 10 #endif -// ANTFS_CONFIG_DEVICE_TYPE - ANT device type for channel configuration. +// ANTFS_CONFIG_DEVICE_TYPE - ANT device type for channel configuration. #ifndef ANTFS_CONFIG_DEVICE_TYPE #define ANTFS_CONFIG_DEVICE_TYPE 1 #endif // ANTFS_CONFIG_BEACON_STATUS_PERIOD - ANT-FS Beacon Message Period. - -// <0=> 0.5 Hz -// <1=> 1 Hz -// <2=> 2 Hz -// <3=> 4 Hz -// <4=> 8 Hz + +// <0=> 0.5 Hz +// <1=> 1 Hz +// <2=> 2 Hz +// <3=> 4 Hz +// <4=> 8 Hz #ifndef ANTFS_CONFIG_BEACON_STATUS_PERIOD #define ANTFS_CONFIG_BEACON_STATUS_PERIOD 3 #endif // ANTFS_CONFIG_TRANSMIT_POWER - ANT Transmit Power. - -// <0=> Lowest ANT Tx power level setting. (-20dBm) -// <1=> ANT Tx power > Lvl 0. (-12dBm) -// <2=> ANT Tx power > Lvl 1. (-4dBm) -// <3=> ANT Tx power > Lvl 2. Default tx power level. (0dBm) -// <4=> ANT Tx power > Lvl 3. (+4dBm) -// <128=> Custom tx power selection + +// <0=> Lowest ANT Tx power level setting. (-20dBm) +// <1=> ANT Tx power > Lvl 0. (-12dBm) +// <2=> ANT Tx power > Lvl 1. (-4dBm) +// <3=> ANT Tx power > Lvl 2. Default tx power level. (0dBm) +// <4=> ANT Tx power > Lvl 3. (+4dBm) +// <128=> Custom tx power selection #ifndef ANTFS_CONFIG_TRANSMIT_POWER #define ANTFS_CONFIG_TRANSMIT_POWER 3 #endif -// ANTFS_CONFIG_CUSTOM_TRANSMIT_POWER - ANT Custom Transmit Power. +// ANTFS_CONFIG_CUSTOM_TRANSMIT_POWER - ANT Custom Transmit Power. #ifndef ANTFS_CONFIG_CUSTOM_TRANSMIT_POWER #define ANTFS_CONFIG_CUSTOM_TRANSMIT_POWER 0 #endif // ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED - Use pairing and key exchange authentication. - + #ifndef ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED #define ANTFS_CONFIG_AUTH_TYPE_PAIRING_ENABLED 0 #endif // ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED - Use passkey authentication. - + #ifndef ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED #define ANTFS_CONFIG_AUTH_TYPE_PASSKEY_ENABLED 0 #endif // ANTFS_CONFIG_AUTH_TYPE_PASSTHROUGH_ENABLED - Allow host to bypass authentication. - + #ifndef ANTFS_CONFIG_AUTH_TYPE_PASSTHROUGH_ENABLED #define ANTFS_CONFIG_AUTH_TYPE_PASSTHROUGH_ENABLED 0 #endif // ANTFS_CONFIG_UPLOAD_ENABLED - Support upload operation. - + #ifndef ANTFS_CONFIG_UPLOAD_ENABLED #define ANTFS_CONFIG_UPLOAD_ENABLED 0 #endif // ANTFS_CONFIG_DEBUG_LED_ENABLED - Enables LED debug in the module. - + #ifndef ANTFS_CONFIG_DEBUG_LED_ENABLED #define ANTFS_CONFIG_DEBUG_LED_ENABLED 0 @@ -180,28 +180,28 @@ #define ANT_BPWR_LOG_ENABLED 0 #endif // ANT_BPWR_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_LOG_LEVEL #define ANT_BPWR_LOG_LEVEL 3 #endif // ANT_BPWR_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_INFO_COLOR #define ANT_BPWR_INFO_COLOR 0 @@ -215,28 +215,28 @@ #define ANT_BPWR_COMMON_LOG_ENABLED 0 #endif // ANT_BPWR_COMMON_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_COMMON_LOG_LEVEL #define ANT_BPWR_COMMON_LOG_LEVEL 3 #endif // ANT_BPWR_COMMON_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_COMMON_INFO_COLOR #define ANT_BPWR_COMMON_INFO_COLOR 0 @@ -250,28 +250,28 @@ #define ANT_BPWR_PAGE_TORQUE_LOG_ENABLED 0 #endif // ANT_BPWR_PAGE_TORQUE_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_PAGE_TORQUE_LOG_LEVEL #define ANT_BPWR_PAGE_TORQUE_LOG_LEVEL 3 #endif // ANT_BPWR_PAGE_TORQUE_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_PAGE_TORQUE_INFO_COLOR #define ANT_BPWR_PAGE_TORQUE_INFO_COLOR 0 @@ -285,28 +285,28 @@ #define ANT_BPWR_PAGE_1_LOG_ENABLED 0 #endif // ANT_BPWR_PAGE_1_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_PAGE_1_LOG_LEVEL #define ANT_BPWR_PAGE_1_LOG_LEVEL 3 #endif // ANT_BPWR_PAGE_1_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_PAGE_1_INFO_COLOR #define ANT_BPWR_PAGE_1_INFO_COLOR 0 @@ -320,28 +320,28 @@ #define ANT_BPWR_PAGE_16_LOG_ENABLED 0 #endif // ANT_BPWR_PAGE_16_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_PAGE_16_LOG_LEVEL #define ANT_BPWR_PAGE_16_LOG_LEVEL 3 #endif // ANT_BPWR_PAGE_16_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_PAGE_16_INFO_COLOR #define ANT_BPWR_PAGE_16_INFO_COLOR 0 @@ -355,28 +355,28 @@ #define ANT_BPWR_PAGE_17_LOG_ENABLED 0 #endif // ANT_BPWR_PAGE_17_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_PAGE_17_LOG_LEVEL #define ANT_BPWR_PAGE_17_LOG_LEVEL 3 #endif // ANT_BPWR_PAGE_17_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_PAGE_17_INFO_COLOR #define ANT_BPWR_PAGE_17_INFO_COLOR 0 @@ -390,28 +390,28 @@ #define ANT_BPWR_PAGE_18_LOG_ENABLED 0 #endif // ANT_BPWR_PAGE_18_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BPWR_PAGE_18_LOG_LEVEL #define ANT_BPWR_PAGE_18_LOG_LEVEL 3 #endif // ANT_BPWR_PAGE_18_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BPWR_PAGE_18_INFO_COLOR #define ANT_BPWR_PAGE_18_INFO_COLOR 0 @@ -432,28 +432,28 @@ #define ANT_BSC_LOG_ENABLED 0 #endif // ANT_BSC_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_LOG_LEVEL #define ANT_BSC_LOG_LEVEL 3 #endif // ANT_BSC_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_INFO_COLOR #define ANT_BSC_INFO_COLOR 0 @@ -467,28 +467,28 @@ #define ANT_BSC_COMBINED_PAGE_0_LOG_ENABLED 0 #endif // ANT_BSC_COMBINED_PAGE_0_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_COMBINED_PAGE_0_LOG_LEVEL #define ANT_BSC_COMBINED_PAGE_0_LOG_LEVEL 3 #endif // ANT_BSC_COMBINED_PAGE_0_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_COMBINED_PAGE_0_INFO_COLOR #define ANT_BSC_COMBINED_PAGE_0_INFO_COLOR 0 @@ -502,28 +502,28 @@ #define ANT_BSC_PAGE_0_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_0_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_0_LOG_LEVEL #define ANT_BSC_PAGE_0_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_0_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_0_INFO_COLOR #define ANT_BSC_PAGE_0_INFO_COLOR 0 @@ -537,28 +537,28 @@ #define ANT_BSC_PAGE_1_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_1_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_1_LOG_LEVEL #define ANT_BSC_PAGE_1_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_1_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_1_INFO_COLOR #define ANT_BSC_PAGE_1_INFO_COLOR 0 @@ -572,28 +572,28 @@ #define ANT_BSC_PAGE_2_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_2_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_2_LOG_LEVEL #define ANT_BSC_PAGE_2_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_2_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_2_INFO_COLOR #define ANT_BSC_PAGE_2_INFO_COLOR 0 @@ -607,28 +607,28 @@ #define ANT_BSC_PAGE_3_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_3_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_3_LOG_LEVEL #define ANT_BSC_PAGE_3_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_3_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_3_INFO_COLOR #define ANT_BSC_PAGE_3_INFO_COLOR 0 @@ -642,28 +642,28 @@ #define ANT_BSC_PAGE_4_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_4_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_4_LOG_LEVEL #define ANT_BSC_PAGE_4_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_4_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_4_INFO_COLOR #define ANT_BSC_PAGE_4_INFO_COLOR 0 @@ -677,28 +677,28 @@ #define ANT_BSC_PAGE_5_LOG_ENABLED 0 #endif // ANT_BSC_PAGE_5_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_BSC_PAGE_5_LOG_LEVEL #define ANT_BSC_PAGE_5_LOG_LEVEL 3 #endif // ANT_BSC_PAGE_5_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_BSC_PAGE_5_INFO_COLOR #define ANT_BSC_PAGE_5_INFO_COLOR 0 @@ -709,7 +709,7 @@ // // ANT_CHANNEL_CONFIG_ENABLED - ant_channel_config - ANT common channel configuration - + #ifndef ANT_CHANNEL_CONFIG_ENABLED #define ANT_CHANNEL_CONFIG_ENABLED 0 @@ -726,28 +726,28 @@ #define ANT_COMMON_PAGE_70_LOG_ENABLED 0 #endif // ANT_COMMON_PAGE_70_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_COMMON_PAGE_70_LOG_LEVEL #define ANT_COMMON_PAGE_70_LOG_LEVEL 3 #endif // ANT_COMMON_PAGE_70_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_COMMON_PAGE_70_INFO_COLOR #define ANT_COMMON_PAGE_70_INFO_COLOR 0 @@ -768,28 +768,28 @@ #define ANT_COMMON_PAGE_80_LOG_ENABLED 0 #endif // ANT_COMMON_PAGE_80_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_COMMON_PAGE_80_LOG_LEVEL #define ANT_COMMON_PAGE_80_LOG_LEVEL 3 #endif // ANT_COMMON_PAGE_80_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_COMMON_PAGE_80_INFO_COLOR #define ANT_COMMON_PAGE_80_INFO_COLOR 0 @@ -810,28 +810,28 @@ #define ANT_COMMON_PAGE_81_LOG_ENABLED 0 #endif // ANT_COMMON_PAGE_81_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_COMMON_PAGE_81_LOG_LEVEL #define ANT_COMMON_PAGE_81_LOG_LEVEL 3 #endif // ANT_COMMON_PAGE_81_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_COMMON_PAGE_81_INFO_COLOR #define ANT_COMMON_PAGE_81_INFO_COLOR 0 @@ -842,7 +842,7 @@ // // ANT_ENCRYPT_CONFIG_ENABLED - ant_encrypt_config - Cryptographic ANT stack configuration - + #ifndef ANT_ENCRYPT_CONFIG_ENABLED #define ANT_ENCRYPT_CONFIG_ENABLED 0 @@ -859,28 +859,28 @@ #define ANT_HRM_LOG_ENABLED 0 #endif // ANT_HRM_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_LOG_LEVEL #define ANT_HRM_LOG_LEVEL 3 #endif // ANT_HRM_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_INFO_COLOR #define ANT_HRM_INFO_COLOR 0 @@ -894,28 +894,28 @@ #define ANT_HRM_PAGE_0_LOG_ENABLED 0 #endif // ANT_HRM_PAGE_0_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_PAGE_0_LOG_LEVEL #define ANT_HRM_PAGE_0_LOG_LEVEL 3 #endif // ANT_HRM_PAGE_0_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_PAGE_0_INFO_COLOR #define ANT_HRM_PAGE_0_INFO_COLOR 0 @@ -929,28 +929,28 @@ #define ANT_HRM_PAGE_1_LOG_ENABLED 0 #endif // ANT_HRM_PAGE_1_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_PAGE_1_LOG_LEVEL #define ANT_HRM_PAGE_1_LOG_LEVEL 3 #endif // ANT_HRM_PAGE_1_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_PAGE_1_INFO_COLOR #define ANT_HRM_PAGE_1_INFO_COLOR 0 @@ -964,28 +964,28 @@ #define ANT_HRM_PAGE_2_LOG_ENABLED 0 #endif // ANT_HRM_PAGE_2_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_PAGE_2_LOG_LEVEL #define ANT_HRM_PAGE_2_LOG_LEVEL 3 #endif // ANT_HRM_PAGE_2_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_PAGE_2_INFO_COLOR #define ANT_HRM_PAGE_2_INFO_COLOR 0 @@ -999,28 +999,28 @@ #define ANT_HRM_PAGE_3_LOG_ENABLED 0 #endif // ANT_HRM_PAGE_3_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_PAGE_3_LOG_LEVEL #define ANT_HRM_PAGE_3_LOG_LEVEL 3 #endif // ANT_HRM_PAGE_3_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_PAGE_3_INFO_COLOR #define ANT_HRM_PAGE_3_INFO_COLOR 0 @@ -1034,28 +1034,28 @@ #define ANT_HRM_PAGE_4_LOG_ENABLED 0 #endif // ANT_HRM_PAGE_4_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_HRM_PAGE_4_LOG_LEVEL #define ANT_HRM_PAGE_4_LOG_LEVEL 3 #endif // ANT_HRM_PAGE_4_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_HRM_PAGE_4_INFO_COLOR #define ANT_HRM_PAGE_4_INFO_COLOR 0 @@ -1066,14 +1066,14 @@ // // ANT_KEY_MANAGER_ENABLED - ant_key_manager - Software Component - + #ifndef ANT_KEY_MANAGER_ENABLED #define ANT_KEY_MANAGER_ENABLED 0 #endif // ANT_REQUEST_CONTROLLER_ENABLED - ant_request_controller - ANT+ request controller - + #ifndef ANT_REQUEST_CONTROLLER_ENABLED #define ANT_REQUEST_CONTROLLER_ENABLED 0 @@ -1090,28 +1090,28 @@ #define ANT_SDM_LOG_ENABLED 0 #endif // ANT_SDM_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef ANT_SDM_LOG_LEVEL #define ANT_SDM_LOG_LEVEL 3 #endif // ANT_SDM_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef ANT_SDM_INFO_COLOR #define ANT_SDM_INFO_COLOR 0 @@ -1126,14 +1126,14 @@ #ifndef ANT_SEARCH_CONFIG_ENABLED #define ANT_SEARCH_CONFIG_ENABLED 0 #endif -// ANT_DEFAULT_LOW_PRIORITY_TIMEOUT - Default low priority search time-out. <0-255> +// ANT_DEFAULT_LOW_PRIORITY_TIMEOUT - Default low priority search time-out. <0-255> #ifndef ANT_DEFAULT_LOW_PRIORITY_TIMEOUT #define ANT_DEFAULT_LOW_PRIORITY_TIMEOUT 2 #endif -// ANT_DEFAULT_HIGH_PRIORITY_TIMEOUT - Default high priority search time-out. <0-255> +// ANT_DEFAULT_HIGH_PRIORITY_TIMEOUT - Default high priority search time-out. <0-255> #ifndef ANT_DEFAULT_HIGH_PRIORITY_TIMEOUT @@ -1147,22 +1147,22 @@ #ifndef ANT_STACK_CONFIG_ENABLED #define ANT_STACK_CONFIG_ENABLED 0 #endif -// ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED - Allocated ANT channels +// ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED - Allocated ANT channels #ifndef ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED #define ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED 0 #endif -// ANT_CONFIG_ENCRYPTED_CHANNELS - Encrypted ANT channels +// ANT_CONFIG_ENCRYPTED_CHANNELS - Encrypted ANT channels #ifndef ANT_CONFIG_ENCRYPTED_CHANNELS #define ANT_CONFIG_ENCRYPTED_CHANNELS 0 #endif -// ANT_CONFIG_EVENT_QUEUE_SIZE - Event queue size +// ANT_CONFIG_EVENT_QUEUE_SIZE - Event queue size #ifndef ANT_CONFIG_EVENT_QUEUE_SIZE #define ANT_CONFIG_EVENT_QUEUE_SIZE 32 #endif -// ANT_CONFIG_BURST_QUEUE_SIZE - ANT burst queue size +// ANT_CONFIG_BURST_QUEUE_SIZE - ANT burst queue size #ifndef ANT_CONFIG_BURST_QUEUE_SIZE #define ANT_CONFIG_BURST_QUEUE_SIZE 128 #endif @@ -1174,35 +1174,35 @@ #ifndef ANT_STATE_INDICATOR_ENABLED #define ANT_STATE_INDICATOR_ENABLED 0 #endif -// ANT_STATE_INDICATOR_CONFIG_SHUTDOWN_HANDLER_PRIORITY - Shutdown observer priority. +// ANT_STATE_INDICATOR_CONFIG_SHUTDOWN_HANDLER_PRIORITY - Shutdown observer priority. #ifndef ANT_STATE_INDICATOR_CONFIG_SHUTDOWN_HANDLER_PRIORITY #define ANT_STATE_INDICATOR_CONFIG_SHUTDOWN_HANDLER_PRIORITY 1 #endif // -// +// //========================================================== -// nRF_BLE +// nRF_BLE //========================================================== // BLE_ADVERTISING_ENABLED - ble_advertising - Advertising module - + #ifndef BLE_ADVERTISING_ENABLED #define BLE_ADVERTISING_ENABLED 0 #endif // BLE_DTM_ENABLED - ble_dtm - Module for testing RF/PHY using DTM commands - + #ifndef BLE_DTM_ENABLED #define BLE_DTM_ENABLED 0 #endif // BLE_RACP_ENABLED - ble_racp - Record Access Control Point library - + #ifndef BLE_RACP_ENABLED #define BLE_RACP_ENABLED 0 @@ -1213,14 +1213,14 @@ #ifndef NRF_BLE_CONN_PARAMS_ENABLED #define NRF_BLE_CONN_PARAMS_ENABLED 0 #endif -// NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION - The largest acceptable deviation in slave latency. +// NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION - The largest acceptable deviation in slave latency. // The largest deviation (+ or -) from the requested slave latency that will not be renegotiated. #ifndef NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION #define NRF_BLE_CONN_PARAMS_MAX_SLAVE_LATENCY_DEVIATION 499 #endif -// NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION - The largest acceptable deviation (in 10 ms units) in supervision timeout. +// NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION - The largest acceptable deviation (in 10 ms units) in supervision timeout. // The largest deviation (+ or -, in 10 ms units) from the requested supervision timeout that will not be renegotiated. #ifndef NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION @@ -1230,7 +1230,7 @@ // // NRF_BLE_QWR_ENABLED - nrf_ble_qwr - Queued writes support module (prepare/execute write) - + #ifndef NRF_BLE_QWR_ENABLED #define NRF_BLE_QWR_ENABLED 0 @@ -1241,14 +1241,14 @@ #ifndef PEER_MANAGER_ENABLED #define PEER_MANAGER_ENABLED 0 #endif -// PM_MAX_REGISTRANTS +// PM_MAX_REGISTRANTS // Number of event handlers that can be registered. #ifndef PM_MAX_REGISTRANTS #define PM_MAX_REGISTRANTS 3 #endif -// PM_FLASH_BUFFERS +// PM_FLASH_BUFFERS // Number of internal buffers for flash operations. // Decrease this value to lower RAM usage. @@ -1258,170 +1258,170 @@ // -// +// //========================================================== -// nRF_BLE_Services +// nRF_BLE_Services //========================================================== // BLE_ANCS_C_ENABLED - ble_ancs_c - Apple Notification Service Client - + #ifndef BLE_ANCS_C_ENABLED #define BLE_ANCS_C_ENABLED 0 #endif // BLE_ANS_C_ENABLED - ble_ans_c - Alert Notification Service Client - + #ifndef BLE_ANS_C_ENABLED #define BLE_ANS_C_ENABLED 0 #endif // BLE_BAS_C_ENABLED - ble_bas_c - Battery Service Client - + #ifndef BLE_BAS_C_ENABLED #define BLE_BAS_C_ENABLED 0 #endif // BLE_BAS_ENABLED - ble_bas - Battery Service - + #ifndef BLE_BAS_ENABLED #define BLE_BAS_ENABLED 0 #endif // BLE_CSCS_ENABLED - ble_cscs - Cycling Speed and Cadence Service - + #ifndef BLE_CSCS_ENABLED #define BLE_CSCS_ENABLED 0 #endif // BLE_CTS_C_ENABLED - ble_cts_c - Current Time Service Client - + #ifndef BLE_CTS_C_ENABLED #define BLE_CTS_C_ENABLED 0 #endif // BLE_DIS_ENABLED - ble_dis - Device Information Service - + #ifndef BLE_DIS_ENABLED #define BLE_DIS_ENABLED 0 #endif // BLE_GLS_ENABLED - ble_gls - Glucose Service - + #ifndef BLE_GLS_ENABLED #define BLE_GLS_ENABLED 0 #endif // BLE_HIDS_ENABLED - ble_hids - Human Interface Device Service - + #ifndef BLE_HIDS_ENABLED #define BLE_HIDS_ENABLED 0 #endif // BLE_HRS_C_ENABLED - ble_hrs_c - Heart Rate Service Client - + #ifndef BLE_HRS_C_ENABLED #define BLE_HRS_C_ENABLED 0 #endif // BLE_HRS_ENABLED - ble_hrs - Heart Rate Service - + #ifndef BLE_HRS_ENABLED #define BLE_HRS_ENABLED 0 #endif // BLE_HTS_ENABLED - ble_hts - Health Thermometer Service - + #ifndef BLE_HTS_ENABLED #define BLE_HTS_ENABLED 0 #endif // BLE_IAS_C_ENABLED - ble_ias_c - Immediate Alert Service Client - + #ifndef BLE_IAS_C_ENABLED #define BLE_IAS_C_ENABLED 0 #endif // BLE_IAS_ENABLED - ble_ias - Immediate Alert Service - + #ifndef BLE_IAS_ENABLED #define BLE_IAS_ENABLED 0 #endif // BLE_LBS_C_ENABLED - ble_lbs_c - Nordic LED Button Service Client - + #ifndef BLE_LBS_C_ENABLED #define BLE_LBS_C_ENABLED 0 #endif // BLE_LBS_ENABLED - ble_lbs - LED Button Service - + #ifndef BLE_LBS_ENABLED #define BLE_LBS_ENABLED 0 #endif // BLE_LLS_ENABLED - ble_lls - Link Loss Service - + #ifndef BLE_LLS_ENABLED #define BLE_LLS_ENABLED 0 #endif // BLE_NUS_C_ENABLED - ble_nus_c - Nordic UART Central Service - + #ifndef BLE_NUS_C_ENABLED #define BLE_NUS_C_ENABLED 0 #endif // BLE_NUS_ENABLED - ble_nus - Nordic UART Service - + #ifndef BLE_NUS_ENABLED #define BLE_NUS_ENABLED 0 #endif // BLE_RSCS_C_ENABLED - ble_rscs_c - Running Speed and Cadence Client - + #ifndef BLE_RSCS_C_ENABLED #define BLE_RSCS_C_ENABLED 0 #endif // BLE_RSCS_ENABLED - ble_rscs - Running Speed and Cadence Service - + #ifndef BLE_RSCS_ENABLED #define BLE_RSCS_ENABLED 0 #endif // BLE_TPS_ENABLED - ble_tps - TX Power Service - + #ifndef BLE_TPS_ENABLED #define BLE_TPS_ENABLED 0 #endif -// +// //========================================================== -// nRF_Core +// nRF_Core //========================================================== // NRF_MPU_ENABLED - nrf_mpu - Module for MPU @@ -1430,7 +1430,7 @@ #define NRF_MPU_ENABLED 0 #endif // NRF_MPU_CLI_CMDS - Enable CLI commands specific to the module - + #ifndef NRF_MPU_CLI_CMDS #define NRF_MPU_CLI_CMDS 1 @@ -1444,15 +1444,15 @@ #define NRF_STACK_GUARD_ENABLED 0 #endif // NRF_STACK_GUARD_CONFIG_SIZE - Size of stack guard - -// <5=> 32 bytes -// <6=> 64 bytes -// <7=> 128 bytes -// <8=> 256 bytes -// <9=> 512 bytes -// <10=> 1024 bytes -// <11=> 2048 bytes -// <12=> 4096 bytes + +// <5=> 32 bytes +// <6=> 64 bytes +// <7=> 128 bytes +// <8=> 256 bytes +// <9=> 512 bytes +// <10=> 1024 bytes +// <11=> 2048 bytes +// <12=> 4096 bytes #ifndef NRF_STACK_GUARD_CONFIG_SIZE #define NRF_STACK_GUARD_CONFIG_SIZE 7 @@ -1460,10 +1460,10 @@ // -// +// //========================================================== -// nRF_Crypto +// nRF_Crypto //========================================================== // NRF_CRYPTO_ENABLED - nrf_crypto - Cryptography library @@ -1472,7 +1472,7 @@ #define NRF_CRYPTO_ENABLED 0 #endif // NRF_CRYPTO_BACKEND_CC310_LIB - Enable the ARM Cryptocell CC310 backend - + // The hardware-accelerated cryptography backend is available only on nRF52840. @@ -1488,7 +1488,7 @@ #define NRF_CRYPTO_BACKEND_MICRO_ECC 0 #endif // NRF_CRYPTO_BACKEND_MICRO_ECC_SHA256 - Enable SHA256 - + // Enable SHA256 cryptographic hash functionality. // Enable this setting if you need SHA256 support, for example to verify signatures. @@ -1498,7 +1498,7 @@ #endif // NRF_CRYPTO_BACKEND_MICRO_ECC_RNG - Enable random number generator - + // Enable random number generation. // Enable this setting if you need to generate cryptographic keys. @@ -1512,36 +1512,36 @@ // -// +// //========================================================== -// nRF_DFU +// nRF_DFU //========================================================== // ble_dfu - Device Firmware Update //========================================================== // BLE_DFU_ENABLED - Enable DFU Service. - + #ifndef BLE_DFU_ENABLED #define BLE_DFU_ENABLED 0 #endif // NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS - Buttonless DFU supports bonds. - + #ifndef NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS #define NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS 0 #endif -// +// //========================================================== -// +// //========================================================== -// nRF_Drivers +// nRF_Drivers //========================================================== // APP_USBD_ENABLED - app_usbd - USB Device library @@ -1549,7 +1549,7 @@ #ifndef APP_USBD_ENABLED #define APP_USBD_ENABLED 0 #endif -// APP_USBD_VID - Vendor ID <0x0000-0xFFFF> +// APP_USBD_VID - Vendor ID <0x0000-0xFFFF> // Vendor ID ordered from USB IF: http://www.usb.org/developers/vendor/ @@ -1558,7 +1558,7 @@ #define APP_USBD_VID 0 #endif -// APP_USBD_PID - Product ID <0x0000-0xFFFF> +// APP_USBD_PID - Product ID <0x0000-0xFFFF> // Selected Product ID @@ -1567,7 +1567,7 @@ #define APP_USBD_PID 0 #endif -// APP_USBD_DEVICE_VER_MAJOR - Device version, major part <0-99> +// APP_USBD_DEVICE_VER_MAJOR - Device version, major part <0-99> // Device version, will be converted automatically to BCD notation. Use just decimal values. @@ -1576,7 +1576,7 @@ #define APP_USBD_DEVICE_VER_MAJOR 1 #endif -// APP_USBD_DEVICE_VER_MINOR - Device version, minor part <0-99> +// APP_USBD_DEVICE_VER_MINOR - Device version, minor part <0-99> // Device version, will be converted automatically to BCD notation. Use just decimal values. @@ -1595,7 +1595,7 @@ #ifndef APP_USBD_EVENT_QUEUE_ENABLE #define APP_USBD_EVENT_QUEUE_ENABLE 1 #endif -// APP_USBD_EVENT_QUEUE_SIZE - The size of event queue <16-64> +// APP_USBD_EVENT_QUEUE_SIZE - The size of event queue <16-64> // The size of the queue for the events that would be processed in the main loop. @@ -1612,44 +1612,44 @@ #define APP_USBD_CONFIG_LOG_ENABLED 0 #endif // APP_USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef APP_USBD_CONFIG_LOG_LEVEL #define APP_USBD_CONFIG_LOG_LEVEL 3 #endif // APP_USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_CONFIG_INFO_COLOR #define APP_USBD_CONFIG_INFO_COLOR 0 #endif // APP_USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_CONFIG_DEBUG_COLOR #define APP_USBD_CONFIG_DEBUG_COLOR 0 @@ -1665,35 +1665,35 @@ #define CLOCK_ENABLED 0 #endif // CLOCK_CONFIG_XTAL_FREQ - HF XTAL Frequency - -// <0=> Default (64 MHz) + +// <0=> Default (64 MHz) #ifndef CLOCK_CONFIG_XTAL_FREQ #define CLOCK_CONFIG_XTAL_FREQ 0 #endif // CLOCK_CONFIG_LF_SRC - LF Clock Source - -// <0=> RC -// <1=> XTAL -// <2=> Synth + +// <0=> RC +// <1=> XTAL +// <2=> Synth #ifndef CLOCK_CONFIG_LF_SRC #define CLOCK_CONFIG_LF_SRC 1 #endif // CLOCK_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef CLOCK_CONFIG_IRQ_PRIORITY #define CLOCK_CONFIG_IRQ_PRIORITY 7 @@ -1707,83 +1707,83 @@ #define COMP_ENABLED 0 #endif // COMP_CONFIG_REF - Reference voltage - -// <0=> Internal 1.2V -// <1=> Internal 1.8V -// <2=> Internal 2.4V -// <4=> VDD -// <7=> ARef + +// <0=> Internal 1.2V +// <1=> Internal 1.8V +// <2=> Internal 2.4V +// <4=> VDD +// <7=> ARef #ifndef COMP_CONFIG_REF #define COMP_CONFIG_REF 1 #endif // COMP_CONFIG_MAIN_MODE - Main mode - -// <0=> Single ended -// <1=> Differential + +// <0=> Single ended +// <1=> Differential #ifndef COMP_CONFIG_MAIN_MODE #define COMP_CONFIG_MAIN_MODE 0 #endif // COMP_CONFIG_SPEED_MODE - Speed mode - -// <0=> Low power -// <1=> Normal -// <2=> High speed + +// <0=> Low power +// <1=> Normal +// <2=> High speed #ifndef COMP_CONFIG_SPEED_MODE #define COMP_CONFIG_SPEED_MODE 2 #endif // COMP_CONFIG_HYST - Hystheresis - -// <0=> No -// <1=> 50mV + +// <0=> No +// <1=> 50mV #ifndef COMP_CONFIG_HYST #define COMP_CONFIG_HYST 0 #endif // COMP_CONFIG_ISOURCE - Current Source - -// <0=> Off -// <1=> 2.5 uA -// <2=> 5 uA -// <3=> 10 uA + +// <0=> Off +// <1=> 2.5 uA +// <2=> 5 uA +// <3=> 10 uA #ifndef COMP_CONFIG_ISOURCE #define COMP_CONFIG_ISOURCE 0 #endif // COMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 + +// <0=> 0 +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef COMP_CONFIG_INPUT #define COMP_CONFIG_INPUT 0 #endif // COMP_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef COMP_CONFIG_IRQ_PRIORITY #define COMP_CONFIG_IRQ_PRIORITY 7 @@ -1792,10 +1792,10 @@ // // EGU_ENABLED - nrf_drv_swi - SWI(EGU) peripheral driver - + #ifndef EGU_ENABLED -#define EGU_ENABLED 0 +#define EGU_ENABLED 1 #endif // GPIOTE_ENABLED - nrf_drv_gpiote - GPIOTE peripheral driver @@ -1803,23 +1803,23 @@ #ifndef GPIOTE_ENABLED #define GPIOTE_ENABLED 1 #endif -// GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins +// GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS - Number of lower power input pins #ifndef GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS #define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 4 #endif // GPIOTE_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef GPIOTE_CONFIG_IRQ_PRIORITY #define GPIOTE_CONFIG_IRQ_PRIORITY 7 @@ -1832,33 +1832,33 @@ #ifndef I2S_ENABLED #define I2S_ENABLED 0 #endif -// I2S_CONFIG_SCK_PIN - SCK pin <0-31> +// I2S_CONFIG_SCK_PIN - SCK pin <0-31> #ifndef I2S_CONFIG_SCK_PIN #define I2S_CONFIG_SCK_PIN 31 #endif -// I2S_CONFIG_LRCK_PIN - LRCK pin <1-31> +// I2S_CONFIG_LRCK_PIN - LRCK pin <1-31> #ifndef I2S_CONFIG_LRCK_PIN #define I2S_CONFIG_LRCK_PIN 30 #endif -// I2S_CONFIG_MCK_PIN - MCK pin +// I2S_CONFIG_MCK_PIN - MCK pin #ifndef I2S_CONFIG_MCK_PIN #define I2S_CONFIG_MCK_PIN 255 #endif -// I2S_CONFIG_SDOUT_PIN - SDOUT pin <0-31> +// I2S_CONFIG_SDOUT_PIN - SDOUT pin <0-31> #ifndef I2S_CONFIG_SDOUT_PIN #define I2S_CONFIG_SDOUT_PIN 29 #endif -// I2S_CONFIG_SDIN_PIN - SDIN pin <0-31> +// I2S_CONFIG_SDIN_PIN - SDIN pin <0-31> #ifndef I2S_CONFIG_SDIN_PIN @@ -1866,106 +1866,106 @@ #endif // I2S_CONFIG_MASTER - Mode - -// <0=> Master -// <1=> Slave + +// <0=> Master +// <1=> Slave #ifndef I2S_CONFIG_MASTER #define I2S_CONFIG_MASTER 0 #endif // I2S_CONFIG_FORMAT - Format - -// <0=> I2S -// <1=> Aligned + +// <0=> I2S +// <1=> Aligned #ifndef I2S_CONFIG_FORMAT #define I2S_CONFIG_FORMAT 0 #endif // I2S_CONFIG_ALIGN - Alignment - -// <0=> Left -// <1=> Right + +// <0=> Left +// <1=> Right #ifndef I2S_CONFIG_ALIGN #define I2S_CONFIG_ALIGN 0 #endif // I2S_CONFIG_SWIDTH - Sample width (bits) - -// <0=> 8 -// <1=> 16 -// <2=> 24 + +// <0=> 8 +// <1=> 16 +// <2=> 24 #ifndef I2S_CONFIG_SWIDTH #define I2S_CONFIG_SWIDTH 1 #endif // I2S_CONFIG_CHANNELS - Channels - -// <0=> Stereo -// <1=> Left -// <2=> Right + +// <0=> Stereo +// <1=> Left +// <2=> Right #ifndef I2S_CONFIG_CHANNELS #define I2S_CONFIG_CHANNELS 1 #endif // I2S_CONFIG_MCK_SETUP - MCK behavior - -// <0=> Disabled -// <2147483648=> 32MHz/2 -// <1342177280=> 32MHz/3 -// <1073741824=> 32MHz/4 -// <805306368=> 32MHz/5 -// <671088640=> 32MHz/6 -// <536870912=> 32MHz/8 -// <402653184=> 32MHz/10 -// <369098752=> 32MHz/11 -// <285212672=> 32MHz/15 -// <268435456=> 32MHz/16 -// <201326592=> 32MHz/21 -// <184549376=> 32MHz/23 -// <142606336=> 32MHz/30 -// <138412032=> 32MHz/31 -// <134217728=> 32MHz/32 -// <100663296=> 32MHz/42 -// <68157440=> 32MHz/63 -// <34340864=> 32MHz/125 + +// <0=> Disabled +// <2147483648=> 32MHz/2 +// <1342177280=> 32MHz/3 +// <1073741824=> 32MHz/4 +// <805306368=> 32MHz/5 +// <671088640=> 32MHz/6 +// <536870912=> 32MHz/8 +// <402653184=> 32MHz/10 +// <369098752=> 32MHz/11 +// <285212672=> 32MHz/15 +// <268435456=> 32MHz/16 +// <201326592=> 32MHz/21 +// <184549376=> 32MHz/23 +// <142606336=> 32MHz/30 +// <138412032=> 32MHz/31 +// <134217728=> 32MHz/32 +// <100663296=> 32MHz/42 +// <68157440=> 32MHz/63 +// <34340864=> 32MHz/125 #ifndef I2S_CONFIG_MCK_SETUP #define I2S_CONFIG_MCK_SETUP 536870912 #endif // I2S_CONFIG_RATIO - MCK/LRCK ratio - -// <0=> 32x -// <1=> 48x -// <2=> 64x -// <3=> 96x -// <4=> 128x -// <5=> 192x -// <6=> 256x -// <7=> 384x -// <8=> 512x + +// <0=> 32x +// <1=> 48x +// <2=> 64x +// <3=> 96x +// <4=> 128x +// <5=> 192x +// <6=> 256x +// <7=> 384x +// <8=> 512x #ifndef I2S_CONFIG_RATIO #define I2S_CONFIG_RATIO 2000 #endif // I2S_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef I2S_CONFIG_IRQ_PRIORITY #define I2S_CONFIG_IRQ_PRIORITY 7 @@ -1979,73 +1979,73 @@ #define LPCOMP_ENABLED 0 #endif // LPCOMP_CONFIG_REFERENCE - Reference voltage - -// <0=> Supply 1/8 -// <1=> Supply 2/8 -// <2=> Supply 3/8 -// <3=> Supply 4/8 -// <4=> Supply 5/8 -// <5=> Supply 6/8 -// <6=> Supply 7/8 -// <8=> Supply 1/16 (nRF52) -// <9=> Supply 3/16 (nRF52) -// <10=> Supply 5/16 (nRF52) -// <11=> Supply 7/16 (nRF52) -// <12=> Supply 9/16 (nRF52) -// <13=> Supply 11/16 (nRF52) -// <14=> Supply 13/16 (nRF52) -// <15=> Supply 15/16 (nRF52) -// <7=> External Ref 0 -// <65543=> External Ref 1 + +// <0=> Supply 1/8 +// <1=> Supply 2/8 +// <2=> Supply 3/8 +// <3=> Supply 4/8 +// <4=> Supply 5/8 +// <5=> Supply 6/8 +// <6=> Supply 7/8 +// <8=> Supply 1/16 (nRF52) +// <9=> Supply 3/16 (nRF52) +// <10=> Supply 5/16 (nRF52) +// <11=> Supply 7/16 (nRF52) +// <12=> Supply 9/16 (nRF52) +// <13=> Supply 11/16 (nRF52) +// <14=> Supply 13/16 (nRF52) +// <15=> Supply 15/16 (nRF52) +// <7=> External Ref 0 +// <65543=> External Ref 1 #ifndef LPCOMP_CONFIG_REFERENCE #define LPCOMP_CONFIG_REFERENCE 3 #endif // LPCOMP_CONFIG_DETECTION - Detection - -// <0=> Crossing -// <1=> Up -// <2=> Down + +// <0=> Crossing +// <1=> Up +// <2=> Down #ifndef LPCOMP_CONFIG_DETECTION #define LPCOMP_CONFIG_DETECTION 2 #endif // LPCOMP_CONFIG_INPUT - Analog input - -// <0=> 0 -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 + +// <0=> 0 +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef LPCOMP_CONFIG_INPUT #define LPCOMP_CONFIG_INPUT 0 #endif // LPCOMP_CONFIG_HYST - Hysteresis - + #ifndef LPCOMP_CONFIG_HYST #define LPCOMP_CONFIG_HYST 0 #endif // LPCOMP_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef LPCOMP_CONFIG_IRQ_PRIORITY #define LPCOMP_CONFIG_IRQ_PRIORITY 7 @@ -2059,45 +2059,45 @@ #define PDM_ENABLED 0 #endif // PDM_CONFIG_MODE - Mode - -// <0=> Stereo -// <1=> Mono + +// <0=> Stereo +// <1=> Mono #ifndef PDM_CONFIG_MODE #define PDM_CONFIG_MODE 1 #endif // PDM_CONFIG_EDGE - Edge - -// <0=> Left falling -// <1=> Left rising + +// <0=> Left falling +// <1=> Left rising #ifndef PDM_CONFIG_EDGE #define PDM_CONFIG_EDGE 0 #endif // PDM_CONFIG_CLOCK_FREQ - Clock frequency - -// <134217728=> 1000k -// <138412032=> 1032k (default) -// <142606336=> 1067k + +// <134217728=> 1000k +// <138412032=> 1032k (default) +// <142606336=> 1067k #ifndef PDM_CONFIG_CLOCK_FREQ #define PDM_CONFIG_CLOCK_FREQ 138412032 #endif // PDM_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef PDM_CONFIG_IRQ_PRIORITY #define PDM_CONFIG_IRQ_PRIORITY 7 @@ -2106,7 +2106,7 @@ // // PERIPHERAL_RESOURCE_SHARING_ENABLED - nrf_drv_common - Peripheral drivers common module - + #ifndef PERIPHERAL_RESOURCE_SHARING_ENABLED #define PERIPHERAL_RESOURCE_SHARING_ENABLED 1 @@ -2118,24 +2118,24 @@ #define POWER_ENABLED 0 #endif // POWER_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef POWER_CONFIG_IRQ_PRIORITY #define POWER_CONFIG_IRQ_PRIORITY 7 #endif // POWER_CONFIG_DEFAULT_DCDCEN - The default configuration of main DCDC regulator - + // This settings means only that components for DCDC regulator are installed and it can be enabled. @@ -2144,7 +2144,7 @@ #endif // POWER_CONFIG_DEFAULT_DCDCENHV - The default configuration of High Voltage DCDC regulator - + // This settings means only that components for DCDC regulator are installed and it can be enabled. @@ -2155,7 +2155,7 @@ // // PPI_ENABLED - nrf_drv_ppi - PPI peripheral driver - + #ifndef PPI_ENABLED #define PPI_ENABLED 0 @@ -2166,28 +2166,28 @@ #ifndef PWM_ENABLED #define PWM_ENABLED 1 #endif -// PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31> +// PWM_DEFAULT_CONFIG_OUT0_PIN - Out0 pin <0-31> #ifndef PWM_DEFAULT_CONFIG_OUT0_PIN #define PWM_DEFAULT_CONFIG_OUT0_PIN 31 #endif -// PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31> +// PWM_DEFAULT_CONFIG_OUT1_PIN - Out1 pin <0-31> #ifndef PWM_DEFAULT_CONFIG_OUT1_PIN #define PWM_DEFAULT_CONFIG_OUT1_PIN 31 #endif -// PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31> +// PWM_DEFAULT_CONFIG_OUT2_PIN - Out2 pin <0-31> #ifndef PWM_DEFAULT_CONFIG_OUT2_PIN #define PWM_DEFAULT_CONFIG_OUT2_PIN 31 #endif -// PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31> +// PWM_DEFAULT_CONFIG_OUT3_PIN - Out3 pin <0-31> #ifndef PWM_DEFAULT_CONFIG_OUT3_PIN @@ -2195,94 +2195,94 @@ #endif // PWM_DEFAULT_CONFIG_BASE_CLOCK - Base clock - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz + +// <0=> 16 MHz +// <1=> 8 MHz +// <2=> 4 MHz +// <3=> 2 MHz +// <4=> 1 MHz +// <5=> 500 kHz +// <6=> 250 kHz +// <7=> 125 kHz #ifndef PWM_DEFAULT_CONFIG_BASE_CLOCK #define PWM_DEFAULT_CONFIG_BASE_CLOCK 4 #endif // PWM_DEFAULT_CONFIG_COUNT_MODE - Count mode - -// <0=> Up -// <1=> Up and Down + +// <0=> Up +// <1=> Up and Down #ifndef PWM_DEFAULT_CONFIG_COUNT_MODE #define PWM_DEFAULT_CONFIG_COUNT_MODE 0 #endif -// PWM_DEFAULT_CONFIG_TOP_VALUE - Top value +// PWM_DEFAULT_CONFIG_TOP_VALUE - Top value #ifndef PWM_DEFAULT_CONFIG_TOP_VALUE #define PWM_DEFAULT_CONFIG_TOP_VALUE 1000 #endif // PWM_DEFAULT_CONFIG_LOAD_MODE - Load mode - -// <0=> Common -// <1=> Grouped -// <2=> Individual -// <3=> Waveform + +// <0=> Common +// <1=> Grouped +// <2=> Individual +// <3=> Waveform #ifndef PWM_DEFAULT_CONFIG_LOAD_MODE #define PWM_DEFAULT_CONFIG_LOAD_MODE 0 #endif // PWM_DEFAULT_CONFIG_STEP_MODE - Step mode - -// <0=> Auto -// <1=> Triggered + +// <0=> Auto +// <1=> Triggered #ifndef PWM_DEFAULT_CONFIG_STEP_MODE #define PWM_DEFAULT_CONFIG_STEP_MODE 0 #endif // PWM_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef PWM_DEFAULT_CONFIG_IRQ_PRIORITY #define PWM_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // PWM0_ENABLED - Enable PWM0 instance - + #ifndef PWM0_ENABLED #define PWM0_ENABLED 1 #endif // PWM1_ENABLED - Enable PWM1 instance - + #ifndef PWM1_ENABLED #define PWM1_ENABLED 1 #endif // PWM2_ENABLED - Enable PWM2 instance - + #ifndef PWM2_ENABLED #define PWM2_ENABLED 1 #endif // PWM3_ENABLED - Enable PWM3 instance - + #ifndef PWM3_ENABLED #define PWM3_ENABLED 1 @@ -2296,96 +2296,96 @@ #define QDEC_ENABLED 0 #endif // QDEC_CONFIG_REPORTPER - Report period - -// <0=> 10 Samples -// <1=> 40 Samples -// <2=> 80 Samples -// <3=> 120 Samples -// <4=> 160 Samples -// <5=> 200 Samples -// <6=> 240 Samples -// <7=> 280 Samples + +// <0=> 10 Samples +// <1=> 40 Samples +// <2=> 80 Samples +// <3=> 120 Samples +// <4=> 160 Samples +// <5=> 200 Samples +// <6=> 240 Samples +// <7=> 280 Samples #ifndef QDEC_CONFIG_REPORTPER #define QDEC_CONFIG_REPORTPER 0 #endif // QDEC_CONFIG_SAMPLEPER - Sample period - -// <0=> 128 us -// <1=> 256 us -// <2=> 512 us -// <3=> 1024 us -// <4=> 2048 us -// <5=> 4096 us -// <6=> 8192 us -// <7=> 16384 us + +// <0=> 128 us +// <1=> 256 us +// <2=> 512 us +// <3=> 1024 us +// <4=> 2048 us +// <5=> 4096 us +// <6=> 8192 us +// <7=> 16384 us #ifndef QDEC_CONFIG_SAMPLEPER #define QDEC_CONFIG_SAMPLEPER 7 #endif -// QDEC_CONFIG_PIO_A - A pin <0-31> +// QDEC_CONFIG_PIO_A - A pin <0-31> #ifndef QDEC_CONFIG_PIO_A #define QDEC_CONFIG_PIO_A 31 #endif -// QDEC_CONFIG_PIO_B - B pin <0-31> +// QDEC_CONFIG_PIO_B - B pin <0-31> #ifndef QDEC_CONFIG_PIO_B #define QDEC_CONFIG_PIO_B 31 #endif -// QDEC_CONFIG_PIO_LED - LED pin <0-31> +// QDEC_CONFIG_PIO_LED - LED pin <0-31> #ifndef QDEC_CONFIG_PIO_LED #define QDEC_CONFIG_PIO_LED 31 #endif -// QDEC_CONFIG_LEDPRE - LED pre +// QDEC_CONFIG_LEDPRE - LED pre #ifndef QDEC_CONFIG_LEDPRE #define QDEC_CONFIG_LEDPRE 511 #endif // QDEC_CONFIG_LEDPOL - LED polarity - -// <0=> Active low -// <1=> Active high + +// <0=> Active low +// <1=> Active high #ifndef QDEC_CONFIG_LEDPOL #define QDEC_CONFIG_LEDPOL 1 #endif // QDEC_CONFIG_DBFEN - Debouncing enable - + #ifndef QDEC_CONFIG_DBFEN #define QDEC_CONFIG_DBFEN 0 #endif // QDEC_CONFIG_SAMPLE_INTEN - Sample ready interrupt enable - + #ifndef QDEC_CONFIG_SAMPLE_INTEN #define QDEC_CONFIG_SAMPLE_INTEN 0 #endif // QDEC_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef QDEC_CONFIG_IRQ_PRIORITY #define QDEC_CONFIG_IRQ_PRIORITY 7 @@ -2399,29 +2399,29 @@ #define RNG_ENABLED 1 #endif // RNG_CONFIG_ERROR_CORRECTION - Error correction - + #ifndef RNG_CONFIG_ERROR_CORRECTION #define RNG_CONFIG_ERROR_CORRECTION 1 #endif -// RNG_CONFIG_POOL_SIZE - Pool size +// RNG_CONFIG_POOL_SIZE - Pool size #ifndef RNG_CONFIG_POOL_SIZE #define RNG_CONFIG_POOL_SIZE 32 #endif // RNG_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef RNG_CONFIG_IRQ_PRIORITY #define RNG_CONFIG_IRQ_PRIORITY 7 @@ -2434,7 +2434,7 @@ #ifndef RTC_ENABLED #define RTC_ENABLED 0 #endif -// RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768> +// RTC_DEFAULT_CONFIG_FREQUENCY - Frequency <16-32768> #ifndef RTC_DEFAULT_CONFIG_FREQUENCY @@ -2442,51 +2442,51 @@ #endif // RTC_DEFAULT_CONFIG_RELIABLE - Ensures safe compare event triggering - + #ifndef RTC_DEFAULT_CONFIG_RELIABLE #define RTC_DEFAULT_CONFIG_RELIABLE 0 #endif // RTC_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef RTC_DEFAULT_CONFIG_IRQ_PRIORITY #define RTC_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // RTC0_ENABLED - Enable RTC0 instance - + #ifndef RTC0_ENABLED #define RTC0_ENABLED 0 #endif // RTC1_ENABLED - Enable RTC1 instance - + #ifndef RTC1_ENABLED #define RTC1_ENABLED 0 #endif // RTC2_ENABLED - Enable RTC2 instance - + #ifndef RTC2_ENABLED #define RTC2_ENABLED 0 #endif -// NRF_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt +// NRF_MAXIMUM_LATENCY_US - Maximum possible time[us] in highest priority interrupt #ifndef NRF_MAXIMUM_LATENCY_US #define NRF_MAXIMUM_LATENCY_US 2000 #endif @@ -2499,51 +2499,51 @@ #define SAADC_ENABLED 1 #endif // SAADC_CONFIG_RESOLUTION - Resolution - -// <0=> 8 bit -// <1=> 10 bit -// <2=> 12 bit -// <3=> 14 bit + +// <0=> 8 bit +// <1=> 10 bit +// <2=> 12 bit +// <3=> 14 bit #ifndef SAADC_CONFIG_RESOLUTION #define SAADC_CONFIG_RESOLUTION 2 #endif // SAADC_CONFIG_OVERSAMPLE - Sample period - -// <0=> Disabled -// <1=> 2x -// <2=> 4x -// <3=> 8x -// <4=> 16x -// <5=> 32x -// <6=> 64x -// <7=> 128x -// <8=> 256x + +// <0=> Disabled +// <1=> 2x +// <2=> 4x +// <3=> 8x +// <4=> 16x +// <5=> 32x +// <6=> 64x +// <7=> 128x +// <8=> 256x #ifndef SAADC_CONFIG_OVERSAMPLE #define SAADC_CONFIG_OVERSAMPLE 0 #endif // SAADC_CONFIG_LP_MODE - Enabling low power mode - + #ifndef SAADC_CONFIG_LP_MODE #define SAADC_CONFIG_LP_MODE 0 #endif // SAADC_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef SAADC_CONFIG_IRQ_PRIORITY #define SAADC_CONFIG_IRQ_PRIORITY 7 @@ -2557,50 +2557,50 @@ #define SPIS_ENABLED 1 #endif // SPIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef SPIS_DEFAULT_CONFIG_IRQ_PRIORITY #define SPIS_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // SPIS_DEFAULT_MODE - Mode - -// <0=> MODE_0 -// <1=> MODE_1 -// <2=> MODE_2 -// <3=> MODE_3 + +// <0=> MODE_0 +// <1=> MODE_1 +// <2=> MODE_2 +// <3=> MODE_3 #ifndef SPIS_DEFAULT_MODE #define SPIS_DEFAULT_MODE 0 #endif // SPIS_DEFAULT_BIT_ORDER - SPIS default bit order - -// <0=> MSB first -// <1=> LSB first + +// <0=> MSB first +// <1=> LSB first #ifndef SPIS_DEFAULT_BIT_ORDER #define SPIS_DEFAULT_BIT_ORDER 0 #endif -// SPIS_DEFAULT_DEF - SPIS default DEF character <0-255> +// SPIS_DEFAULT_DEF - SPIS default DEF character <0-255> #ifndef SPIS_DEFAULT_DEF #define SPIS_DEFAULT_DEF 255 #endif -// SPIS_DEFAULT_ORC - SPIS default ORC character <0-255> +// SPIS_DEFAULT_ORC - SPIS default ORC character <0-255> #ifndef SPIS_DEFAULT_ORC @@ -2608,21 +2608,21 @@ #endif // SPIS0_ENABLED - Enable SPIS0 instance - + #ifndef SPIS0_ENABLED #define SPIS0_ENABLED 1 #endif // SPIS1_ENABLED - Enable SPIS1 instance - + #ifndef SPIS1_ENABLED #define SPIS1_ENABLED 0 #endif // SPIS2_ENABLED - Enable SPIS2 instance - + #ifndef SPIS2_ENABLED #define SPIS2_ENABLED 0 @@ -2636,27 +2636,27 @@ #define SPI_ENABLED 1 #endif // SPI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef SPI_DEFAULT_CONFIG_IRQ_PRIORITY #define SPI_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // NRF_SPI_DRV_MISO_PULLUP_CFG - MISO PIN pull-up configuration. - -// <0=> NRF_GPIO_PIN_NOPULL -// <1=> NRF_GPIO_PIN_PULLDOWN -// <3=> NRF_GPIO_PIN_PULLUP + +// <0=> NRF_GPIO_PIN_NOPULL +// <1=> NRF_GPIO_PIN_PULLDOWN +// <3=> NRF_GPIO_PIN_PULLUP #ifndef NRF_SPI_DRV_MISO_PULLUP_CFG #define NRF_SPI_DRV_MISO_PULLUP_CFG 1 @@ -2668,21 +2668,21 @@ #define SPI0_ENABLED 1 #endif // SPI0_USE_EASY_DMA - Use EasyDMA - + #ifndef SPI0_USE_EASY_DMA #define SPI0_USE_EASY_DMA 0 #endif // SPI0_DEFAULT_FREQUENCY - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz + +// <33554432=> 125 kHz +// <67108864=> 250 kHz +// <134217728=> 500 kHz +// <268435456=> 1 MHz +// <536870912=> 2 MHz +// <1073741824=> 4 MHz +// <2147483648=> 8 MHz #ifndef SPI0_DEFAULT_FREQUENCY #define SPI0_DEFAULT_FREQUENCY 1073741824 @@ -2696,21 +2696,21 @@ #define SPI1_ENABLED 1 #endif // SPI1_USE_EASY_DMA - Use EasyDMA - + #ifndef SPI1_USE_EASY_DMA #define SPI1_USE_EASY_DMA 0 #endif // SPI1_DEFAULT_FREQUENCY - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz + +// <33554432=> 125 kHz +// <67108864=> 250 kHz +// <134217728=> 500 kHz +// <268435456=> 1 MHz +// <536870912=> 2 MHz +// <1073741824=> 4 MHz +// <2147483648=> 8 MHz #ifndef SPI1_DEFAULT_FREQUENCY #define SPI1_DEFAULT_FREQUENCY 1073741824 @@ -2724,21 +2724,21 @@ #define SPI2_ENABLED 1 #endif // SPI2_USE_EASY_DMA - Use EasyDMA - + #ifndef SPI2_USE_EASY_DMA #define SPI2_USE_EASY_DMA 0 #endif // SPI2_DEFAULT_FREQUENCY - SPI frequency - -// <33554432=> 125 kHz -// <67108864=> 250 kHz -// <134217728=> 500 kHz -// <268435456=> 1 MHz -// <536870912=> 2 MHz -// <1073741824=> 4 MHz -// <2147483648=> 8 MHz + +// <33554432=> 125 kHz +// <67108864=> 250 kHz +// <134217728=> 500 kHz +// <268435456=> 1 MHz +// <536870912=> 2 MHz +// <1073741824=> 4 MHz +// <2147483648=> 8 MHz #ifndef SPI2_DEFAULT_FREQUENCY #define SPI2_DEFAULT_FREQUENCY 1073741824 @@ -2754,89 +2754,89 @@ #define TIMER_ENABLED 0 #endif // TIMER_DEFAULT_CONFIG_FREQUENCY - Timer frequency if in Timer mode - -// <0=> 16 MHz -// <1=> 8 MHz -// <2=> 4 MHz -// <3=> 2 MHz -// <4=> 1 MHz -// <5=> 500 kHz -// <6=> 250 kHz -// <7=> 125 kHz -// <8=> 62.5 kHz -// <9=> 31.25 kHz + +// <0=> 16 MHz +// <1=> 8 MHz +// <2=> 4 MHz +// <3=> 2 MHz +// <4=> 1 MHz +// <5=> 500 kHz +// <6=> 250 kHz +// <7=> 125 kHz +// <8=> 62.5 kHz +// <9=> 31.25 kHz #ifndef TIMER_DEFAULT_CONFIG_FREQUENCY #define TIMER_DEFAULT_CONFIG_FREQUENCY 0 #endif // TIMER_DEFAULT_CONFIG_MODE - Timer mode or operation - -// <0=> Timer -// <1=> Counter + +// <0=> Timer +// <1=> Counter #ifndef TIMER_DEFAULT_CONFIG_MODE #define TIMER_DEFAULT_CONFIG_MODE 0 #endif // TIMER_DEFAULT_CONFIG_BIT_WIDTH - Timer counter bit width - -// <0=> 16 bit -// <1=> 8 bit -// <2=> 24 bit -// <3=> 32 bit + +// <0=> 16 bit +// <1=> 8 bit +// <2=> 24 bit +// <3=> 32 bit #ifndef TIMER_DEFAULT_CONFIG_BIT_WIDTH #define TIMER_DEFAULT_CONFIG_BIT_WIDTH 0 #endif // TIMER_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef TIMER_DEFAULT_CONFIG_IRQ_PRIORITY #define TIMER_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // TIMER0_ENABLED - Enable TIMER0 instance - + #ifndef TIMER0_ENABLED #define TIMER0_ENABLED 0 #endif // TIMER1_ENABLED - Enable TIMER1 instance - + #ifndef TIMER1_ENABLED #define TIMER1_ENABLED 0 #endif // TIMER2_ENABLED - Enable TIMER2 instance - + #ifndef TIMER2_ENABLED #define TIMER2_ENABLED 0 #endif // TIMER3_ENABLED - Enable TIMER3 instance - + #ifndef TIMER3_ENABLED #define TIMER3_ENABLED 0 #endif // TIMER4_ENABLED - Enable TIMER4 instance - + #ifndef TIMER4_ENABLED #define TIMER4_ENABLED 0 @@ -2849,69 +2849,69 @@ #ifndef TWIS_ENABLED #define TWIS_ENABLED 0 #endif -// TWIS_DEFAULT_CONFIG_ADDR0 - Address0 +// TWIS_DEFAULT_CONFIG_ADDR0 - Address0 #ifndef TWIS_DEFAULT_CONFIG_ADDR0 #define TWIS_DEFAULT_CONFIG_ADDR0 0 #endif -// TWIS_DEFAULT_CONFIG_ADDR1 - Address1 +// TWIS_DEFAULT_CONFIG_ADDR1 - Address1 #ifndef TWIS_DEFAULT_CONFIG_ADDR1 #define TWIS_DEFAULT_CONFIG_ADDR1 0 #endif // TWIS_DEFAULT_CONFIG_SCL_PULL - SCL pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up + +// <0=> Disabled +// <1=> Pull down +// <3=> Pull up #ifndef TWIS_DEFAULT_CONFIG_SCL_PULL #define TWIS_DEFAULT_CONFIG_SCL_PULL 0 #endif // TWIS_DEFAULT_CONFIG_SDA_PULL - SDA pin pull configuration - -// <0=> Disabled -// <1=> Pull down -// <3=> Pull up + +// <0=> Disabled +// <1=> Pull down +// <3=> Pull up #ifndef TWIS_DEFAULT_CONFIG_SDA_PULL #define TWIS_DEFAULT_CONFIG_SDA_PULL 0 #endif // TWIS_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef TWIS_DEFAULT_CONFIG_IRQ_PRIORITY #define TWIS_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // TWIS0_ENABLED - Enable TWIS0 instance - + #ifndef TWIS0_ENABLED #define TWIS0_ENABLED 0 #endif // TWIS1_ENABLED - Enable TWIS1 instance - + #ifndef TWIS1_ENABLED #define TWIS1_ENABLED 0 #endif // TWIS_ASSUME_INIT_AFTER_RESET_ONLY - Assume that any instance would be initialized only once - + // Optimization flag. Registers used by TWIS are shared by other peripherals. Normally, during initialization driver tries to clear all registers to known state before doing the initialization itself. This gives initialization safe procedure, no matter when it would be called. If you activate TWIS only once and do never uninitialize it - set this flag to 1 what gives more optimal code. @@ -2920,7 +2920,7 @@ #endif // TWIS_NO_SYNC_MODE - Remove support for synchronous mode - + // Synchronous mode would be used in specific situations. And it uses some additional code and data memory to safely process state machine by polling it in status functions. If this functionality is not required it may be disabled to free some resources. @@ -2936,41 +2936,41 @@ #define TWI_ENABLED 1 #endif // TWI_DEFAULT_CONFIG_FREQUENCY - Frequency - -// <26738688=> 100k -// <67108864=> 250k -// <104857600=> 400k + +// <26738688=> 100k +// <67108864=> 250k +// <104857600=> 400k #ifndef TWI_DEFAULT_CONFIG_FREQUENCY #define TWI_DEFAULT_CONFIG_FREQUENCY 26738688 #endif // TWI_DEFAULT_CONFIG_CLR_BUS_INIT - Enables bus clearing procedure during init - + #ifndef TWI_DEFAULT_CONFIG_CLR_BUS_INIT #define TWI_DEFAULT_CONFIG_CLR_BUS_INIT 0 #endif // TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT - Enables bus holding after uninit - + #ifndef TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT #define TWI_DEFAULT_CONFIG_HOLD_BUS_UNINIT 0 #endif // TWI_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef TWI_DEFAULT_CONFIG_IRQ_PRIORITY #define TWI_DEFAULT_CONFIG_IRQ_PRIORITY 7 @@ -2982,7 +2982,7 @@ #define TWI0_ENABLED 1 #endif // TWI0_USE_EASY_DMA - Use EasyDMA (if present) - + #ifndef TWI0_USE_EASY_DMA #define TWI0_USE_EASY_DMA 0 @@ -2996,7 +2996,7 @@ #define TWI1_ENABLED 1 #endif // TWI1_USE_EASY_DMA - Use EasyDMA (if present) - + #ifndef TWI1_USE_EASY_DMA #define TWI1_USE_EASY_DMA 0 @@ -3012,72 +3012,72 @@ #define UART_ENABLED 1 #endif // UART_DEFAULT_CONFIG_HWFC - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled + +// <0=> Disabled +// <1=> Enabled #ifndef UART_DEFAULT_CONFIG_HWFC #define UART_DEFAULT_CONFIG_HWFC 1 #endif // UART_DEFAULT_CONFIG_PARITY - Parity - -// <0=> Excluded -// <14=> Included + +// <0=> Excluded +// <14=> Included #ifndef UART_DEFAULT_CONFIG_PARITY #define UART_DEFAULT_CONFIG_PARITY 0 #endif // UART_DEFAULT_CONFIG_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud + +// <323584=> 1200 baud +// <643072=> 2400 baud +// <1290240=> 4800 baud +// <2576384=> 9600 baud +// <3862528=> 14400 baud +// <5152768=> 19200 baud +// <7716864=> 28800 baud +// <10289152=> 38400 baud +// <15400960=> 57600 baud +// <20615168=> 76800 baud +// <30801920=> 115200 baud +// <61865984=> 230400 baud +// <67108864=> 250000 baud +// <121634816=> 460800 baud +// <251658240=> 921600 baud +// <268435456=> 1000000 baud #ifndef UART_DEFAULT_CONFIG_BAUDRATE #define UART_DEFAULT_CONFIG_BAUDRATE 2576384 #endif // UART_DEFAULT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef UART_DEFAULT_CONFIG_IRQ_PRIORITY #define UART_DEFAULT_CONFIG_IRQ_PRIORITY 7 #endif // UART_EASY_DMA_SUPPORT - Driver supporting EasyDMA - + #ifndef UART_EASY_DMA_SUPPORT #define UART_EASY_DMA_SUPPORT 1 #endif // UART_LEGACY_SUPPORT - Driver supporting Legacy mode - + #ifndef UART_LEGACY_SUPPORT #define UART_LEGACY_SUPPORT 1 @@ -3089,7 +3089,7 @@ #define UART0_ENABLED 1 #endif // UART0_CONFIG_USE_EASY_DMA - Default setting for using EasyDMA - + #ifndef UART0_CONFIG_USE_EASY_DMA #define UART0_CONFIG_USE_EASY_DMA 1 @@ -3103,7 +3103,7 @@ #define UART1_ENABLED 1 #endif // UART1_CONFIG_USE_EASY_DMA - Default setting for using EasyDMA - + #ifndef UART1_CONFIG_USE_EASY_DMA #define UART1_CONFIG_USE_EASY_DMA 1 @@ -3119,26 +3119,26 @@ #define USBD_ENABLED 0 #endif // USBD_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef USBD_CONFIG_IRQ_PRIORITY #define USBD_CONFIG_IRQ_PRIORITY 7 #endif // NRF_DRV_USBD_DMASCHEDULER_MODE - USBD SMA scheduler working scheme - -// <0=> Prioritized access -// <1=> Round Robin + +// <0=> Prioritized access +// <1=> Round Robin #ifndef NRF_DRV_USBD_DMASCHEDULER_MODE #define NRF_DRV_USBD_DMASCHEDULER_MODE 0 @@ -3152,17 +3152,17 @@ #define WDT_ENABLED 0 #endif // WDT_CONFIG_BEHAVIOUR - WDT behavior in CPU SLEEP or HALT mode - -// <1=> Run in SLEEP, Pause in HALT -// <8=> Pause in SLEEP, Run in HALT -// <9=> Run in SLEEP and HALT -// <0=> Pause in SLEEP and HALT + +// <1=> Run in SLEEP, Pause in HALT +// <8=> Pause in SLEEP, Run in HALT +// <9=> Run in SLEEP and HALT +// <0=> Pause in SLEEP and HALT #ifndef WDT_CONFIG_BEHAVIOUR #define WDT_CONFIG_BEHAVIOUR 1 #endif -// WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> +// WDT_CONFIG_RELOAD_VALUE - Reload value <15-4294967295> #ifndef WDT_CONFIG_RELOAD_VALUE @@ -3170,17 +3170,17 @@ #endif // WDT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef WDT_CONFIG_IRQ_PRIORITY #define WDT_CONFIG_IRQ_PRIORITY 7 @@ -3188,21 +3188,21 @@ // -// +// //========================================================== -// nRF_Libraries +// nRF_Libraries //========================================================== // APP_GPIOTE_ENABLED - app_gpiote - GPIOTE events dispatcher - + #ifndef APP_GPIOTE_ENABLED #define APP_GPIOTE_ENABLED 0 #endif // APP_PWM_ENABLED - app_pwm - PWM functionality - + #ifndef APP_PWM_ENABLED #define APP_PWM_ENABLED 0 @@ -3214,14 +3214,14 @@ #define APP_SCHEDULER_ENABLED 0 #endif // APP_SCHEDULER_WITH_PAUSE - Enabling pause feature - + #ifndef APP_SCHEDULER_WITH_PAUSE #define APP_SCHEDULER_WITH_PAUSE 0 #endif // APP_SCHEDULER_WITH_PROFILER - Enabling scheduler profiling - + #ifndef APP_SCHEDULER_WITH_PROFILER #define APP_SCHEDULER_WITH_PROFILER 0 @@ -3235,36 +3235,36 @@ #define APP_TIMER_ENABLED 0 #endif // APP_TIMER_CONFIG_RTC_FREQUENCY - Configure RTC prescaler. - -// <0=> 32768 Hz -// <1=> 16384 Hz -// <3=> 8192 Hz -// <7=> 4096 Hz -// <15=> 2048 Hz -// <31=> 1024 Hz + +// <0=> 32768 Hz +// <1=> 16384 Hz +// <3=> 8192 Hz +// <7=> 4096 Hz +// <15=> 2048 Hz +// <31=> 1024 Hz #ifndef APP_TIMER_CONFIG_RTC_FREQUENCY #define APP_TIMER_CONFIG_RTC_FREQUENCY 0 #endif // APP_TIMER_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef APP_TIMER_CONFIG_IRQ_PRIORITY #define APP_TIMER_CONFIG_IRQ_PRIORITY 7 #endif -// APP_TIMER_CONFIG_OP_QUEUE_SIZE - Capacity of timer requests queue. +// APP_TIMER_CONFIG_OP_QUEUE_SIZE - Capacity of timer requests queue. // Size of the queue depends on how many timers are used // in the system, how often timers are started and overall // system latency. If queue size is too small app_timer calls @@ -3275,21 +3275,21 @@ #endif // APP_TIMER_CONFIG_USE_SCHEDULER - Enable scheduling app_timer events to app_scheduler - + #ifndef APP_TIMER_CONFIG_USE_SCHEDULER #define APP_TIMER_CONFIG_USE_SCHEDULER 0 #endif // APP_TIMER_WITH_PROFILER - Enable app_timer profiling - + #ifndef APP_TIMER_WITH_PROFILER #define APP_TIMER_WITH_PROFILER 0 #endif // APP_TIMER_KEEPS_RTC_ACTIVE - Enable RTC always on - + // If option is enabled RTC is kept running even if there is no active timers. // This option can be used when app_timer is used for timestamping. @@ -3299,9 +3299,9 @@ #endif // APP_TIMER_CONFIG_SWI_NUMBER - Configure SWI instance used. - -// <0=> 0 -// <1=> 1 + +// <0=> 0 +// <1=> 1 #ifndef APP_TIMER_CONFIG_SWI_NUMBER #define APP_TIMER_CONFIG_SWI_NUMBER 0 @@ -3310,7 +3310,7 @@ // // NRF_TWI_MNGR_ENABLED - nrf_twi_mngr - TWI transaction manager - + #ifndef NRF_TWI_MNGR_ENABLED #define NRF_TWI_MNGR_ENABLED 0 @@ -3322,8 +3322,8 @@ #define APP_UART_ENABLED 0 #endif // APP_UART_DRIVER_INSTANCE - UART instance used - -// <0=> 0 + +// <0=> 0 #ifndef APP_UART_DRIVER_INSTANCE #define APP_UART_DRIVER_INSTANCE 0 @@ -3332,77 +3332,77 @@ // // APP_USBD_CLASS_AUDIO_ENABLED - app_usbd_audio - USB AUDIO class - + #ifndef APP_USBD_CLASS_AUDIO_ENABLED #define APP_USBD_CLASS_AUDIO_ENABLED 0 #endif // APP_USBD_CLASS_CDC_ACM_ENABLED - app_usbd_cdc_acm - USB CDC ACM class - + #ifndef APP_USBD_CLASS_CDC_ACM_ENABLED #define APP_USBD_CLASS_CDC_ACM_ENABLED 0 #endif // APP_USBD_CLASS_HID_ENABLED - app_usbd_hid - USB HID class - + #ifndef APP_USBD_CLASS_HID_ENABLED #define APP_USBD_CLASS_HID_ENABLED 0 #endif // APP_USBD_HID_GENERIC_ENABLED - app_usbd_hid_generic - USB HID generic - + #ifndef APP_USBD_HID_GENERIC_ENABLED #define APP_USBD_HID_GENERIC_ENABLED 0 #endif // APP_USBD_HID_KBD_ENABLED - app_usbd_hid_kbd - USB HID keyboard - + #ifndef APP_USBD_HID_KBD_ENABLED #define APP_USBD_HID_KBD_ENABLED 0 #endif // APP_USBD_HID_MOUSE_ENABLED - app_usbd_hid_mouse - USB HID mouse - + #ifndef APP_USBD_HID_MOUSE_ENABLED #define APP_USBD_HID_MOUSE_ENABLED 0 #endif // APP_USBD_MSC_ENABLED - app_usbd_msc - USB MSC class - + #ifndef APP_USBD_MSC_ENABLED #define APP_USBD_MSC_ENABLED 0 #endif // BUTTON_ENABLED - app_button - buttons handling module - + #ifndef BUTTON_ENABLED #define BUTTON_ENABLED 0 #endif // CRC16_ENABLED - crc16 - CRC16 calculation routines - + #ifndef CRC16_ENABLED #define CRC16_ENABLED 0 #endif // CRC32_ENABLED - crc32 - CRC32 calculation routines - + #ifndef CRC32_ENABLED #define CRC32_ENABLED 0 #endif // ECC_ENABLED - ecc - Elliptic Curve Cryptography Library - + #ifndef ECC_ENABLED #define ECC_ENABLED 0 @@ -3417,7 +3417,7 @@ // Configure the number of virtual pages to use and their size. //========================================================== -// FDS_VIRTUAL_PAGES - Number of virtual flash pages to use. +// FDS_VIRTUAL_PAGES - Number of virtual flash pages to use. // One of the virtual pages is reserved by the system for garbage collection. // Therefore, the minimum is two virtual pages: one page to store data and one page to be used by the system for garbage collection. // The total amount of flash memory that is used by FDS amounts to @ref FDS_VIRTUAL_PAGES * @ref FDS_VIRTUAL_PAGE_SIZE * 4 bytes. @@ -3427,19 +3427,19 @@ #endif // FDS_VIRTUAL_PAGE_SIZE - The size of a virtual flash page. - + // Expressed in number of 4-byte words. // By default, a virtual page is the same size as a physical page. // The size of a virtual page must be a multiple of the size of a physical page. -// <1024=> 1024 -// <2048=> 2048 +// <1024=> 1024 +// <2048=> 2048 #ifndef FDS_VIRTUAL_PAGE_SIZE #define FDS_VIRTUAL_PAGE_SIZE 1024 #endif -// +// //========================================================== // Backend - Backend configuration @@ -3447,31 +3447,31 @@ // Configure which nrf_fstorage backend is used by FDS to write to flash. //========================================================== // FDS_BACKEND - FDS flash backend. - + // NRF_FSTORAGE_SD uses the nrf_fstorage_sd backend implementation using the SoftDevice API. Use this if you have a SoftDevice present. // NRF_FSTORAGE_NVMC uses the nrf_fstorage_nvmc implementation. Use this setting if you don't use the SoftDevice. -// <1=> NRF_FSTORAGE_NVMC -// <2=> NRF_FSTORAGE_SD +// <1=> NRF_FSTORAGE_NVMC +// <2=> NRF_FSTORAGE_SD #ifndef FDS_BACKEND #define FDS_BACKEND 1 #endif -// +// //========================================================== // Queue - Queue settings //========================================================== -// FDS_OP_QUEUE_SIZE - Size of the internal queue. +// FDS_OP_QUEUE_SIZE - Size of the internal queue. // Increase this value if you frequently get synchronous FDS_ERR_NO_SPACE_IN_QUEUES errors. #ifndef FDS_OP_QUEUE_SIZE #define FDS_OP_QUEUE_SIZE 4 #endif -// +// //========================================================== // CRC - CRC functionality @@ -3487,12 +3487,12 @@ #define FDS_CRC_CHECK_ON_READ 0 #endif // FDS_CRC_CHECK_ON_WRITE - Perform a CRC check on newly written records. - + // Perform a CRC check on newly written records. // This setting can be used to make sure that the record data was not altered while being written to flash. -// <1=> Enabled -// <0=> Disabled +// <1=> Enabled +// <0=> Disabled #ifndef FDS_CRC_CHECK_ON_WRITE #define FDS_CRC_CHECK_ON_WRITE 0 @@ -3500,18 +3500,18 @@ // -// +// //========================================================== // Users - Number of users //========================================================== -// FDS_MAX_USERS - Maximum number of callbacks that can be registered. +// FDS_MAX_USERS - Maximum number of callbacks that can be registered. #ifndef FDS_MAX_USERS #define FDS_MAX_USERS 4 #endif -// +// //========================================================== // @@ -3522,7 +3522,7 @@ #define HARDFAULT_HANDLER_ENABLED 0 #endif // HARDFAULT_HANDLER_GDB_PSP_BACKTRACE - Bypass the GDB problem with multiple stack pointers backtrace - + // There is a known bug in GDB which causes it to incorrectly backtrace the code // when multiple stack pointers are used (main and process stack pointers). @@ -3543,17 +3543,17 @@ #ifndef HCI_MEM_POOL_ENABLED #define HCI_MEM_POOL_ENABLED 0 #endif -// HCI_TX_BUF_SIZE - TX buffer size in bytes. +// HCI_TX_BUF_SIZE - TX buffer size in bytes. #ifndef HCI_TX_BUF_SIZE #define HCI_TX_BUF_SIZE 600 #endif -// HCI_RX_BUF_SIZE - RX buffer size in bytes. +// HCI_RX_BUF_SIZE - RX buffer size in bytes. #ifndef HCI_RX_BUF_SIZE #define HCI_RX_BUF_SIZE 600 #endif -// HCI_RX_BUF_QUEUE_SIZE - RX buffer queue size. +// HCI_RX_BUF_QUEUE_SIZE - RX buffer queue size. #ifndef HCI_RX_BUF_QUEUE_SIZE #define HCI_RX_BUF_QUEUE_SIZE 4 #endif @@ -3566,53 +3566,53 @@ #define HCI_SLIP_ENABLED 0 #endif // HCI_UART_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud + +// <323584=> 1200 baud +// <643072=> 2400 baud +// <1290240=> 4800 baud +// <2576384=> 9600 baud +// <3862528=> 14400 baud +// <5152768=> 19200 baud +// <7716864=> 28800 baud +// <10289152=> 38400 baud +// <15400960=> 57600 baud +// <20615168=> 76800 baud +// <30801920=> 115200 baud +// <61865984=> 230400 baud +// <67108864=> 250000 baud +// <121634816=> 460800 baud +// <251658240=> 921600 baud +// <268435456=> 1000000 baud #ifndef HCI_UART_BAUDRATE #define HCI_UART_BAUDRATE 30801920 #endif // HCI_UART_FLOW_CONTROL - Hardware Flow Control - -// <0=> Disabled -// <1=> Enabled + +// <0=> Disabled +// <1=> Enabled #ifndef HCI_UART_FLOW_CONTROL #define HCI_UART_FLOW_CONTROL 0 #endif -// HCI_UART_RX_PIN - UART RX pin +// HCI_UART_RX_PIN - UART RX pin #ifndef HCI_UART_RX_PIN #define HCI_UART_RX_PIN 8 #endif -// HCI_UART_TX_PIN - UART TX pin +// HCI_UART_TX_PIN - UART TX pin #ifndef HCI_UART_TX_PIN #define HCI_UART_TX_PIN 6 #endif -// HCI_UART_RTS_PIN - UART RTS pin +// HCI_UART_RTS_PIN - UART RTS pin #ifndef HCI_UART_RTS_PIN #define HCI_UART_RTS_PIN 5 #endif -// HCI_UART_CTS_PIN - UART CTS pin +// HCI_UART_CTS_PIN - UART CTS pin #ifndef HCI_UART_CTS_PIN #define HCI_UART_CTS_PIN 7 #endif @@ -3624,7 +3624,7 @@ #ifndef HCI_TRANSPORT_ENABLED #define HCI_TRANSPORT_ENABLED 0 #endif -// HCI_MAX_PACKET_SIZE_IN_BITS - Maximum size of a single application packet in bits. +// HCI_MAX_PACKET_SIZE_IN_BITS - Maximum size of a single application packet in bits. #ifndef HCI_MAX_PACKET_SIZE_IN_BITS #define HCI_MAX_PACKET_SIZE_IN_BITS 8000 #endif @@ -3632,14 +3632,14 @@ // // LED_SOFTBLINK_ENABLED - led_softblink - led_softblink module - + #ifndef LED_SOFTBLINK_ENABLED #define LED_SOFTBLINK_ENABLED 0 #endif // LOW_POWER_PWM_ENABLED - low_power_pwm - low_power_pwm module - + #ifndef LOW_POWER_PWM_ENABLED #define LOW_POWER_PWM_ENABLED 0 @@ -3650,98 +3650,98 @@ #ifndef MEM_MANAGER_ENABLED #define MEM_MANAGER_ENABLED 0 #endif -// MEMORY_MANAGER_SMALL_BLOCK_COUNT - Size of each memory blocks identified as 'small' block. <0-255> +// MEMORY_MANAGER_SMALL_BLOCK_COUNT - Size of each memory blocks identified as 'small' block. <0-255> #ifndef MEMORY_MANAGER_SMALL_BLOCK_COUNT #define MEMORY_MANAGER_SMALL_BLOCK_COUNT 1 #endif -// MEMORY_MANAGER_SMALL_BLOCK_SIZE - Size of each memory blocks identified as 'small' block. +// MEMORY_MANAGER_SMALL_BLOCK_SIZE - Size of each memory blocks identified as 'small' block. // Size of each memory blocks identified as 'small' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_SMALL_BLOCK_SIZE #define MEMORY_MANAGER_SMALL_BLOCK_SIZE 32 #endif -// MEMORY_MANAGER_MEDIUM_BLOCK_COUNT - Size of each memory blocks identified as 'medium' block. <0-255> +// MEMORY_MANAGER_MEDIUM_BLOCK_COUNT - Size of each memory blocks identified as 'medium' block. <0-255> #ifndef MEMORY_MANAGER_MEDIUM_BLOCK_COUNT #define MEMORY_MANAGER_MEDIUM_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_MEDIUM_BLOCK_SIZE - Size of each memory blocks identified as 'medium' block. +// MEMORY_MANAGER_MEDIUM_BLOCK_SIZE - Size of each memory blocks identified as 'medium' block. // Size of each memory blocks identified as 'medium' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_MEDIUM_BLOCK_SIZE #define MEMORY_MANAGER_MEDIUM_BLOCK_SIZE 256 #endif -// MEMORY_MANAGER_LARGE_BLOCK_COUNT - Size of each memory blocks identified as 'large' block. <0-255> +// MEMORY_MANAGER_LARGE_BLOCK_COUNT - Size of each memory blocks identified as 'large' block. <0-255> #ifndef MEMORY_MANAGER_LARGE_BLOCK_COUNT #define MEMORY_MANAGER_LARGE_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_LARGE_BLOCK_SIZE - Size of each memory blocks identified as 'large' block. +// MEMORY_MANAGER_LARGE_BLOCK_SIZE - Size of each memory blocks identified as 'large' block. // Size of each memory blocks identified as 'large' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_LARGE_BLOCK_SIZE #define MEMORY_MANAGER_LARGE_BLOCK_SIZE 256 #endif -// MEMORY_MANAGER_XLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra large' block. <0-255> +// MEMORY_MANAGER_XLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra large' block. <0-255> #ifndef MEMORY_MANAGER_XLARGE_BLOCK_COUNT #define MEMORY_MANAGER_XLARGE_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_XLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra large' block. +// MEMORY_MANAGER_XLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra large' block. // Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_XLARGE_BLOCK_SIZE #define MEMORY_MANAGER_XLARGE_BLOCK_SIZE 1320 #endif -// MEMORY_MANAGER_XXLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra large' block. <0-255> +// MEMORY_MANAGER_XXLARGE_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra large' block. <0-255> #ifndef MEMORY_MANAGER_XXLARGE_BLOCK_COUNT #define MEMORY_MANAGER_XXLARGE_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_XXLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra large' block. +// MEMORY_MANAGER_XXLARGE_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra large' block. // Size of each memory blocks identified as 'extra extra large' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_XXLARGE_BLOCK_SIZE #define MEMORY_MANAGER_XXLARGE_BLOCK_SIZE 3444 #endif -// MEMORY_MANAGER_XSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra small' block. <0-255> +// MEMORY_MANAGER_XSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra small' block. <0-255> #ifndef MEMORY_MANAGER_XSMALL_BLOCK_COUNT #define MEMORY_MANAGER_XSMALL_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_XSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra small' block. +// MEMORY_MANAGER_XSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra small' block. // Size of each memory blocks identified as 'extra large' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_XSMALL_BLOCK_SIZE #define MEMORY_MANAGER_XSMALL_BLOCK_SIZE 64 #endif -// MEMORY_MANAGER_XXSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra small' block. <0-255> +// MEMORY_MANAGER_XXSMALL_BLOCK_COUNT - Size of each memory blocks identified as 'extra extra small' block. <0-255> #ifndef MEMORY_MANAGER_XXSMALL_BLOCK_COUNT #define MEMORY_MANAGER_XXSMALL_BLOCK_COUNT 0 #endif -// MEMORY_MANAGER_XXSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra small' block. +// MEMORY_MANAGER_XXSMALL_BLOCK_SIZE - Size of each memory blocks identified as 'extra extra small' block. // Size of each memory blocks identified as 'extra extra small' block. Memory block are recommended to be word-sized. #ifndef MEMORY_MANAGER_XXSMALL_BLOCK_SIZE @@ -3749,7 +3749,7 @@ #endif // MEM_MANAGER_DISABLE_API_PARAM_CHECK - Disable API parameter checks in the module. - + #ifndef MEM_MANAGER_DISABLE_API_PARAM_CHECK #define MEM_MANAGER_DISABLE_API_PARAM_CHECK 0 @@ -3767,14 +3767,14 @@ #ifndef NRF_BALLOC_CONFIG_DEBUG_ENABLED #define NRF_BALLOC_CONFIG_DEBUG_ENABLED 0 #endif -// NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS - Number of words used as head guard. <0-255> +// NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS - Number of words used as head guard. <0-255> #ifndef NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS #define NRF_BALLOC_CONFIG_HEAD_GUARD_WORDS 1 #endif -// NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS - Number of words used as tail guard. <0-255> +// NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS - Number of words used as tail guard. <0-255> #ifndef NRF_BALLOC_CONFIG_TAIL_GUARD_WORDS @@ -3782,21 +3782,21 @@ #endif // NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED - Enables basic checks in this module. - + #ifndef NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED #define NRF_BALLOC_CONFIG_BASIC_CHECKS_ENABLED 0 #endif // NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED - Enables double memory free check in this module. - + #ifndef NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED #define NRF_BALLOC_CONFIG_DOUBLE_FREE_CHECK_ENABLED 0 #endif // NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED - Enables free memory corruption check in this module. - + #ifndef NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED #define NRF_BALLOC_CONFIG_DATA_TRASHING_CHECK_ENABLED 0 @@ -3811,32 +3811,32 @@ #ifndef NRF_CSENSE_ENABLED #define NRF_CSENSE_ENABLED 0 #endif -// NRF_CSENSE_PAD_HYSTERESIS - Minimum value of change required to determine that a pad was touched. +// NRF_CSENSE_PAD_HYSTERESIS - Minimum value of change required to determine that a pad was touched. #ifndef NRF_CSENSE_PAD_HYSTERESIS #define NRF_CSENSE_PAD_HYSTERESIS 15 #endif -// NRF_CSENSE_PAD_DEVIATION - Minimum value measured on a pad required to take it into account while calculating the step. +// NRF_CSENSE_PAD_DEVIATION - Minimum value measured on a pad required to take it into account while calculating the step. #ifndef NRF_CSENSE_PAD_DEVIATION #define NRF_CSENSE_PAD_DEVIATION 70 #endif -// NRF_CSENSE_MIN_PAD_VALUE - Minimum normalized value on a pad required to take its value into account. +// NRF_CSENSE_MIN_PAD_VALUE - Minimum normalized value on a pad required to take its value into account. #ifndef NRF_CSENSE_MIN_PAD_VALUE #define NRF_CSENSE_MIN_PAD_VALUE 20 #endif -// NRF_CSENSE_MAX_PADS_NUMBER - Maximum number of pads used for one instance. +// NRF_CSENSE_MAX_PADS_NUMBER - Maximum number of pads used for one instance. #ifndef NRF_CSENSE_MAX_PADS_NUMBER #define NRF_CSENSE_MAX_PADS_NUMBER 20 #endif -// NRF_CSENSE_MAX_VALUE - Maximum normalized value obtained from measurement. +// NRF_CSENSE_MAX_VALUE - Maximum normalized value obtained from measurement. #ifndef NRF_CSENSE_MAX_VALUE #define NRF_CSENSE_MAX_VALUE 1000 #endif -// NRF_CSENSE_OUTPUT_PIN - Output pin used by the low-level module. +// NRF_CSENSE_OUTPUT_PIN - Output pin used by the low-level module. // This is used when capacitive sensor does not use COMP. #ifndef NRF_CSENSE_OUTPUT_PIN @@ -3857,17 +3857,17 @@ #ifndef USE_COMP #define USE_COMP 0 #endif -// TIMER0_FOR_CSENSE - First TIMER instance used by the driver (not used on nRF51). +// TIMER0_FOR_CSENSE - First TIMER instance used by the driver (not used on nRF51). #ifndef TIMER0_FOR_CSENSE #define TIMER0_FOR_CSENSE 1 #endif -// TIMER1_FOR_CSENSE - Second TIMER instance used by the driver (not used on nRF51). +// TIMER1_FOR_CSENSE - Second TIMER instance used by the driver (not used on nRF51). #ifndef TIMER1_FOR_CSENSE #define TIMER1_FOR_CSENSE 2 #endif -// MEASUREMENT_PERIOD - Single measurement period. +// MEASUREMENT_PERIOD - Single measurement period. // Time of a single measurement can be calculated as // T = (1/2)*MEASUREMENT_PERIOD*(1/f_OSC) where f_OSC = I_SOURCE / (2C*(VUP-VDOWN) ). // I_SOURCE, VUP, and VDOWN are values used to initialize COMP and C is the capacitance of the used pad. @@ -3881,7 +3881,7 @@ // // NRF_FPRINTF_ENABLED - nrf_fprintf - fprintf function. - + #ifndef NRF_FPRINTF_ENABLED #define NRF_FPRINTF_ENABLED 0 @@ -3896,14 +3896,14 @@ // Configuration options for the fstorage implementation using the SoftDevice. //========================================================== -// NRF_FSTORAGE_SD_QUEUE_SIZE - Size of the internal queue of operations. +// NRF_FSTORAGE_SD_QUEUE_SIZE - Size of the internal queue of operations. // Increase this value if API calls frequently return the error @ref NRF_ERROR_NO_MEM. #ifndef NRF_FSTORAGE_SD_QUEUE_SIZE #define NRF_FSTORAGE_SD_QUEUE_SIZE 4 #endif -// NRF_FSTORAGE_SD_MAX_RETRIES - Maximum number of attempts at executing an operation when the SoftDevice is busy. +// NRF_FSTORAGE_SD_MAX_RETRIES - Maximum number of attempts at executing an operation when the SoftDevice is busy. // Increase this value if events frequently return the @ref NRF_ERROR_TIMEOUT error. // The SoftDevice might fail to schedule flash access due to high BLE activity. @@ -3911,7 +3911,7 @@ #define NRF_FSTORAGE_SD_MAX_RETRIES 8 #endif -// NRF_FSTORAGE_SD_MAX_WRITE_SIZE - Maximum number of bytes to be written to flash in a single operation. +// NRF_FSTORAGE_SD_MAX_WRITE_SIZE - Maximum number of bytes to be written to flash in a single operation. // This value must be a multiple of four. // Lowering this value can increase the chances of the SoftDevice being able to execute flash operations in between radio activity. // This value is bound by the maximum number of bytes that can be written to flash in a single call to @ref sd_flash_write. @@ -3921,13 +3921,13 @@ #define NRF_FSTORAGE_SD_MAX_WRITE_SIZE 4096 #endif -// +// //========================================================== // // NRF_MEMOBJ_ENABLED - nrf_memobj - Linked memory allocator module - + #ifndef NRF_MEMOBJ_ENABLED #define NRF_MEMOBJ_ENABLED 0 @@ -3946,56 +3946,56 @@ #define NRF_PWR_MGMT_CONFIG_DEBUG_PIN_ENABLED 0 #endif // NRF_PWR_MGMT_SLEEP_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef NRF_PWR_MGMT_SLEEP_DEBUG_PIN #define NRF_PWR_MGMT_SLEEP_DEBUG_PIN 31 @@ -4004,7 +4004,7 @@ // // NRF_PWR_MGMT_CONFIG_CPU_USAGE_MONITOR_ENABLED - Enables CPU usage monitor. - + // Module will trace percentage of CPU usage in one second intervals. @@ -4017,7 +4017,7 @@ #ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED #define NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_ENABLED 0 #endif -// NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S - Standby timeout (in seconds). +// NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S - Standby timeout (in seconds). // Shutdown procedure will begin no earlier than after this number of seconds. #ifndef NRF_PWR_MGMT_CONFIG_STANDBY_TIMEOUT_S @@ -4027,27 +4027,27 @@ // // NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED - Enables FPU event cleaning. - + #ifndef NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED #define NRF_PWR_MGMT_CONFIG_FPU_SUPPORT_ENABLED 1 #endif // NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY - Blocked shutdown procedure will be retried every second. - + #ifndef NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY #define NRF_PWR_MGMT_CONFIG_AUTO_SHUTDOWN_RETRY 0 #endif // NRF_PWR_MGMT_CONFIG_USE_SCHEDULER - Module will use @ref app_scheduler. - + #ifndef NRF_PWR_MGMT_CONFIG_USE_SCHEDULER #define NRF_PWR_MGMT_CONFIG_USE_SCHEDULER 0 #endif -// NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT - The number of priorities for module handlers. +// NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT - The number of priorities for module handlers. // The number of stages of the shutdown process. #ifndef NRF_PWR_MGMT_CONFIG_HANDLER_PRIORITY_COUNT @@ -4057,28 +4057,28 @@ // // NRF_QUEUE_ENABLED - nrf_queue - Queue module - + #ifndef NRF_QUEUE_ENABLED #define NRF_QUEUE_ENABLED 1 #endif // NRF_SECTION_ITER_ENABLED - nrf_section_iter - Section iterator - + #ifndef NRF_SECTION_ITER_ENABLED #define NRF_SECTION_ITER_ENABLED 1 #endif // NRF_STRERROR_ENABLED - nrf_strerror - Library for converting error code to string. - + #ifndef NRF_STRERROR_ENABLED #define NRF_STRERROR_ENABLED 0 #endif // SLIP_ENABLED - slip - SLIP encoding and decoding - + #ifndef SLIP_ENABLED #define SLIP_ENABLED 0 @@ -4090,37 +4090,37 @@ #define TASK_MANAGER_ENABLED 0 #endif // TASK_MANAGER_CLI_CMDS - Enable CLI commands specific to the module - + #ifndef TASK_MANAGER_CLI_CMDS #define TASK_MANAGER_CLI_CMDS 1 #endif -// TASK_MANAGER_CONFIG_MAX_TASKS - Maximum number of tasks which can be created +// TASK_MANAGER_CONFIG_MAX_TASKS - Maximum number of tasks which can be created #ifndef TASK_MANAGER_CONFIG_MAX_TASKS #define TASK_MANAGER_CONFIG_MAX_TASKS 2 #endif -// TASK_MANAGER_CONFIG_STACK_SIZE - Stack size for every task (power of 2) +// TASK_MANAGER_CONFIG_STACK_SIZE - Stack size for every task (power of 2) #ifndef TASK_MANAGER_CONFIG_STACK_SIZE #define TASK_MANAGER_CONFIG_STACK_SIZE 1024 #endif // TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED - Enable stack profiling. - + #ifndef TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED #define TASK_MANAGER_CONFIG_STACK_PROFILER_ENABLED 1 #endif // TASK_MANAGER_CONFIG_STACK_GUARD - Configures stack guard. - -// <0=> Disabled -// <4=> 32 bytes -// <5=> 64 bytes -// <6=> 128 bytes -// <7=> 256 bytes -// <8=> 512 bytes + +// <0=> Disabled +// <4=> 32 bytes +// <5=> 64 bytes +// <6=> 128 bytes +// <7=> 256 bytes +// <8=> 512 bytes #ifndef TASK_MANAGER_CONFIG_STACK_GUARD #define TASK_MANAGER_CONFIG_STACK_GUARD 7 @@ -4132,30 +4132,30 @@ //========================================================== // NRF_CLI_ENABLED - Enable/disable CLI module. - + #ifndef NRF_CLI_ENABLED #define NRF_CLI_ENABLED 0 #endif -// NRF_CLI_ARGC_MAX - Maximum number of parameters passed to command handler. +// NRF_CLI_ARGC_MAX - Maximum number of parameters passed to command handler. #ifndef NRF_CLI_ARGC_MAX #define NRF_CLI_ARGC_MAX 12 #endif // NRF_CLI_BUILD_IN_CMDS_ENABLED - CLI build in commands. - + #ifndef NRF_CLI_BUILD_IN_CMDS_ENABLED #define NRF_CLI_BUILD_IN_CMDS_ENABLED 1 #endif -// NRF_CLI_CMD_BUFF_SIZE - Maximum buffer size for single command. +// NRF_CLI_CMD_BUFF_SIZE - Maximum buffer size for single command. #ifndef NRF_CLI_CMD_BUFF_SIZE #define NRF_CLI_CMD_BUFF_SIZE 128 #endif -// NRF_CLI_PRINTF_BUFF_SIZE - Maximum print buffer size. +// NRF_CLI_PRINTF_BUFF_SIZE - Maximum print buffer size. #ifndef NRF_CLI_PRINTF_BUFF_SIZE #define NRF_CLI_PRINTF_BUFF_SIZE 23 #endif @@ -4165,12 +4165,12 @@ #ifndef NRF_CLI_HISTORY_ENABLED #define NRF_CLI_HISTORY_ENABLED 1 #endif -// NRF_CLI_HISTORY_ELEMENT_SIZE - Size of one memory object reserved for CLI history +// NRF_CLI_HISTORY_ELEMENT_SIZE - Size of one memory object reserved for CLI history #ifndef NRF_CLI_HISTORY_ELEMENT_SIZE #define NRF_CLI_HISTORY_ELEMENT_SIZE 32 #endif -// NRF_CLI_HISTORY_ELEMENT_COUNT - Number of history memory objects +// NRF_CLI_HISTORY_ELEMENT_COUNT - Number of history memory objects #ifndef NRF_CLI_HISTORY_ELEMENT_COUNT #define NRF_CLI_HISTORY_ELEMENT_COUNT 8 #endif @@ -4178,51 +4178,51 @@ // // NRF_CLI_VT100_COLORS_ENABLED - CLI VT100 colors. - + #ifndef NRF_CLI_VT100_COLORS_ENABLED #define NRF_CLI_VT100_COLORS_ENABLED 1 #endif // NRF_CLI_LOG_BACKEND - Enable logger backend interface. - + #ifndef NRF_CLI_LOG_BACKEND #define NRF_CLI_LOG_BACKEND 1 #endif // NRF_CLI_USES_TASK_MANAGER_ENABLED - Enable CLI to use task_manager - + #ifndef NRF_CLI_USES_TASK_MANAGER_ENABLED #define NRF_CLI_USES_TASK_MANAGER_ENABLED 0 #endif -// +// //========================================================== // nrf_cli_rtt - RTT command line interface transport. //========================================================== // NRF_CLI_RTT_ENABLED - Enable/disable CLI RTT module. - + #ifndef NRF_CLI_RTT_ENABLED #define NRF_CLI_RTT_ENABLED 0 #endif -// NRF_CLI_RTT_TERMINAL_ID - RTT terminal ID for CLI. +// NRF_CLI_RTT_TERMINAL_ID - RTT terminal ID for CLI. #ifndef NRF_CLI_RTT_TERMINAL_ID #define NRF_CLI_RTT_TERMINAL_ID 0 #endif -// +// //========================================================== -// +// //========================================================== -// nRF_Log +// nRF_Log //========================================================== // NRF_LOG_BACKEND_RTT_ENABLED - nrf_log_backend_rtt - Log RTT backend @@ -4230,7 +4230,7 @@ #ifndef NRF_LOG_BACKEND_RTT_ENABLED #define NRF_LOG_BACKEND_RTT_ENABLED 0 #endif -// NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. +// NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. // Size of the buffer is a trade-off between RAM usage and processing. // if buffer is smaller then strings will often be fragmented. // It is recommended to use size which will fit typical log and only the @@ -4247,35 +4247,35 @@ #ifndef NRF_LOG_BACKEND_UART_ENABLED #define NRF_LOG_BACKEND_UART_ENABLED 0 #endif -// NRF_LOG_BACKEND_UART_TX_PIN - UART TX pin +// NRF_LOG_BACKEND_UART_TX_PIN - UART TX pin #ifndef NRF_LOG_BACKEND_UART_TX_PIN #define NRF_LOG_BACKEND_UART_TX_PIN 6 #endif // NRF_LOG_BACKEND_UART_BAUDRATE - Default Baudrate - -// <323584=> 1200 baud -// <643072=> 2400 baud -// <1290240=> 4800 baud -// <2576384=> 9600 baud -// <3862528=> 14400 baud -// <5152768=> 19200 baud -// <7716864=> 28800 baud -// <10289152=> 38400 baud -// <15400960=> 57600 baud -// <20615168=> 76800 baud -// <30801920=> 115200 baud -// <61865984=> 230400 baud -// <67108864=> 250000 baud -// <121634816=> 460800 baud -// <251658240=> 921600 baud -// <268435456=> 1000000 baud + +// <323584=> 1200 baud +// <643072=> 2400 baud +// <1290240=> 4800 baud +// <2576384=> 9600 baud +// <3862528=> 14400 baud +// <5152768=> 19200 baud +// <7716864=> 28800 baud +// <10289152=> 38400 baud +// <15400960=> 57600 baud +// <20615168=> 76800 baud +// <30801920=> 115200 baud +// <61865984=> 230400 baud +// <67108864=> 250000 baud +// <121634816=> 460800 baud +// <251658240=> 921600 baud +// <268435456=> 1000000 baud #ifndef NRF_LOG_BACKEND_UART_BAUDRATE #define NRF_LOG_BACKEND_UART_BAUDRATE 30801920 #endif -// NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. +// NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE - Size of buffer for partially processed strings. // Size of the buffer is a trade-off between RAM usage and processing. // if buffer is smaller then strings will often be fragmented. // It is recommended to use size which will fit typical log and only the @@ -4301,48 +4301,48 @@ #define NRF_LOG_USES_COLORS 0 #endif // NRF_LOG_COLOR_DEFAULT - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_LOG_COLOR_DEFAULT #define NRF_LOG_COLOR_DEFAULT 0 #endif // NRF_LOG_ERROR_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_LOG_ERROR_COLOR #define NRF_LOG_ERROR_COLOR 0 #endif // NRF_LOG_WARNING_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_LOG_WARNING_COLOR #define NRF_LOG_WARNING_COLOR 0 @@ -4351,19 +4351,19 @@ // // NRF_LOG_DEFAULT_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_LOG_DEFAULT_LEVEL #define NRF_LOG_DEFAULT_LEVEL 3 #endif // NRF_LOG_DEFERRED - Enable deffered logger. - + // Log data is buffered and can be processed in idle. @@ -4372,27 +4372,27 @@ #endif // NRF_LOG_BUFSIZE - Size of the buffer for storing logs (in bytes). - + // Must be power of 2 and multiple of 4. // If NRF_LOG_DEFERRED = 0 then buffer size can be reduced to minimum. -// <128=> 128 -// <256=> 256 -// <512=> 512 -// <1024=> 1024 -// <2048=> 2048 -// <4096=> 4096 -// <8192=> 8192 -// <16384=> 16384 +// <128=> 128 +// <256=> 256 +// <512=> 512 +// <1024=> 1024 +// <2048=> 2048 +// <4096=> 4096 +// <8192=> 8192 +// <16384=> 16384 #ifndef NRF_LOG_BUFSIZE #define NRF_LOG_BUFSIZE 1024 #endif // NRF_LOG_ALLOW_OVERFLOW - Configures behavior when circular buffer is full. - -// If set then oldest logs are overwritten. Otherwise a + +// If set then oldest logs are overwritten. Otherwise a // marker is injected informing about overflow. #ifndef NRF_LOG_ALLOW_OVERFLOW @@ -4400,7 +4400,7 @@ #endif // NRF_LOG_USES_TIMESTAMP - Enable timestamping - + // Function for getting the timestamp is provided by the user @@ -4409,14 +4409,14 @@ #endif // NRF_LOG_FILTERS_ENABLED - Enable dynamic filtering of logs. - + #ifndef NRF_LOG_FILTERS_ENABLED #define NRF_LOG_FILTERS_ENABLED 1 #endif // NRF_LOG_CLI_CMDS - Enable CLI commands for the module. - + #ifndef NRF_LOG_CLI_CMDS #define NRF_LOG_CLI_CMDS 1 @@ -4425,7 +4425,7 @@ // Log message pool - Configuration of log message pool //========================================================== -// NRF_LOG_MSGPOOL_ELEMENT_SIZE - Size of a single element in the pool of memory objects. +// NRF_LOG_MSGPOOL_ELEMENT_SIZE - Size of a single element in the pool of memory objects. // If a small value is set, then performance of logs processing // is degraded because data is fragmented. Bigger value impacts // RAM memory utilization. The size is set to fit a message with @@ -4435,7 +4435,7 @@ #define NRF_LOG_MSGPOOL_ELEMENT_SIZE 20 #endif -// NRF_LOG_MSGPOOL_ELEMENT_COUNT - Number of elements in the pool of memory objects +// NRF_LOG_MSGPOOL_ELEMENT_COUNT - Number of elements in the pool of memory objects // If a small value is set, then it may lead to a deadlock // in certain cases if backend has high latency and holds // multiple messages for long time. Bigger value impacts @@ -4445,15 +4445,15 @@ #define NRF_LOG_MSGPOOL_ELEMENT_COUNT 8 #endif -// +// //========================================================== // -// nrf_log module configuration +// nrf_log module configuration //========================================================== -// nrf_log in nRF_Core +// nrf_log in nRF_Core //========================================================== // NRF_MPU_CONFIG_LOG_ENABLED - Enables logging in the module. @@ -4462,44 +4462,44 @@ #define NRF_MPU_CONFIG_LOG_ENABLED 0 #endif // NRF_MPU_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_MPU_CONFIG_LOG_LEVEL #define NRF_MPU_CONFIG_LOG_LEVEL 3 #endif // NRF_MPU_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_MPU_CONFIG_INFO_COLOR #define NRF_MPU_CONFIG_INFO_COLOR 0 #endif // NRF_MPU_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_MPU_CONFIG_DEBUG_COLOR #define NRF_MPU_CONFIG_DEBUG_COLOR 0 @@ -4513,44 +4513,44 @@ #define NRF_STACK_GUARD_CONFIG_LOG_ENABLED 0 #endif // NRF_STACK_GUARD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_STACK_GUARD_CONFIG_LOG_LEVEL #define NRF_STACK_GUARD_CONFIG_LOG_LEVEL 3 #endif // NRF_STACK_GUARD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_STACK_GUARD_CONFIG_INFO_COLOR #define NRF_STACK_GUARD_CONFIG_INFO_COLOR 0 #endif // NRF_STACK_GUARD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_STACK_GUARD_CONFIG_DEBUG_COLOR #define NRF_STACK_GUARD_CONFIG_DEBUG_COLOR 0 @@ -4564,44 +4564,44 @@ #define TASK_MANAGER_CONFIG_LOG_ENABLED 0 #endif // TASK_MANAGER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef TASK_MANAGER_CONFIG_LOG_LEVEL #define TASK_MANAGER_CONFIG_LOG_LEVEL 3 #endif // TASK_MANAGER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TASK_MANAGER_CONFIG_INFO_COLOR #define TASK_MANAGER_CONFIG_INFO_COLOR 0 #endif // TASK_MANAGER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TASK_MANAGER_CONFIG_DEBUG_COLOR #define TASK_MANAGER_CONFIG_DEBUG_COLOR 0 @@ -4609,10 +4609,10 @@ // -// +// //========================================================== -// nrf_log in nRF_Drivers +// nrf_log in nRF_Drivers //========================================================== // CLOCK_CONFIG_LOG_ENABLED - Enables logging in the module. @@ -4621,44 +4621,44 @@ #define CLOCK_CONFIG_LOG_ENABLED 0 #endif // CLOCK_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef CLOCK_CONFIG_LOG_LEVEL #define CLOCK_CONFIG_LOG_LEVEL 3 #endif // CLOCK_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef CLOCK_CONFIG_INFO_COLOR #define CLOCK_CONFIG_INFO_COLOR 0 #endif // CLOCK_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef CLOCK_CONFIG_DEBUG_COLOR #define CLOCK_CONFIG_DEBUG_COLOR 0 @@ -4672,44 +4672,44 @@ #define COMMON_CONFIG_LOG_ENABLED 0 #endif // COMMON_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef COMMON_CONFIG_LOG_LEVEL #define COMMON_CONFIG_LOG_LEVEL 3 #endif // COMMON_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef COMMON_CONFIG_INFO_COLOR #define COMMON_CONFIG_INFO_COLOR 0 #endif // COMMON_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef COMMON_CONFIG_DEBUG_COLOR #define COMMON_CONFIG_DEBUG_COLOR 0 @@ -4723,44 +4723,44 @@ #define COMP_CONFIG_LOG_ENABLED 0 #endif // COMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef COMP_CONFIG_LOG_LEVEL #define COMP_CONFIG_LOG_LEVEL 3 #endif // COMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef COMP_CONFIG_INFO_COLOR #define COMP_CONFIG_INFO_COLOR 0 #endif // COMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef COMP_CONFIG_DEBUG_COLOR #define COMP_CONFIG_DEBUG_COLOR 0 @@ -4774,44 +4774,44 @@ #define GPIOTE_CONFIG_LOG_ENABLED 0 #endif // GPIOTE_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef GPIOTE_CONFIG_LOG_LEVEL #define GPIOTE_CONFIG_LOG_LEVEL 3 #endif // GPIOTE_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef GPIOTE_CONFIG_INFO_COLOR #define GPIOTE_CONFIG_INFO_COLOR 0 #endif // GPIOTE_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef GPIOTE_CONFIG_DEBUG_COLOR #define GPIOTE_CONFIG_DEBUG_COLOR 0 @@ -4825,44 +4825,44 @@ #define I2S_CONFIG_LOG_ENABLED 0 #endif // I2S_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef I2S_CONFIG_LOG_LEVEL #define I2S_CONFIG_LOG_LEVEL 3 #endif // I2S_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef I2S_CONFIG_INFO_COLOR #define I2S_CONFIG_INFO_COLOR 0 #endif // I2S_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef I2S_CONFIG_DEBUG_COLOR #define I2S_CONFIG_DEBUG_COLOR 0 @@ -4876,44 +4876,44 @@ #define LPCOMP_CONFIG_LOG_ENABLED 0 #endif // LPCOMP_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef LPCOMP_CONFIG_LOG_LEVEL #define LPCOMP_CONFIG_LOG_LEVEL 3 #endif // LPCOMP_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef LPCOMP_CONFIG_INFO_COLOR #define LPCOMP_CONFIG_INFO_COLOR 0 #endif // LPCOMP_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef LPCOMP_CONFIG_DEBUG_COLOR #define LPCOMP_CONFIG_DEBUG_COLOR 0 @@ -4927,44 +4927,44 @@ #define PDM_CONFIG_LOG_ENABLED 0 #endif // PDM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef PDM_CONFIG_LOG_LEVEL #define PDM_CONFIG_LOG_LEVEL 3 #endif // PDM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PDM_CONFIG_INFO_COLOR #define PDM_CONFIG_INFO_COLOR 0 #endif // PDM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PDM_CONFIG_DEBUG_COLOR #define PDM_CONFIG_DEBUG_COLOR 0 @@ -4978,44 +4978,44 @@ #define PPI_CONFIG_LOG_ENABLED 0 #endif // PPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef PPI_CONFIG_LOG_LEVEL #define PPI_CONFIG_LOG_LEVEL 3 #endif // PPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PPI_CONFIG_INFO_COLOR #define PPI_CONFIG_INFO_COLOR 0 #endif // PPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PPI_CONFIG_DEBUG_COLOR #define PPI_CONFIG_DEBUG_COLOR 0 @@ -5029,44 +5029,44 @@ #define PWM_CONFIG_LOG_ENABLED 0 #endif // PWM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef PWM_CONFIG_LOG_LEVEL #define PWM_CONFIG_LOG_LEVEL 3 #endif // PWM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PWM_CONFIG_INFO_COLOR #define PWM_CONFIG_INFO_COLOR 0 #endif // PWM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef PWM_CONFIG_DEBUG_COLOR #define PWM_CONFIG_DEBUG_COLOR 0 @@ -5080,44 +5080,44 @@ #define QDEC_CONFIG_LOG_ENABLED 0 #endif // QDEC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef QDEC_CONFIG_LOG_LEVEL #define QDEC_CONFIG_LOG_LEVEL 3 #endif // QDEC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef QDEC_CONFIG_INFO_COLOR #define QDEC_CONFIG_INFO_COLOR 0 #endif // QDEC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef QDEC_CONFIG_DEBUG_COLOR #define QDEC_CONFIG_DEBUG_COLOR 0 @@ -5131,51 +5131,51 @@ #define RNG_CONFIG_LOG_ENABLED 0 #endif // RNG_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef RNG_CONFIG_LOG_LEVEL #define RNG_CONFIG_LOG_LEVEL 3 #endif // RNG_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef RNG_CONFIG_INFO_COLOR #define RNG_CONFIG_INFO_COLOR 0 #endif // RNG_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef RNG_CONFIG_DEBUG_COLOR #define RNG_CONFIG_DEBUG_COLOR 0 #endif // RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED - Enables logging of random numbers. - + #ifndef RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED #define RNG_CONFIG_RANDOM_NUMBER_LOG_ENABLED 0 @@ -5189,44 +5189,44 @@ #define RTC_CONFIG_LOG_ENABLED 0 #endif // RTC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef RTC_CONFIG_LOG_LEVEL #define RTC_CONFIG_LOG_LEVEL 3 #endif // RTC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef RTC_CONFIG_INFO_COLOR #define RTC_CONFIG_INFO_COLOR 0 #endif // RTC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef RTC_CONFIG_DEBUG_COLOR #define RTC_CONFIG_DEBUG_COLOR 0 @@ -5240,44 +5240,44 @@ #define SAADC_CONFIG_LOG_ENABLED 0 #endif // SAADC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef SAADC_CONFIG_LOG_LEVEL #define SAADC_CONFIG_LOG_LEVEL 3 #endif // SAADC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SAADC_CONFIG_INFO_COLOR #define SAADC_CONFIG_INFO_COLOR 0 #endif // SAADC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SAADC_CONFIG_DEBUG_COLOR #define SAADC_CONFIG_DEBUG_COLOR 0 @@ -5291,44 +5291,44 @@ #define SPIS_CONFIG_LOG_ENABLED 0 #endif // SPIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef SPIS_CONFIG_LOG_LEVEL #define SPIS_CONFIG_LOG_LEVEL 3 #endif // SPIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SPIS_CONFIG_INFO_COLOR #define SPIS_CONFIG_INFO_COLOR 0 #endif // SPIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SPIS_CONFIG_DEBUG_COLOR #define SPIS_CONFIG_DEBUG_COLOR 0 @@ -5342,44 +5342,44 @@ #define SPI_CONFIG_LOG_ENABLED 0 #endif // SPI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef SPI_CONFIG_LOG_LEVEL #define SPI_CONFIG_LOG_LEVEL 3 #endif // SPI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SPI_CONFIG_INFO_COLOR #define SPI_CONFIG_INFO_COLOR 0 #endif // SPI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SPI_CONFIG_DEBUG_COLOR #define SPI_CONFIG_DEBUG_COLOR 0 @@ -5393,44 +5393,44 @@ #define SWI_CONFIG_LOG_ENABLED 0 #endif // SWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef SWI_CONFIG_LOG_LEVEL #define SWI_CONFIG_LOG_LEVEL 3 #endif // SWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SWI_CONFIG_INFO_COLOR #define SWI_CONFIG_INFO_COLOR 0 #endif // SWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef SWI_CONFIG_DEBUG_COLOR #define SWI_CONFIG_DEBUG_COLOR 0 @@ -5444,44 +5444,44 @@ #define TIMER_CONFIG_LOG_ENABLED 0 #endif // TIMER_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef TIMER_CONFIG_LOG_LEVEL #define TIMER_CONFIG_LOG_LEVEL 3 #endif // TIMER_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TIMER_CONFIG_INFO_COLOR #define TIMER_CONFIG_INFO_COLOR 0 #endif // TIMER_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TIMER_CONFIG_DEBUG_COLOR #define TIMER_CONFIG_DEBUG_COLOR 0 @@ -5495,44 +5495,44 @@ #define TWIS_CONFIG_LOG_ENABLED 0 #endif // TWIS_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef TWIS_CONFIG_LOG_LEVEL #define TWIS_CONFIG_LOG_LEVEL 3 #endif // TWIS_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TWIS_CONFIG_INFO_COLOR #define TWIS_CONFIG_INFO_COLOR 0 #endif // TWIS_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TWIS_CONFIG_DEBUG_COLOR #define TWIS_CONFIG_DEBUG_COLOR 0 @@ -5546,44 +5546,44 @@ #define TWI_CONFIG_LOG_ENABLED 0 #endif // TWI_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef TWI_CONFIG_LOG_LEVEL #define TWI_CONFIG_LOG_LEVEL 3 #endif // TWI_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TWI_CONFIG_INFO_COLOR #define TWI_CONFIG_INFO_COLOR 0 #endif // TWI_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef TWI_CONFIG_DEBUG_COLOR #define TWI_CONFIG_DEBUG_COLOR 0 @@ -5597,44 +5597,44 @@ #define UART_CONFIG_LOG_ENABLED 0 #endif // UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef UART_CONFIG_LOG_LEVEL #define UART_CONFIG_LOG_LEVEL 3 #endif // UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef UART_CONFIG_INFO_COLOR #define UART_CONFIG_INFO_COLOR 0 #endif // UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef UART_CONFIG_DEBUG_COLOR #define UART_CONFIG_DEBUG_COLOR 0 @@ -5648,44 +5648,44 @@ #define USBD_CONFIG_LOG_ENABLED 0 #endif // USBD_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef USBD_CONFIG_LOG_LEVEL #define USBD_CONFIG_LOG_LEVEL 3 #endif // USBD_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef USBD_CONFIG_INFO_COLOR #define USBD_CONFIG_INFO_COLOR 0 #endif // USBD_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef USBD_CONFIG_DEBUG_COLOR #define USBD_CONFIG_DEBUG_COLOR 0 @@ -5699,44 +5699,44 @@ #define WDT_CONFIG_LOG_ENABLED 0 #endif // WDT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef WDT_CONFIG_LOG_LEVEL #define WDT_CONFIG_LOG_LEVEL 3 #endif // WDT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef WDT_CONFIG_INFO_COLOR #define WDT_CONFIG_INFO_COLOR 0 #endif // WDT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef WDT_CONFIG_DEBUG_COLOR #define WDT_CONFIG_DEBUG_COLOR 0 @@ -5744,10 +5744,10 @@ // -// +// //========================================================== -// nrf_log in nRF_Libraries +// nrf_log in nRF_Libraries //========================================================== // APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED - Enables logging in the module. @@ -5756,44 +5756,44 @@ #define APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED 0 #endif // APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL #define APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL 3 #endif // APP_USBD_CDC_ACM_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_CDC_ACM_CONFIG_INFO_COLOR #define APP_USBD_CDC_ACM_CONFIG_INFO_COLOR 0 #endif // APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR #define APP_USBD_CDC_ACM_CONFIG_DEBUG_COLOR 0 @@ -5807,44 +5807,44 @@ #define APP_USBD_MSC_CONFIG_LOG_ENABLED 0 #endif // APP_USBD_MSC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef APP_USBD_MSC_CONFIG_LOG_LEVEL #define APP_USBD_MSC_CONFIG_LOG_LEVEL 3 #endif // APP_USBD_MSC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_MSC_CONFIG_INFO_COLOR #define APP_USBD_MSC_CONFIG_INFO_COLOR 0 #endif // APP_USBD_MSC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef APP_USBD_MSC_CONFIG_DEBUG_COLOR #define APP_USBD_MSC_CONFIG_DEBUG_COLOR 0 @@ -5853,7 +5853,7 @@ // // MEM_MANAGER_ENABLE_LOGS - Enable debug trace in the module. - + #ifndef MEM_MANAGER_ENABLE_LOGS #define MEM_MANAGER_ENABLE_LOGS 0 @@ -5865,44 +5865,44 @@ #define NRF_BALLOC_CONFIG_LOG_ENABLED 0 #endif // NRF_BALLOC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_BALLOC_CONFIG_LOG_LEVEL #define NRF_BALLOC_CONFIG_LOG_LEVEL 3 #endif // NRF_BALLOC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_BALLOC_CONFIG_INFO_COLOR #define NRF_BALLOC_CONFIG_INFO_COLOR 0 #endif // NRF_BALLOC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_BALLOC_CONFIG_DEBUG_COLOR #define NRF_BALLOC_CONFIG_DEBUG_COLOR 0 @@ -5916,44 +5916,44 @@ #define NRF_CLI_BLE_UART_CONFIG_LOG_ENABLED 0 #endif // NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL #define NRF_CLI_BLE_UART_CONFIG_LOG_LEVEL 3 #endif // NRF_CLI_BLE_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_CLI_BLE_UART_CONFIG_INFO_COLOR #define NRF_CLI_BLE_UART_CONFIG_INFO_COLOR 0 #endif // NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR #define NRF_CLI_BLE_UART_CONFIG_DEBUG_COLOR 0 @@ -5967,44 +5967,44 @@ #define NRF_CLI_UART_CONFIG_LOG_ENABLED 0 #endif // NRF_CLI_UART_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_CLI_UART_CONFIG_LOG_LEVEL #define NRF_CLI_UART_CONFIG_LOG_LEVEL 3 #endif // NRF_CLI_UART_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_CLI_UART_CONFIG_INFO_COLOR #define NRF_CLI_UART_CONFIG_INFO_COLOR 0 #endif // NRF_CLI_UART_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_CLI_UART_CONFIG_DEBUG_COLOR #define NRF_CLI_UART_CONFIG_DEBUG_COLOR 0 @@ -6018,44 +6018,44 @@ #define NRF_MEMOBJ_CONFIG_LOG_ENABLED 0 #endif // NRF_MEMOBJ_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_MEMOBJ_CONFIG_LOG_LEVEL #define NRF_MEMOBJ_CONFIG_LOG_LEVEL 3 #endif // NRF_MEMOBJ_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_MEMOBJ_CONFIG_INFO_COLOR #define NRF_MEMOBJ_CONFIG_INFO_COLOR 0 #endif // NRF_MEMOBJ_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_MEMOBJ_CONFIG_DEBUG_COLOR #define NRF_MEMOBJ_CONFIG_DEBUG_COLOR 0 @@ -6069,44 +6069,44 @@ #define NRF_PWR_MGMT_CONFIG_LOG_ENABLED 0 #endif // NRF_PWR_MGMT_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_PWR_MGMT_CONFIG_LOG_LEVEL #define NRF_PWR_MGMT_CONFIG_LOG_LEVEL 3 #endif // NRF_PWR_MGMT_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_PWR_MGMT_CONFIG_INFO_COLOR #define NRF_PWR_MGMT_CONFIG_INFO_COLOR 0 #endif // NRF_PWR_MGMT_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_PWR_MGMT_CONFIG_DEBUG_COLOR #define NRF_PWR_MGMT_CONFIG_DEBUG_COLOR 0 @@ -6120,44 +6120,44 @@ #define NRF_SDH_ANT_LOG_ENABLED 1 #endif // NRF_SDH_ANT_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_SDH_ANT_LOG_LEVEL #define NRF_SDH_ANT_LOG_LEVEL 3 #endif // NRF_SDH_ANT_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_ANT_INFO_COLOR #define NRF_SDH_ANT_INFO_COLOR 0 #endif // NRF_SDH_ANT_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_ANT_DEBUG_COLOR #define NRF_SDH_ANT_DEBUG_COLOR 0 @@ -6171,44 +6171,44 @@ #define NRF_SDH_BLE_LOG_ENABLED 1 #endif // NRF_SDH_BLE_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_SDH_BLE_LOG_LEVEL #define NRF_SDH_BLE_LOG_LEVEL 3 #endif // NRF_SDH_BLE_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_BLE_INFO_COLOR #define NRF_SDH_BLE_INFO_COLOR 0 #endif // NRF_SDH_BLE_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_BLE_DEBUG_COLOR #define NRF_SDH_BLE_DEBUG_COLOR 0 @@ -6222,44 +6222,44 @@ #define NRF_SDH_LOG_ENABLED 1 #endif // NRF_SDH_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_SDH_LOG_LEVEL #define NRF_SDH_LOG_LEVEL 3 #endif // NRF_SDH_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_INFO_COLOR #define NRF_SDH_INFO_COLOR 0 #endif // NRF_SDH_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_DEBUG_COLOR #define NRF_SDH_DEBUG_COLOR 0 @@ -6273,44 +6273,44 @@ #define NRF_SDH_SOC_LOG_ENABLED 1 #endif // NRF_SDH_SOC_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NRF_SDH_SOC_LOG_LEVEL #define NRF_SDH_SOC_LOG_LEVEL 3 #endif // NRF_SDH_SOC_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_SOC_INFO_COLOR #define NRF_SDH_SOC_INFO_COLOR 0 #endif // NRF_SDH_SOC_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NRF_SDH_SOC_DEBUG_COLOR #define NRF_SDH_SOC_DEBUG_COLOR 0 @@ -6318,19 +6318,19 @@ // -// +// //========================================================== -// +// //========================================================== -// +// //========================================================== -// +// //========================================================== -// nRF_NFC +// nRF_NFC //========================================================== // NFC_BLE_OOB_ADVDATA_ENABLED - nfc_ble_oob_advdata - Encoding the advertising data and/or scan response data which is specific for OOB pairing @@ -6339,9 +6339,9 @@ #define NFC_BLE_OOB_ADVDATA_ENABLED 0 #endif // ADVANCED_ADVDATA_SUPPORT - Non-mandatory AD types for BLE OOB pairing are encoded inside the NDEF message (e.g. service UUIDs) - -// <1=> Enabled -// <0=> Disabled + +// <1=> Enabled +// <0=> Disabled #ifndef ADVANCED_ADVDATA_SUPPORT #define ADVANCED_ADVDATA_SUPPORT 0 @@ -6360,44 +6360,44 @@ #define NFC_BLE_PAIR_LIB_LOG_ENABLED 0 #endif // NFC_BLE_PAIR_LIB_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NFC_BLE_PAIR_LIB_LOG_LEVEL #define NFC_BLE_PAIR_LIB_LOG_LEVEL 3 #endif // NFC_BLE_PAIR_LIB_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NFC_BLE_PAIR_LIB_INFO_COLOR #define NFC_BLE_PAIR_LIB_INFO_COLOR 0 #endif // NFC_BLE_PAIR_LIB_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NFC_BLE_PAIR_LIB_DEBUG_COLOR #define NFC_BLE_PAIR_LIB_DEBUG_COLOR 0 @@ -6416,84 +6416,84 @@ #define BLE_NFC_SEC_PARAM_BOND 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ENC - Enables Long Term Key and Master Identification distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ENC #define BLE_NFC_SEC_PARAM_KDIST_OWN_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ID - Enables Identity Resolving Key and Identity Address Information distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ID #define BLE_NFC_SEC_PARAM_KDIST_OWN_ID 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ENC - Enables Long Term Key and Master Identification distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ENC #define BLE_NFC_SEC_PARAM_KDIST_PEER_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ID - Enables Identity Resolving Key and Identity Address Information distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ID #define BLE_NFC_SEC_PARAM_KDIST_PEER_ID 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ENC - Enables Long Term Key and Master Identification distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ENC #define BLE_NFC_SEC_PARAM_KDIST_OWN_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ID - Enables Identity Resolving Key and Identity Address Information distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ID #define BLE_NFC_SEC_PARAM_KDIST_OWN_ID 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ENC - Enables Long Term Key and Master Identification distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ENC #define BLE_NFC_SEC_PARAM_KDIST_PEER_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ID - Enables Identity Resolving Key and Identity Address Information distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ID #define BLE_NFC_SEC_PARAM_KDIST_PEER_ID 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ENC - Enables Long Term Key and Master Identification distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ENC #define BLE_NFC_SEC_PARAM_KDIST_OWN_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_OWN_ID - Enables Identity Resolving Key and Identity Address Information distribution by device. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_OWN_ID #define BLE_NFC_SEC_PARAM_KDIST_OWN_ID 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ENC - Enables Long Term Key and Master Identification distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ENC #define BLE_NFC_SEC_PARAM_KDIST_PEER_ENC 1 #endif // BLE_NFC_SEC_PARAM_KDIST_PEER_ID - Enables Identity Resolving Key and Identity Address Information distribution by peer. - + #ifndef BLE_NFC_SEC_PARAM_KDIST_PEER_ID #define BLE_NFC_SEC_PARAM_KDIST_PEER_ID 1 @@ -6502,40 +6502,40 @@ // // BLE_NFC_SEC_PARAM_MIN_KEY_SIZE - Minimal size of a security key. - -// <7=> 7 -// <8=> 8 -// <9=> 9 -// <10=> 10 -// <11=> 11 -// <12=> 12 -// <13=> 13 -// <14=> 14 -// <15=> 15 -// <16=> 16 + +// <7=> 7 +// <8=> 8 +// <9=> 9 +// <10=> 10 +// <11=> 11 +// <12=> 12 +// <13=> 13 +// <14=> 14 +// <15=> 15 +// <16=> 16 #ifndef BLE_NFC_SEC_PARAM_MIN_KEY_SIZE #define BLE_NFC_SEC_PARAM_MIN_KEY_SIZE 7 #endif // BLE_NFC_SEC_PARAM_MAX_KEY_SIZE - Maximal size of a security key. - -// <7=> 7 -// <8=> 8 -// <9=> 9 -// <10=> 10 -// <11=> 11 -// <12=> 12 -// <13=> 13 -// <14=> 14 -// <15=> 15 -// <16=> 16 + +// <7=> 7 +// <8=> 8 +// <9=> 9 +// <10=> 10 +// <11=> 11 +// <12=> 12 +// <13=> 13 +// <14=> 14 +// <15=> 15 +// <16=> 16 #ifndef BLE_NFC_SEC_PARAM_MAX_KEY_SIZE #define BLE_NFC_SEC_PARAM_MAX_KEY_SIZE 16 #endif -// +// //========================================================== // @@ -6546,9 +6546,9 @@ #define NFC_NDEF_MSG_ENABLED 0 #endif // NFC_NDEF_MSG_TAG_TYPE - NFC Tag Type - -// <2=> Type 2 Tag -// <4=> Type 4 Tag + +// <2=> Type 2 Tag +// <4=> Type 4 Tag #ifndef NFC_NDEF_MSG_TAG_TYPE #define NFC_NDEF_MSG_TAG_TYPE 2 @@ -6567,28 +6567,28 @@ #define NFC_NDEF_MSG_PARSER_LOG_ENABLED 0 #endif // NFC_NDEF_MSG_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NFC_NDEF_MSG_PARSER_LOG_LEVEL #define NFC_NDEF_MSG_PARSER_LOG_LEVEL 3 #endif // NFC_NDEF_MSG_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NFC_NDEF_MSG_PARSER_INFO_COLOR #define NFC_NDEF_MSG_PARSER_INFO_COLOR 0 @@ -6609,28 +6609,28 @@ #define NFC_NDEF_RECORD_PARSER_LOG_ENABLED 0 #endif // NFC_NDEF_RECORD_PARSER_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef NFC_NDEF_RECORD_PARSER_LOG_LEVEL #define NFC_NDEF_RECORD_PARSER_LOG_LEVEL 3 #endif // NFC_NDEF_RECORD_PARSER_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef NFC_NDEF_RECORD_PARSER_INFO_COLOR #define NFC_NDEF_RECORD_PARSER_INFO_COLOR 0 @@ -6646,17 +6646,17 @@ #define NFC_T2T_HAL_ENABLED 0 #endif // NFCT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef NFCT_CONFIG_IRQ_PRIORITY #define NFCT_CONFIG_IRQ_PRIORITY 7 @@ -6668,88 +6668,88 @@ #define HAL_NFC_CONFIG_LOG_ENABLED 0 #endif // HAL_NFC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef HAL_NFC_CONFIG_LOG_LEVEL #define HAL_NFC_CONFIG_LOG_LEVEL 3 #endif // HAL_NFC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_INFO_COLOR #define HAL_NFC_CONFIG_INFO_COLOR 0 #endif // HAL_NFC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_DEBUG_COLOR #define HAL_NFC_CONFIG_DEBUG_COLOR 0 #endif // HAL_NFC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef HAL_NFC_CONFIG_LOG_LEVEL #define HAL_NFC_CONFIG_LOG_LEVEL 3 #endif // HAL_NFC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_INFO_COLOR #define HAL_NFC_CONFIG_INFO_COLOR 0 #endif // HAL_NFC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_DEBUG_COLOR #define HAL_NFC_CONFIG_DEBUG_COLOR 0 @@ -6763,560 +6763,560 @@ #define HAL_NFC_CONFIG_DEBUG_PIN_ENABLED 0 #endif // HAL_NFC_HCLOCK_ON_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_ON_DEBUG_PIN #define HAL_NFC_HCLOCK_ON_DEBUG_PIN 11 #endif // HAL_NFC_HCLOCK_OFF_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_OFF_DEBUG_PIN #define HAL_NFC_HCLOCK_OFF_DEBUG_PIN 12 #endif // HAL_NFC_NFC_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_NFC_EVENT_DEBUG_PIN #define HAL_NFC_NFC_EVENT_DEBUG_PIN 24 #endif // HAL_NFC_DETECT_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_DETECT_EVENT_DEBUG_PIN #define HAL_NFC_DETECT_EVENT_DEBUG_PIN 25 #endif // HAL_NFC_TIMER4_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_TIMER4_EVENT_DEBUG_PIN #define HAL_NFC_TIMER4_EVENT_DEBUG_PIN 28 #endif // HAL_NFC_HCLOCK_ON_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_ON_DEBUG_PIN #define HAL_NFC_HCLOCK_ON_DEBUG_PIN 31 #endif // HAL_NFC_HCLOCK_OFF_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_OFF_DEBUG_PIN #define HAL_NFC_HCLOCK_OFF_DEBUG_PIN 31 #endif // HAL_NFC_NFC_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_NFC_EVENT_DEBUG_PIN #define HAL_NFC_NFC_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_DETECT_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_DETECT_EVENT_DEBUG_PIN #define HAL_NFC_DETECT_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_TIMER4_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_TIMER4_EVENT_DEBUG_PIN #define HAL_NFC_TIMER4_EVENT_DEBUG_PIN 31 @@ -7332,17 +7332,17 @@ #define NFC_T4T_HAL_ENABLED 0 #endif // NFCT_CONFIG_IRQ_PRIORITY - Interrupt priority - + // Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice -// <0=> 0 (highest) -// <1=> 1 -// <2=> 2 -// <3=> 3 -// <4=> 4 -// <5=> 5 -// <6=> 6 -// <7=> 7 +// <0=> 0 (highest) +// <1=> 1 +// <2=> 2 +// <3=> 3 +// <4=> 4 +// <5=> 5 +// <6=> 6 +// <7=> 7 #ifndef NFCT_CONFIG_IRQ_PRIORITY #define NFCT_CONFIG_IRQ_PRIORITY 7 @@ -7354,88 +7354,88 @@ #define HAL_NFC_CONFIG_LOG_ENABLED 0 #endif // HAL_NFC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef HAL_NFC_CONFIG_LOG_LEVEL #define HAL_NFC_CONFIG_LOG_LEVEL 3 #endif // HAL_NFC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_INFO_COLOR #define HAL_NFC_CONFIG_INFO_COLOR 0 #endif // HAL_NFC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_DEBUG_COLOR #define HAL_NFC_CONFIG_DEBUG_COLOR 0 #endif // HAL_NFC_CONFIG_LOG_LEVEL - Default Severity level - -// <0=> Off -// <1=> Error -// <2=> Warning -// <3=> Info -// <4=> Debug + +// <0=> Off +// <1=> Error +// <2=> Warning +// <3=> Info +// <4=> Debug #ifndef HAL_NFC_CONFIG_LOG_LEVEL #define HAL_NFC_CONFIG_LOG_LEVEL 3 #endif // HAL_NFC_CONFIG_INFO_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_INFO_COLOR #define HAL_NFC_CONFIG_INFO_COLOR 0 #endif // HAL_NFC_CONFIG_DEBUG_COLOR - ANSI escape code prefix. - -// <0=> Default -// <1=> Black -// <2=> Red -// <3=> Green -// <4=> Yellow -// <5=> Blue -// <6=> Magenta -// <7=> Cyan -// <8=> White + +// <0=> Default +// <1=> Black +// <2=> Red +// <3=> Green +// <4=> Yellow +// <5=> Blue +// <6=> Magenta +// <7=> Cyan +// <8=> White #ifndef HAL_NFC_CONFIG_DEBUG_COLOR #define HAL_NFC_CONFIG_DEBUG_COLOR 0 @@ -7449,560 +7449,560 @@ #define HAL_NFC_CONFIG_DEBUG_PIN_ENABLED 0 #endif // HAL_NFC_HCLOCK_ON_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_ON_DEBUG_PIN #define HAL_NFC_HCLOCK_ON_DEBUG_PIN 31 #endif // HAL_NFC_HCLOCK_OFF_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_OFF_DEBUG_PIN #define HAL_NFC_HCLOCK_OFF_DEBUG_PIN 31 #endif // HAL_NFC_NFC_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_NFC_EVENT_DEBUG_PIN #define HAL_NFC_NFC_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_DETECT_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_DETECT_EVENT_DEBUG_PIN #define HAL_NFC_DETECT_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_TIMER4_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_TIMER4_EVENT_DEBUG_PIN #define HAL_NFC_TIMER4_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_HCLOCK_ON_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_ON_DEBUG_PIN #define HAL_NFC_HCLOCK_ON_DEBUG_PIN 31 #endif // HAL_NFC_HCLOCK_OFF_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_HCLOCK_OFF_DEBUG_PIN #define HAL_NFC_HCLOCK_OFF_DEBUG_PIN 31 #endif // HAL_NFC_NFC_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_NFC_EVENT_DEBUG_PIN #define HAL_NFC_NFC_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_DETECT_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_DETECT_EVENT_DEBUG_PIN #define HAL_NFC_DETECT_EVENT_DEBUG_PIN 31 #endif // HAL_NFC_TIMER4_EVENT_DEBUG_PIN - Pin number - -// <0=> 0 (P0.0) -// <1=> 1 (P0.1) -// <2=> 2 (P0.2) -// <3=> 3 (P0.3) -// <4=> 4 (P0.4) -// <5=> 5 (P0.5) -// <6=> 6 (P0.6) -// <7=> 7 (P0.7) -// <8=> 8 (P0.8) -// <9=> 9 (P0.9) -// <10=> 10 (P0.10) -// <11=> 11 (P0.11) -// <12=> 12 (P0.12) -// <13=> 13 (P0.13) -// <14=> 14 (P0.14) -// <15=> 15 (P0.15) -// <16=> 16 (P0.16) -// <17=> 17 (P0.17) -// <18=> 18 (P0.18) -// <19=> 19 (P0.19) -// <20=> 20 (P0.20) -// <21=> 21 (P0.21) -// <22=> 22 (P0.22) -// <23=> 23 (P0.23) -// <24=> 24 (P0.24) -// <25=> 25 (P0.25) -// <26=> 26 (P0.26) -// <27=> 27 (P0.27) -// <28=> 28 (P0.28) -// <29=> 29 (P0.29) -// <30=> 30 (P0.30) -// <31=> 31 (P0.31) -// <32=> 32 (P1.0) -// <33=> 33 (P1.1) -// <34=> 34 (P1.2) -// <35=> 35 (P1.3) -// <36=> 36 (P1.4) -// <37=> 37 (P1.5) -// <38=> 38 (P1.6) -// <39=> 39 (P1.7) -// <40=> 40 (P1.8) -// <41=> 41 (P1.9) -// <42=> 42 (P1.10) -// <43=> 43 (P1.11) -// <44=> 44 (P1.12) -// <45=> 45 (P1.13) -// <46=> 46 (P1.14) -// <47=> 47 (P1.15) -// <4294967295=> Not connected + +// <0=> 0 (P0.0) +// <1=> 1 (P0.1) +// <2=> 2 (P0.2) +// <3=> 3 (P0.3) +// <4=> 4 (P0.4) +// <5=> 5 (P0.5) +// <6=> 6 (P0.6) +// <7=> 7 (P0.7) +// <8=> 8 (P0.8) +// <9=> 9 (P0.9) +// <10=> 10 (P0.10) +// <11=> 11 (P0.11) +// <12=> 12 (P0.12) +// <13=> 13 (P0.13) +// <14=> 14 (P0.14) +// <15=> 15 (P0.15) +// <16=> 16 (P0.16) +// <17=> 17 (P0.17) +// <18=> 18 (P0.18) +// <19=> 19 (P0.19) +// <20=> 20 (P0.20) +// <21=> 21 (P0.21) +// <22=> 22 (P0.22) +// <23=> 23 (P0.23) +// <24=> 24 (P0.24) +// <25=> 25 (P0.25) +// <26=> 26 (P0.26) +// <27=> 27 (P0.27) +// <28=> 28 (P0.28) +// <29=> 29 (P0.29) +// <30=> 30 (P0.30) +// <31=> 31 (P0.31) +// <32=> 32 (P1.0) +// <33=> 33 (P1.1) +// <34=> 34 (P1.2) +// <35=> 35 (P1.3) +// <36=> 36 (P1.4) +// <37=> 37 (P1.5) +// <38=> 38 (P1.6) +// <39=> 39 (P1.7) +// <40=> 40 (P1.8) +// <41=> 41 (P1.9) +// <42=> 42 (P1.10) +// <43=> 43 (P1.11) +// <44=> 44 (P1.12) +// <45=> 45 (P1.13) +// <46=> 46 (P1.14) +// <47=> 47 (P1.15) +// <4294967295=> Not connected #ifndef HAL_NFC_TIMER4_EVENT_DEBUG_PIN #define HAL_NFC_TIMER4_EVENT_DEBUG_PIN 31 @@ -8012,16 +8012,16 @@ // -// +// //========================================================== -// nRF_Segger_RTT +// nRF_Segger_RTT //========================================================== // segger_rtt - SEGGER RTT //========================================================== -// SEGGER_RTT_CONFIG_BUFFER_SIZE_UP - Size of upstream buffer. +// SEGGER_RTT_CONFIG_BUFFER_SIZE_UP - Size of upstream buffer. // Note that either @ref NRF_LOG_BACKEND_RTT_OUTPUT_BUFFER_SIZE // or this value is actually used. It depends on which one is bigger. @@ -8029,43 +8029,43 @@ #define SEGGER_RTT_CONFIG_BUFFER_SIZE_UP 512 #endif -// SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS - Size of upstream buffer. +// SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS - Size of upstream buffer. #ifndef SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS #define SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS 2 #endif -// SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN - Size of upstream buffer. +// SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN - Size of upstream buffer. #ifndef SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN #define SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN 16 #endif -// SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS - Size of upstream buffer. +// SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS - Size of upstream buffer. #ifndef SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS #define SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS 2 #endif // SEGGER_RTT_CONFIG_DEFAULT_MODE - RTT behavior if the buffer is full. - + // The following modes are supported: // - SKIP - Do not block, output nothing. // - TRIM - Do not block, output as much as fits. // - BLOCK - Wait until there is space in the buffer. -// <0=> SKIP -// <1=> TRIM -// <2=> BLOCK_IF_FIFO_FULL +// <0=> SKIP +// <1=> TRIM +// <2=> BLOCK_IF_FIFO_FULL #ifndef SEGGER_RTT_CONFIG_DEFAULT_MODE #define SEGGER_RTT_CONFIG_DEFAULT_MODE 0 #endif -// +// //========================================================== -// +// //========================================================== -// nRF_SoftDevice +// nRF_SoftDevice //========================================================== // NRF_SDH_ANT_ENABLED - nrf_sdh_ant - SoftDevice ANT event handler @@ -8073,42 +8073,42 @@ #ifndef NRF_SDH_ANT_ENABLED #define NRF_SDH_ANT_ENABLED 0 #endif -// ANT Channels +// ANT Channels //========================================================== -// NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED - Allocated ANT channels. +// NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED - Allocated ANT channels. #ifndef NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED #define NRF_SDH_ANT_TOTAL_CHANNELS_ALLOCATED 0 #endif -// NRF_SDH_ANT_ENCRYPTED_CHANNELS - Encrypted ANT channels. +// NRF_SDH_ANT_ENCRYPTED_CHANNELS - Encrypted ANT channels. #ifndef NRF_SDH_ANT_ENCRYPTED_CHANNELS #define NRF_SDH_ANT_ENCRYPTED_CHANNELS 0 #endif -// +// //========================================================== -// ANT Queues +// ANT Queues //========================================================== -// NRF_SDH_ANT_EVENT_QUEUE_SIZE - Event queue size. +// NRF_SDH_ANT_EVENT_QUEUE_SIZE - Event queue size. #ifndef NRF_SDH_ANT_EVENT_QUEUE_SIZE #define NRF_SDH_ANT_EVENT_QUEUE_SIZE 32 #endif -// NRF_SDH_ANT_BURST_QUEUE_SIZE - ANT burst queue size. +// NRF_SDH_ANT_BURST_QUEUE_SIZE - ANT burst queue size. #ifndef NRF_SDH_ANT_BURST_QUEUE_SIZE #define NRF_SDH_ANT_BURST_QUEUE_SIZE 128 #endif -// +// //========================================================== // ANT Observers - Observers and priority levels //========================================================== -// NRF_SDH_ANT_OBSERVER_PRIO_LEVELS - Total number of priority levels for ANT observers. +// NRF_SDH_ANT_OBSERVER_PRIO_LEVELS - Total number of priority levels for ANT observers. // This setting configures the number of priority levels available for the ANT event handlers. // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8119,59 +8119,59 @@ // ANT Observers priorities - Invididual priorities //========================================================== -// ANT_BPWR_ANT_OBSERVER_PRIO +// ANT_BPWR_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Bicycle Power Profile. #ifndef ANT_BPWR_ANT_OBSERVER_PRIO #define ANT_BPWR_ANT_OBSERVER_PRIO 1 #endif -// ANT_BSC_ANT_OBSERVER_PRIO +// ANT_BSC_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Bicycle Speed and Cadence Profile. #ifndef ANT_BSC_ANT_OBSERVER_PRIO #define ANT_BSC_ANT_OBSERVER_PRIO 1 #endif -// ANT_ENCRYPT_ANT_OBSERVER_PRIO +// ANT_ENCRYPT_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Cryptographic ANT stack configuration module. #ifndef ANT_ENCRYPT_ANT_OBSERVER_PRIO #define ANT_ENCRYPT_ANT_OBSERVER_PRIO 1 #endif -// ANT_HRM_ANT_OBSERVER_PRIO +// ANT_HRM_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Heart Rate Monitor. #ifndef ANT_HRM_ANT_OBSERVER_PRIO #define ANT_HRM_ANT_OBSERVER_PRIO 1 #endif -// ANT_SDM_ANT_OBSERVER_PRIO +// ANT_SDM_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Stride Based Speed and Distance Monitor Profile. #ifndef ANT_SDM_ANT_OBSERVER_PRIO #define ANT_SDM_ANT_OBSERVER_PRIO 1 #endif -// ANT_STATE_INDICATOR_ANT_OBSERVER_PRIO +// ANT_STATE_INDICATOR_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the ANT state indicator module. #ifndef ANT_STATE_INDICATOR_ANT_OBSERVER_PRIO #define ANT_STATE_INDICATOR_ANT_OBSERVER_PRIO 1 #endif -// BSP_BTN_ANT_OBSERVER_PRIO +// BSP_BTN_ANT_OBSERVER_PRIO // Priority with which ANT events are dispatched to the Button Control module. #ifndef BSP_BTN_ANT_OBSERVER_PRIO #define BSP_BTN_ANT_OBSERVER_PRIO 1 #endif -// +// //========================================================== -// +// //========================================================== @@ -8187,55 +8187,55 @@ // These values are not used directly by the SoftDevice handler but the application or other libraries might depend on them. // Keep them up-to-date with the desired configuration. //========================================================== -// NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. +// NRF_SDH_BLE_PERIPHERAL_LINK_COUNT - Maximum number of peripheral links. #ifndef NRF_SDH_BLE_PERIPHERAL_LINK_COUNT #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 0 #endif -// NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. +// NRF_SDH_BLE_CENTRAL_LINK_COUNT - Maximum number of central links. #ifndef NRF_SDH_BLE_CENTRAL_LINK_COUNT #define NRF_SDH_BLE_CENTRAL_LINK_COUNT 0 #endif -// NRF_SDH_BLE_TOTAL_LINK_COUNT - Maximum number of total concurrent connections using the default configuration. +// NRF_SDH_BLE_TOTAL_LINK_COUNT - Maximum number of total concurrent connections using the default configuration. #ifndef NRF_SDH_BLE_TOTAL_LINK_COUNT #define NRF_SDH_BLE_TOTAL_LINK_COUNT 1 #endif -// NRF_SDH_BLE_GAP_EVENT_LENGTH - The time set aside for this connection on every connection interval in 1.25 ms units. +// NRF_SDH_BLE_GAP_EVENT_LENGTH - The time set aside for this connection on every connection interval in 1.25 ms units. #ifndef NRF_SDH_BLE_GAP_EVENT_LENGTH #define NRF_SDH_BLE_GAP_EVENT_LENGTH 3 #endif -// NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. +// NRF_SDH_BLE_GATT_MAX_MTU_SIZE - Static maximum MTU size. #ifndef NRF_SDH_BLE_GATT_MAX_MTU_SIZE #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 23 #endif -// NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE - Attribute Table size in bytes. The size must be a multiple of 4. +// NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE - Attribute Table size in bytes. The size must be a multiple of 4. #ifndef NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE #define NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE 1408 #endif -// NRF_SDH_BLE_VS_UUID_COUNT - The number of vendor-specific UUIDs. +// NRF_SDH_BLE_VS_UUID_COUNT - The number of vendor-specific UUIDs. #ifndef NRF_SDH_BLE_VS_UUID_COUNT #define NRF_SDH_BLE_VS_UUID_COUNT 0 #endif // NRF_SDH_BLE_SERVICE_CHANGED - Include the Service Changed characteristic in the Attribute Table. - + #ifndef NRF_SDH_BLE_SERVICE_CHANGED #define NRF_SDH_BLE_SERVICE_CHANGED 0 #endif -// +// //========================================================== // BLE Observers - Observers and priority levels //========================================================== -// NRF_SDH_BLE_OBSERVER_PRIO_LEVELS - Total number of priority levels for BLE observers. +// NRF_SDH_BLE_OBSERVER_PRIO_LEVELS - Total number of priority levels for BLE observers. // This setting configures the number of priority levels available for BLE event handlers. // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8246,276 +8246,276 @@ // BLE Observers priorities - Invididual priorities //========================================================== -// BLE_ADV_BLE_OBSERVER_PRIO +// BLE_ADV_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Advertising module. #ifndef BLE_ADV_BLE_OBSERVER_PRIO #define BLE_ADV_BLE_OBSERVER_PRIO 2 #endif -// BLE_ANCS_C_BLE_OBSERVER_PRIO +// BLE_ANCS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Apple Notification Service Client. #ifndef BLE_ANCS_C_BLE_OBSERVER_PRIO #define BLE_ANCS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_ANS_C_BLE_OBSERVER_PRIO +// BLE_ANS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Alert Notification Service Client. #ifndef BLE_ANS_C_BLE_OBSERVER_PRIO #define BLE_ANS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_BAS_BLE_OBSERVER_PRIO +// BLE_BAS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Battery Service. #ifndef BLE_BAS_BLE_OBSERVER_PRIO #define BLE_BAS_BLE_OBSERVER_PRIO 2 #endif -// BLE_BAS_C_BLE_OBSERVER_PRIO +// BLE_BAS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Battery Service Client. #ifndef BLE_BAS_C_BLE_OBSERVER_PRIO #define BLE_BAS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_BPS_BLE_OBSERVER_PRIO +// BLE_BPS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Blood Pressure Service. #ifndef BLE_BPS_BLE_OBSERVER_PRIO #define BLE_BPS_BLE_OBSERVER_PRIO 2 #endif -// BLE_CONN_PARAMS_BLE_OBSERVER_PRIO +// BLE_CONN_PARAMS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Connection parameters module. #ifndef BLE_CONN_PARAMS_BLE_OBSERVER_PRIO #define BLE_CONN_PARAMS_BLE_OBSERVER_PRIO 2 #endif -// BLE_CONN_STATE_BLE_OBSERVER_PRIO +// BLE_CONN_STATE_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Connection State module. #ifndef BLE_CONN_STATE_BLE_OBSERVER_PRIO #define BLE_CONN_STATE_BLE_OBSERVER_PRIO 0 #endif -// BLE_CSCS_BLE_OBSERVER_PRIO +// BLE_CSCS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Cycling Speed and Cadence Service. #ifndef BLE_CSCS_BLE_OBSERVER_PRIO #define BLE_CSCS_BLE_OBSERVER_PRIO 2 #endif -// BLE_CTS_C_BLE_OBSERVER_PRIO +// BLE_CTS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Current Time Service Client. #ifndef BLE_CTS_C_BLE_OBSERVER_PRIO #define BLE_CTS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_DB_DISC_BLE_OBSERVER_PRIO +// BLE_DB_DISC_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Database Discovery module. #ifndef BLE_DB_DISC_BLE_OBSERVER_PRIO #define BLE_DB_DISC_BLE_OBSERVER_PRIO 1 #endif -// BLE_DFU_BLE_OBSERVER_PRIO +// BLE_DFU_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the DFU Service. #ifndef BLE_DFU_BLE_OBSERVER_PRIO #define BLE_DFU_BLE_OBSERVER_PRIO 2 #endif -// BLE_GLS_BLE_OBSERVER_PRIO +// BLE_GLS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Glucose Service. #ifndef BLE_GLS_BLE_OBSERVER_PRIO #define BLE_GLS_BLE_OBSERVER_PRIO 2 #endif -// BLE_HIDS_BLE_OBSERVER_PRIO +// BLE_HIDS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Human Interface Device Service. #ifndef BLE_HIDS_BLE_OBSERVER_PRIO #define BLE_HIDS_BLE_OBSERVER_PRIO 2 #endif -// BLE_HRS_BLE_OBSERVER_PRIO +// BLE_HRS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Heart Rate Service. #ifndef BLE_HRS_BLE_OBSERVER_PRIO #define BLE_HRS_BLE_OBSERVER_PRIO 2 #endif -// BLE_HRS_C_BLE_OBSERVER_PRIO +// BLE_HRS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Heart Rate Service Client. #ifndef BLE_HRS_C_BLE_OBSERVER_PRIO #define BLE_HRS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_HTS_BLE_OBSERVER_PRIO +// BLE_HTS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Health Thermometer Service. #ifndef BLE_HTS_BLE_OBSERVER_PRIO #define BLE_HTS_BLE_OBSERVER_PRIO 2 #endif -// BLE_IAS_BLE_OBSERVER_PRIO +// BLE_IAS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Immediate Alert Service. #ifndef BLE_IAS_BLE_OBSERVER_PRIO #define BLE_IAS_BLE_OBSERVER_PRIO 2 #endif -// BLE_IAS_C_BLE_OBSERVER_PRIO +// BLE_IAS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Immediate Alert Service Client. #ifndef BLE_IAS_C_BLE_OBSERVER_PRIO #define BLE_IAS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_LBS_BLE_OBSERVER_PRIO +// BLE_LBS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the LED Button Service. #ifndef BLE_LBS_BLE_OBSERVER_PRIO #define BLE_LBS_BLE_OBSERVER_PRIO 2 #endif -// BLE_LBS_C_BLE_OBSERVER_PRIO +// BLE_LBS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the LED Button Service Client. #ifndef BLE_LBS_C_BLE_OBSERVER_PRIO #define BLE_LBS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_LLS_BLE_OBSERVER_PRIO +// BLE_LLS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Link Loss Service. #ifndef BLE_LLS_BLE_OBSERVER_PRIO #define BLE_LLS_BLE_OBSERVER_PRIO 2 #endif -// BLE_LNS_BLE_OBSERVER_PRIO +// BLE_LNS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Location Navigation Service. #ifndef BLE_LNS_BLE_OBSERVER_PRIO #define BLE_LNS_BLE_OBSERVER_PRIO 2 #endif -// BLE_NUS_BLE_OBSERVER_PRIO +// BLE_NUS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the UART Service. #ifndef BLE_NUS_BLE_OBSERVER_PRIO #define BLE_NUS_BLE_OBSERVER_PRIO 2 #endif -// BLE_NUS_C_BLE_OBSERVER_PRIO +// BLE_NUS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the UART Central Service. #ifndef BLE_NUS_C_BLE_OBSERVER_PRIO #define BLE_NUS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_OTS_BLE_OBSERVER_PRIO +// BLE_OTS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Object transfer service. #ifndef BLE_OTS_BLE_OBSERVER_PRIO #define BLE_OTS_BLE_OBSERVER_PRIO 2 #endif -// BLE_OTS_C_BLE_OBSERVER_PRIO +// BLE_OTS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Object transfer service client. #ifndef BLE_OTS_C_BLE_OBSERVER_PRIO #define BLE_OTS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_RSCS_BLE_OBSERVER_PRIO +// BLE_RSCS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Running Speed and Cadence Service. #ifndef BLE_RSCS_BLE_OBSERVER_PRIO #define BLE_RSCS_BLE_OBSERVER_PRIO 2 #endif -// BLE_RSCS_C_BLE_OBSERVER_PRIO +// BLE_RSCS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Running Speed and Cadence Client. #ifndef BLE_RSCS_C_BLE_OBSERVER_PRIO #define BLE_RSCS_C_BLE_OBSERVER_PRIO 2 #endif -// BLE_TPS_BLE_OBSERVER_PRIO +// BLE_TPS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the TX Power Service. #ifndef BLE_TPS_BLE_OBSERVER_PRIO #define BLE_TPS_BLE_OBSERVER_PRIO 2 #endif -// BSP_BTN_BLE_OBSERVER_PRIO +// BSP_BTN_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Button Control module. #ifndef BSP_BTN_BLE_OBSERVER_PRIO #define BSP_BTN_BLE_OBSERVER_PRIO 1 #endif -// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO +// NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the NFC pairing library. #ifndef NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO #define NFC_BLE_PAIR_LIB_BLE_OBSERVER_PRIO 1 #endif -// NRF_BLE_BMS_BLE_OBSERVER_PRIO +// NRF_BLE_BMS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Bond Management Service. #ifndef NRF_BLE_BMS_BLE_OBSERVER_PRIO #define NRF_BLE_BMS_BLE_OBSERVER_PRIO 2 #endif -// NRF_BLE_CGMS_BLE_OBSERVER_PRIO +// NRF_BLE_CGMS_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Contiuon Glucose Monitoring Service. #ifndef NRF_BLE_CGMS_BLE_OBSERVER_PRIO #define NRF_BLE_CGMS_BLE_OBSERVER_PRIO 2 #endif -// NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO +// NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the GATT Service Client. #ifndef NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO #define NRF_BLE_GATTS_C_BLE_OBSERVER_PRIO 2 #endif -// NRF_BLE_GATT_BLE_OBSERVER_PRIO +// NRF_BLE_GATT_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the GATT module. #ifndef NRF_BLE_GATT_BLE_OBSERVER_PRIO #define NRF_BLE_GATT_BLE_OBSERVER_PRIO 2 #endif -// NRF_BLE_QWR_BLE_OBSERVER_PRIO +// NRF_BLE_QWR_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Queued writes module. #ifndef NRF_BLE_QWR_BLE_OBSERVER_PRIO #define NRF_BLE_QWR_BLE_OBSERVER_PRIO 2 #endif -// PM_BLE_OBSERVER_PRIO +// PM_BLE_OBSERVER_PRIO // Priority with which BLE events are dispatched to the Peer Manager module. #ifndef PM_BLE_OBSERVER_PRIO #define PM_BLE_OBSERVER_PRIO 2 #endif -// +// //========================================================== -// +// //========================================================== @@ -8526,46 +8526,46 @@ #ifndef NRF_SDH_ENABLED #define NRF_SDH_ENABLED 1 #endif -// Dispatch model +// Dispatch model // This setting configures how Stack events are dispatched to the application. //========================================================== // NRF_SDH_DISPATCH_MODEL - + // NRF_SDH_DISPATCH_MODEL_INTERRUPT: SoftDevice events are passed to the application from the interrupt context. // NRF_SDH_DISPATCH_MODEL_APPSH: SoftDevice events are scheduled using @ref app_scheduler. // NRF_SDH_DISPATCH_MODEL_POLLING: SoftDevice events are to be fetched manually. -// <0=> NRF_SDH_DISPATCH_MODEL_INTERRUPT -// <1=> NRF_SDH_DISPATCH_MODEL_APPSH -// <2=> NRF_SDH_DISPATCH_MODEL_POLLING +// <0=> NRF_SDH_DISPATCH_MODEL_INTERRUPT +// <1=> NRF_SDH_DISPATCH_MODEL_APPSH +// <2=> NRF_SDH_DISPATCH_MODEL_POLLING #ifndef NRF_SDH_DISPATCH_MODEL #define NRF_SDH_DISPATCH_MODEL 0 #endif -// +// //========================================================== // Clock - SoftDevice clock configuration //========================================================== // NRF_SDH_CLOCK_LF_SRC - SoftDevice clock source. - -// <0=> NRF_CLOCK_LF_SRC_RC -// <1=> NRF_CLOCK_LF_SRC_XTAL -// <2=> NRF_CLOCK_LF_SRC_SYNTH + +// <0=> NRF_CLOCK_LF_SRC_RC +// <1=> NRF_CLOCK_LF_SRC_XTAL +// <2=> NRF_CLOCK_LF_SRC_SYNTH #ifndef NRF_SDH_CLOCK_LF_SRC #define NRF_SDH_CLOCK_LF_SRC 1 #endif -// NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. +// NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. #ifndef NRF_SDH_CLOCK_LF_RC_CTIV #define NRF_SDH_CLOCK_LF_RC_CTIV 0 #endif -// NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. +// NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. // How often (in number of calibration intervals) the RC oscillator shall be calibrated // if the temperature has not changed. @@ -8574,27 +8574,27 @@ #endif // NRF_SDH_CLOCK_LF_XTAL_ACCURACY - External crystal clock accuracy used in the LL to compute timing windows. - -// <0=> NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM -// <1=> NRF_CLOCK_LF_XTAL_ACCURACY_500_PPM -// <2=> NRF_CLOCK_LF_XTAL_ACCURACY_150_PPM -// <3=> NRF_CLOCK_LF_XTAL_ACCURACY_100_PPM -// <4=> NRF_CLOCK_LF_XTAL_ACCURACY_75_PPM -// <5=> NRF_CLOCK_LF_XTAL_ACCURACY_50_PPM -// <6=> NRF_CLOCK_LF_XTAL_ACCURACY_30_PPM -// <7=> NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM + +// <0=> NRF_CLOCK_LF_XTAL_ACCURACY_250_PPM +// <1=> NRF_CLOCK_LF_XTAL_ACCURACY_500_PPM +// <2=> NRF_CLOCK_LF_XTAL_ACCURACY_150_PPM +// <3=> NRF_CLOCK_LF_XTAL_ACCURACY_100_PPM +// <4=> NRF_CLOCK_LF_XTAL_ACCURACY_75_PPM +// <5=> NRF_CLOCK_LF_XTAL_ACCURACY_50_PPM +// <6=> NRF_CLOCK_LF_XTAL_ACCURACY_30_PPM +// <7=> NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM #ifndef NRF_SDH_CLOCK_LF_XTAL_ACCURACY #define NRF_SDH_CLOCK_LF_XTAL_ACCURACY 7 #endif -// +// //========================================================== // SDH Observers - Observers and priority levels //========================================================== -// NRF_SDH_REQ_OBSERVER_PRIO_LEVELS - Total number of priority levels for request observers. +// NRF_SDH_REQ_OBSERVER_PRIO_LEVELS - Total number of priority levels for request observers. // This setting configures the number of priority levels available for the SoftDevice request event handlers. // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8602,7 +8602,7 @@ #define NRF_SDH_REQ_OBSERVER_PRIO_LEVELS 2 #endif -// NRF_SDH_STATE_OBSERVER_PRIO_LEVELS - Total number of priority levels for state observers. +// NRF_SDH_STATE_OBSERVER_PRIO_LEVELS - Total number of priority levels for state observers. // This setting configures the number of priority levels available for the SoftDevice state event handlers. // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8610,7 +8610,7 @@ #define NRF_SDH_STATE_OBSERVER_PRIO_LEVELS 2 #endif -// NRF_SDH_STACK_OBSERVER_PRIO_LEVELS - Total number of priority levels for stack event observers. +// NRF_SDH_STACK_OBSERVER_PRIO_LEVELS - Total number of priority levels for stack event observers. // This setting configures the number of priority levels available for the SoftDevice stack event handlers (ANT, BLE, SoC). // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8622,34 +8622,34 @@ // State Observers priorities - Invididual priorities //========================================================== -// CLOCK_CONFIG_STATE_OBSERVER_PRIO +// CLOCK_CONFIG_STATE_OBSERVER_PRIO // Priority with which state events are dispatched to the Clock driver. #ifndef CLOCK_CONFIG_STATE_OBSERVER_PRIO #define CLOCK_CONFIG_STATE_OBSERVER_PRIO 0 #endif -// POWER_CONFIG_STATE_OBSERVER_PRIO +// POWER_CONFIG_STATE_OBSERVER_PRIO // Priority with which state events are dispatched to the Power driver. #ifndef POWER_CONFIG_STATE_OBSERVER_PRIO #define POWER_CONFIG_STATE_OBSERVER_PRIO 0 #endif -// RNG_CONFIG_STATE_OBSERVER_PRIO +// RNG_CONFIG_STATE_OBSERVER_PRIO // Priority with which state events are dispatched to this module. #ifndef RNG_CONFIG_STATE_OBSERVER_PRIO #define RNG_CONFIG_STATE_OBSERVER_PRIO 0 #endif -// +// //========================================================== // Stack Event Observers priorities - Invididual priorities //========================================================== -// NRF_SDH_ANT_STACK_OBSERVER_PRIO +// NRF_SDH_ANT_STACK_OBSERVER_PRIO // This setting configures the priority with which ANT events are processed with respect to other events coming from the stack. // Modify this setting if you need to have ANT events dispatched before or after other stack events, such as BLE or SoC. // Zero is the highest priority. @@ -8658,7 +8658,7 @@ #define NRF_SDH_ANT_STACK_OBSERVER_PRIO 0 #endif -// NRF_SDH_BLE_STACK_OBSERVER_PRIO +// NRF_SDH_BLE_STACK_OBSERVER_PRIO // This setting configures the priority with which BLE events are processed with respect to other events coming from the stack. // Modify this setting if you need to have BLE events dispatched before or after other stack events, such as ANT or SoC. // Zero is the highest priority. @@ -8667,7 +8667,7 @@ #define NRF_SDH_BLE_STACK_OBSERVER_PRIO 0 #endif -// NRF_SDH_SOC_STACK_OBSERVER_PRIO +// NRF_SDH_SOC_STACK_OBSERVER_PRIO // This setting configures the priority with which SoC events are processed with respect to other events coming from the stack. // Modify this setting if you need to have SoC events dispatched before or after other stack events, such as ANT or BLE. // Zero is the highest priority. @@ -8676,10 +8676,10 @@ #define NRF_SDH_SOC_STACK_OBSERVER_PRIO 0 #endif -// +// //========================================================== -// +// //========================================================== @@ -8693,7 +8693,7 @@ // SoC Observers - Observers and priority levels //========================================================== -// NRF_SDH_SOC_OBSERVER_PRIO_LEVELS - Total number of priority levels for SoC observers. +// NRF_SDH_SOC_OBSERVER_PRIO_LEVELS - Total number of priority levels for SoC observers. // This setting configures the number of priority levels available for the SoC event handlers. // The priority level of a handler determines the order in which it receives events, with respect to other handlers. @@ -8704,44 +8704,44 @@ // SoC Observers priorities - Invididual priorities //========================================================== -// BLE_ADV_SOC_OBSERVER_PRIO +// BLE_ADV_SOC_OBSERVER_PRIO // Priority with which SoC events are dispatched to the Advertising module. #ifndef BLE_ADV_SOC_OBSERVER_PRIO #define BLE_ADV_SOC_OBSERVER_PRIO 1 #endif -// BLE_DFU_SOC_OBSERVER_PRIO +// BLE_DFU_SOC_OBSERVER_PRIO // Priority with which BLE events are dispatched to the DFU Service. #ifndef BLE_DFU_SOC_OBSERVER_PRIO #define BLE_DFU_SOC_OBSERVER_PRIO 1 #endif -// CLOCK_CONFIG_SOC_OBSERVER_PRIO +// CLOCK_CONFIG_SOC_OBSERVER_PRIO // Priority with which SoC events are dispatched to the Clock driver. #ifndef CLOCK_CONFIG_SOC_OBSERVER_PRIO #define CLOCK_CONFIG_SOC_OBSERVER_PRIO 0 #endif -// POWER_CONFIG_SOC_OBSERVER_PRIO +// POWER_CONFIG_SOC_OBSERVER_PRIO // Priority with which SoC events are dispatched to the Power driver. #ifndef POWER_CONFIG_SOC_OBSERVER_PRIO #define POWER_CONFIG_SOC_OBSERVER_PRIO 0 #endif -// +// //========================================================== -// +// //========================================================== // -// +// //========================================================== // <<< end of configuration section >>> diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct index 8aaa8a42bac..5c61eecdfcb 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_ARM_STD/nRF52840.sct @@ -30,7 +30,7 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { .ANY (+RO) } RW_IRAM0 MBED_RAM0_START UNINIT MBED_RAM0_SIZE { ;no init section - *(*noinit) + *(*nvictable) } RW_IRAM1 MBED_RAM1_START MBED_RAM1_SIZE { .ANY (+RW +ZI) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf index 95819fe1df3..522e1f5a33b 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/device/TOOLCHAIN_IAR/nRF52840.icf @@ -54,8 +54,11 @@ define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; initialize by copy { readwrite }; +do not initialize { section .nvictable }; +place at address mem:__ICFEDIT_region_RAM_NVIC_start__ { section .nvictable }; + do not initialize { section .noinit }; -place at address mem:__ICFEDIT_region_RAM_NVIC_start__ { section .noinit }; +place in RAM_region { section .noinit }; keep { section .intvec }; place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/mbed_lib.json b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/mbed_lib.json index d8b12f59b58..22e54bacbaf 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/mbed_lib.json +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/mbed_lib.json @@ -18,23 +18,25 @@ "value": 8 } }, + "macros": [ + "SWI_DISABLE0" + ], "target_overrides": { "DELTA_DFBM_NQ620": { "target.macros_add": [ - "CONFIG_GPIO_AS_PINRESET", - "SWI_DISABLE0", - "NRF52_PAN_12", - "NRF52_PAN_15", - "NRF52_PAN_20", - "NRF52_PAN_30", - "NRF52_PAN_31", - "NRF52_PAN_36", - "NRF52_PAN_51", - "NRF52_PAN_53", - "NRF52_PAN_54", - "NRF52_PAN_55", - "NRF52_PAN_58", - "NRF52_PAN_62", + "CONFIG_GPIO_AS_PINRESET", + "NRF52_PAN_12", + "NRF52_PAN_15", + "NRF52_PAN_20", + "NRF52_PAN_30", + "NRF52_PAN_31", + "NRF52_PAN_36", + "NRF52_PAN_51", + "NRF52_PAN_53", + "NRF52_PAN_54", + "NRF52_PAN_55", + "NRF52_PAN_58", + "NRF52_PAN_62", "NRF52_PAN_63", "NRF52_PAN_64" ], @@ -44,20 +46,19 @@ }, "MTB_LAIRD_BL652": { "target.macros_add": [ - "CONFIG_GPIO_AS_PINRESET", - "SWI_DISABLE0", - "NRF52_PAN_12", - "NRF52_PAN_15", - "NRF52_PAN_20", - "NRF52_PAN_30", - "NRF52_PAN_31", - "NRF52_PAN_36", - "NRF52_PAN_51", - "NRF52_PAN_53", - "NRF52_PAN_54", - "NRF52_PAN_55", - "NRF52_PAN_58", - "NRF52_PAN_62", + "CONFIG_GPIO_AS_PINRESET", + "NRF52_PAN_12", + "NRF52_PAN_15", + "NRF52_PAN_20", + "NRF52_PAN_30", + "NRF52_PAN_31", + "NRF52_PAN_36", + "NRF52_PAN_51", + "NRF52_PAN_53", + "NRF52_PAN_54", + "NRF52_PAN_55", + "NRF52_PAN_58", + "NRF52_PAN_62", "NRF52_PAN_63", "NRF52_PAN_64" ], @@ -66,40 +67,38 @@ }, "MTB_UBLOX_NINA_B1": { "target.macros_add": [ - "CONFIG_GPIO_AS_PINRESET", - "SWI_DISABLE0", - "NRF52_PAN_12", - "NRF52_PAN_15", - "NRF52_PAN_20", - "NRF52_PAN_30", - "NRF52_PAN_31", - "NRF52_PAN_36", - "NRF52_PAN_51", - "NRF52_PAN_53", - "NRF52_PAN_54", - "NRF52_PAN_55", - "NRF52_PAN_58", - "NRF52_PAN_62", + "CONFIG_GPIO_AS_PINRESET", + "NRF52_PAN_12", + "NRF52_PAN_15", + "NRF52_PAN_20", + "NRF52_PAN_30", + "NRF52_PAN_31", + "NRF52_PAN_36", + "NRF52_PAN_51", + "NRF52_PAN_53", + "NRF52_PAN_54", + "NRF52_PAN_55", + "NRF52_PAN_58", + "NRF52_PAN_62", "NRF52_PAN_63", "NRF52_PAN_64" ] }, "NRF52_DK": { "target.macros_add": [ - "CONFIG_GPIO_AS_PINRESET", - "SWI_DISABLE0", - "NRF52_PAN_12", - "NRF52_PAN_15", - "NRF52_PAN_20", - "NRF52_PAN_30", - "NRF52_PAN_31", - "NRF52_PAN_36", - "NRF52_PAN_51", - "NRF52_PAN_53", - "NRF52_PAN_54", - "NRF52_PAN_55", - "NRF52_PAN_58", - "NRF52_PAN_62", + "CONFIG_GPIO_AS_PINRESET", + "NRF52_PAN_12", + "NRF52_PAN_15", + "NRF52_PAN_20", + "NRF52_PAN_30", + "NRF52_PAN_31", + "NRF52_PAN_36", + "NRF52_PAN_51", + "NRF52_PAN_53", + "NRF52_PAN_54", + "NRF52_PAN_55", + "NRF52_PAN_58", + "NRF52_PAN_62", "NRF52_PAN_63", "NRF52_PAN_64" ], @@ -107,60 +106,57 @@ }, "RBLAB_BLENANO2": { "target.macros_add": [ - "CONFIG_GPIO_AS_PINRESET", - "SWI_DISABLE0", - "NRF52_PAN_12", - "NRF52_PAN_15", - "NRF52_PAN_20", - "NRF52_PAN_30", - "NRF52_PAN_31", - "NRF52_PAN_36", - "NRF52_PAN_51", - "NRF52_PAN_53", - "NRF52_PAN_54", - "NRF52_PAN_55", - "NRF52_PAN_58", - "NRF52_PAN_62", + "CONFIG_GPIO_AS_PINRESET", + "NRF52_PAN_12", + "NRF52_PAN_15", + "NRF52_PAN_20", + "NRF52_PAN_30", + "NRF52_PAN_31", + "NRF52_PAN_36", + "NRF52_PAN_51", + "NRF52_PAN_53", + "NRF52_PAN_54", + "NRF52_PAN_55", + "NRF52_PAN_58", + "NRF52_PAN_62", "NRF52_PAN_63", "NRF52_PAN_64" ] }, "UBLOX_EVA_NINA": { "target.macros_add": [ - "CONFIG_GPIO_AS_PINRESET", - "SWI_DISABLE0", - "NRF52_PAN_12", - "NRF52_PAN_15", - "NRF52_PAN_20", - "NRF52_PAN_30", - "NRF52_PAN_31", - "NRF52_PAN_36", - "NRF52_PAN_51", - "NRF52_PAN_53", - "NRF52_PAN_54", - "NRF52_PAN_55", - "NRF52_PAN_58", - "NRF52_PAN_62", + "CONFIG_GPIO_AS_PINRESET", + "NRF52_PAN_12", + "NRF52_PAN_15", + "NRF52_PAN_20", + "NRF52_PAN_30", + "NRF52_PAN_31", + "NRF52_PAN_36", + "NRF52_PAN_51", + "NRF52_PAN_53", + "NRF52_PAN_54", + "NRF52_PAN_55", + "NRF52_PAN_58", + "NRF52_PAN_62", "NRF52_PAN_63", "NRF52_PAN_64" ] }, "UBLOX_EVK_NINA_B1": { "target.macros_add": [ - "CONFIG_GPIO_AS_PINRESET", - "SWI_DISABLE0", - "NRF52_PAN_12", - "NRF52_PAN_15", - "NRF52_PAN_20", - "NRF52_PAN_30", - "NRF52_PAN_31", - "NRF52_PAN_36", - "NRF52_PAN_51", - "NRF52_PAN_53", - "NRF52_PAN_54", - "NRF52_PAN_55", - "NRF52_PAN_58", - "NRF52_PAN_62", + "CONFIG_GPIO_AS_PINRESET", + "NRF52_PAN_12", + "NRF52_PAN_15", + "NRF52_PAN_20", + "NRF52_PAN_30", + "NRF52_PAN_31", + "NRF52_PAN_36", + "NRF52_PAN_51", + "NRF52_PAN_53", + "NRF52_PAN_54", + "NRF52_PAN_55", + "NRF52_PAN_58", + "NRF52_PAN_62", "NRF52_PAN_63", "NRF52_PAN_64" ], @@ -168,20 +164,19 @@ }, "VBLUNO52": { "target.macros_add": [ - "CONFIG_GPIO_AS_PINRESET", - "SWI_DISABLE0", - "NRF52_PAN_12", - "NRF52_PAN_15", - "NRF52_PAN_20", - "NRF52_PAN_30", - "NRF52_PAN_31", - "NRF52_PAN_36", - "NRF52_PAN_51", - "NRF52_PAN_53", - "NRF52_PAN_54", - "NRF52_PAN_55", - "NRF52_PAN_58", - "NRF52_PAN_62", + "CONFIG_GPIO_AS_PINRESET", + "NRF52_PAN_12", + "NRF52_PAN_15", + "NRF52_PAN_20", + "NRF52_PAN_30", + "NRF52_PAN_31", + "NRF52_PAN_36", + "NRF52_PAN_51", + "NRF52_PAN_53", + "NRF52_PAN_54", + "NRF52_PAN_55", + "NRF52_PAN_58", + "NRF52_PAN_62", "NRF52_PAN_63", "NRF52_PAN_64" ], @@ -189,8 +184,7 @@ }, "NRF52840_DK": { "target.macros_add": [ - "CONFIG_GPIO_AS_PINRESET", - "SWI_DISABLE0", + "CONFIG_GPIO_AS_PINRESET", "NRF52_ERRATA_20" ], "target.console-uart-flow-control": "RTSCTS" diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/serial_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/serial_api.c index a89fa324414..ab3b33f2905 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/serial_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/serial_api.c @@ -110,11 +110,6 @@ #define DMA_BUFFER_SIZE MBED_CONF_NORDIC_UART_DMA_SIZE #define NUMBER_OF_BANKS 2 -/** - * Default timer delay for callbacks. - */ -#define CALLBACK_DELAY_US 100 - /** * Use RTC2 for idle timeouts. * Each channel is dedicated to one particular task. @@ -127,14 +122,6 @@ */ #define RTC_FREQUENCY 32768 -/** - * SWI IRQ numbers - */ -#define UARTE0_SWI_TX_0_IRQ SWI2_EGU2_IRQn -#define UARTE0_SWI_RX_0_IRQ SWI3_EGU3_IRQn -#define UARTE1_SWI_TX_0_IRQ SWI4_EGU4_IRQn -#define UARTE1_SWI_RX_0_IRQ SWI5_EGU5_IRQn - /*** * _______ _ __ * |__ __| | | / _| @@ -243,6 +230,14 @@ NRF_ATFIFO_DEF(nordic_nrf5_uart_fifo_0, uint8_t, UART0_FIFO_BUFFER_SIZE); NRF_ATFIFO_DEF(nordic_nrf5_uart_fifo_1, uint8_t, UART1_FIFO_BUFFER_SIZE); #endif +/** + * SWI IRQ mask. + */ +static uint8_t nordic_nrf5_uart_swi_mask_tx_0 = 0; +static uint8_t nordic_nrf5_uart_swi_mask_rx_0 = 0; +static uint8_t nordic_nrf5_uart_swi_mask_tx_1 = 0; +static uint8_t nordic_nrf5_uart_swi_mask_rx_1 = 0; + /** * Global variables expected by mbed_retarget.cpp for STDOUT. */ @@ -416,16 +411,6 @@ static void nordic_nrf5_uart_callback_handler(uint32_t instance) } } -static void nordic_nrf5_uart_swi_rx_0(void) -{ - nordic_nrf5_uart_callback_handler(0); -} - -static void nordic_nrf5_uart_swi_rx_1(void) -{ - nordic_nrf5_uart_callback_handler(1); -} - /** * @brief SWI interrupt handler for when the Tx buffer has been transmitted. * @@ -433,8 +418,8 @@ static void nordic_nrf5_uart_swi_rx_1(void) */ static void nordic_nrf5_uart_event_handler_endtx(int instance) { - /* Disable TXDRDY event again. */ - nordic_nrf5_uart_register[instance]->INTEN &= ~NRF_UARTE_INT_TXDRDY_MASK; + /* Disable ENDTX event again. */ + nrf_uarte_int_disable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_ENDTX_MASK); /* Release mutex. As the owner this call is safe. */ nordic_nrf5_uart_state[instance].tx_in_progress = 0; @@ -460,7 +445,7 @@ static void nordic_nrf5_uart_event_handler_endtx(int instance) static void nordic_nrf5_uart_event_handler_endtx_asynch(int instance) { /* Disable ENDTX interrupt. */ - nordic_nrf5_uart_register[instance]->INTEN &= ~NRF_UARTE_INT_ENDTX_MASK; + nrf_uarte_int_disable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_ENDTX_MASK); /* Set Tx done and reset Tx mode to be not asynchronous. */ nordic_nrf5_uart_state[instance].tx_in_progress = 0; @@ -482,33 +467,55 @@ static void nordic_nrf5_uart_event_handler_endtx_asynch(int instance) } #endif -static void nordic_nrf5_uart_swi_tx_0(void) +static void nordic_nrf5_uart_swi0(void) { + if (nordic_nrf5_uart_swi_mask_tx_0) { + + nordic_nrf5_uart_swi_mask_tx_0 = 0; + #if DEVICE_SERIAL_ASYNCH - if (nordic_nrf5_uart_state[0].tx_asynch) { + if (nordic_nrf5_uart_state[0].tx_asynch) { - nordic_nrf5_uart_event_handler_endtx_asynch(0); - } else + nordic_nrf5_uart_event_handler_endtx_asynch(0); + } else #endif - { - nordic_nrf5_uart_event_handler_endtx(0); + { + nordic_nrf5_uart_event_handler_endtx(0); + } } -} + + if (nordic_nrf5_uart_swi_mask_rx_0) { + + nordic_nrf5_uart_swi_mask_rx_0 = 0; + + nordic_nrf5_uart_callback_handler(0); + } + #if UART1_ENABLED -static void nordic_nrf5_uart_swi_tx_1(void) -{ + if (nordic_nrf5_uart_swi_mask_tx_1) { + + nordic_nrf5_uart_swi_mask_tx_1 = 0; + #if DEVICE_SERIAL_ASYNCH - if (nordic_nrf5_uart_state[1].tx_asynch) { + if (nordic_nrf5_uart_state[1].tx_asynch) { - nordic_nrf5_uart_event_handler_endtx_asynch(1); - } else + nordic_nrf5_uart_event_handler_endtx_asynch(1); + } else #endif - { - nordic_nrf5_uart_event_handler_endtx(1); + { + nordic_nrf5_uart_event_handler_endtx(1); + } + } + + if (nordic_nrf5_uart_swi_mask_rx_1) { + + nordic_nrf5_uart_swi_mask_rx_1 = 0; + + nordic_nrf5_uart_callback_handler(1); } -} #endif +} /** * @brief Trigger Tx SWI. @@ -519,12 +526,14 @@ static void nordic_swi_tx_trigger(int instance) { if (instance == 0) { - NVIC_SetPendingIRQ(UARTE0_SWI_TX_0_IRQ); + nordic_nrf5_uart_swi_mask_tx_0 = 1; + NVIC_SetPendingIRQ(SWI0_EGU0_IRQn); } #if UART1_ENABLED else if (instance == 1) { - NVIC_SetPendingIRQ(UARTE1_SWI_TX_0_IRQ); + nordic_nrf5_uart_swi_mask_tx_1 = 1; + NVIC_SetPendingIRQ(SWI0_EGU0_IRQn); } #endif } @@ -538,12 +547,16 @@ static void nordic_swi_rx_trigger(int instance) { if (instance == 0) { - NVIC_SetPendingIRQ(UARTE0_SWI_RX_0_IRQ); + nordic_nrf5_uart_swi_mask_rx_0 = 1; + NVIC_SetPendingIRQ(SWI0_EGU0_IRQn); } +#if UART1_ENABLED else if (instance == 1) { - NVIC_SetPendingIRQ(UARTE1_SWI_RX_0_IRQ); + nordic_nrf5_uart_swi_mask_rx_1 = 1; + NVIC_SetPendingIRQ(SWI0_EGU0_IRQn); } +#endif } /*** @@ -716,33 +729,14 @@ static void nordic_nrf5_uart_event_handler(int instance) nordic_nrf5_uart_event_handler_rxdrdy(instance); } - /* Tx single character has been sent. */ - if (nrf_uarte_event_check(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_TXDRDY)) { - - nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_TXDRDY); - - /* In non-async transfers this will generate an interrupt if callback and mask is set. */ - if (!nordic_nrf5_uart_state[instance].tx_asynch) { - - /* Use SWI to de-prioritize callback. */ - nordic_swi_tx_trigger(instance); - } - } - -#if DEVICE_SERIAL_ASYNCH /* Tx DMA buffer has been sent. */ if (nrf_uarte_event_check(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDTX)) { nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDTX); - /* Call async event handler in async mode. */ - if (nordic_nrf5_uart_state[instance].tx_asynch) { - - /* Use SWI to de-prioritize callback. */ - nordic_swi_tx_trigger(instance); - } + /* Use SWI to de-prioritize callback. */ + nordic_swi_tx_trigger(instance); } -#endif } /** @@ -777,29 +771,6 @@ static void nordic_nrf5_uart1_handler(void) * |___/ */ -/** - * @brief Enable UARTE interrupts. - * - * Translates instance to UARTE register. - * Set IRQ priority to highest to avoid Rx overflow. - * - * @param[in] instance The instance - */ -static void nordic_nrf5_uart_irq_enable(int instance) -{ - if (instance == 0) { - - nrf_drv_common_irq_enable(UARTE0_UART0_IRQn, APP_IRQ_PRIORITY_HIGHEST); - } - -#if UART1_ENABLED - else if (instance == 1) { - - nrf_drv_common_irq_enable(UARTE1_IRQn, APP_IRQ_PRIORITY_HIGHEST); - } -#endif -} - /** * @brief Configure UARTE based on serial object settings. * @@ -818,9 +789,16 @@ static void nordic_nrf5_uart_configure_object(serial_t *obj) #endif /* Configure Tx and Rx pins. */ - nrf_gpio_pin_set(uart_object->tx); - nrf_gpio_cfg_output(uart_object->tx); - nrf_gpio_cfg_input(uart_object->rx, NRF_GPIO_PIN_NOPULL); + if (uart_object->tx != NRF_UART_PSEL_DISCONNECTED) { + + nrf_gpio_pin_set(uart_object->tx); + nrf_gpio_cfg_output(uart_object->tx); + } + + if (uart_object->rx != NRF_UART_PSEL_DISCONNECTED) { + + nrf_gpio_cfg_input(uart_object->rx, NRF_GPIO_PIN_NOPULL); + } nrf_uarte_txrx_pins_set(nordic_nrf5_uart_register[uart_object->instance], uart_object->tx, @@ -864,9 +842,9 @@ static void nordic_nrf5_uart_configure_object(serial_t *obj) static void nordic_nrf5_uart_configure_rx(int instance) { /* Disable interrupts during confiration. */ - nordic_nrf5_uart_register[instance]->INTEN &= ~(NRF_UARTE_INT_RXSTARTED_MASK | - NRF_UARTE_INT_ENDRX_MASK | - NRF_UARTE_INT_RXDRDY_MASK); + nrf_uarte_int_disable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_RXSTARTED_MASK | + NRF_UARTE_INT_ENDRX_MASK | + NRF_UARTE_INT_RXDRDY_MASK); /* Clear FIFO buffer. */ nrf_atfifo_clear(nordic_nrf5_uart_state[instance].fifo); @@ -891,9 +869,9 @@ static void nordic_nrf5_uart_configure_rx(int instance) nordic_nrf5_uart_state[instance].rx_asynch = false; /* Enable interrupts again. */ - nordic_nrf5_uart_register[instance]->INTEN |= (NRF_UARTE_INT_RXSTARTED_MASK | - NRF_UARTE_INT_ENDRX_MASK | - NRF_UARTE_INT_RXDRDY_MASK); + nrf_uarte_int_enable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_RXSTARTED_MASK | + NRF_UARTE_INT_ENDRX_MASK | + NRF_UARTE_INT_RXDRDY_MASK); } #if DEVICE_SERIAL_ASYNCH @@ -905,9 +883,9 @@ static void nordic_nrf5_uart_configure_rx(int instance) static void nordic_nrf5_uart_configure_rx_asynch(int instance) { /* Disable Rx related interrupts. */ - nordic_nrf5_uart_register[instance]->INTEN &= ~(NRF_UARTE_INT_RXSTARTED_MASK | - NRF_UARTE_INT_ENDRX_MASK | - NRF_UARTE_INT_RXDRDY_MASK); + nrf_uarte_int_disable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_RXSTARTED_MASK | + NRF_UARTE_INT_ENDRX_MASK | + NRF_UARTE_INT_RXDRDY_MASK); /* Clear Rx related events. */ nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_RXSTARTED); @@ -921,7 +899,7 @@ static void nordic_nrf5_uart_configure_rx_asynch(int instance) nordic_nrf5_uart_state[instance].rx_asynch = true; /* Enable Rx interrupt. */ - nordic_nrf5_uart_register[instance]->INTEN |= NRF_UARTE_INT_ENDRX_MASK; + nrf_uarte_int_enable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_ENDRX_MASK); } #endif @@ -1028,8 +1006,8 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) NRF_RTC_INT_COMPARE0_MASK | NRF_RTC_INT_COMPARE1_MASK); - /* Enable RTC2 IRQ. Priority is set to lowest so that the UARTE ISR can interrupt it. */ - nrf_drv_common_irq_enable(RTC2_IRQn, APP_IRQ_PRIORITY_LOWEST); + /* Enable RTC2 IRQ. Priority is set to highest so that the UARTE ISR can't interrupt it. */ + nrf_drv_common_irq_enable(RTC2_IRQn, APP_IRQ_PRIORITY_HIGHEST); /* Start RTC2. According to the datasheet the added power consumption is neglible so * the RTC2 will run forever. @@ -1037,17 +1015,8 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) nrf_rtc_task_trigger(NRF_RTC2, NRF_RTC_TASK_START); /* Enable interrupts for SWI. */ - NVIC_SetVector(UARTE0_SWI_TX_0_IRQ, (uint32_t) nordic_nrf5_uart_swi_tx_0); - NVIC_SetVector(UARTE0_SWI_RX_0_IRQ, (uint32_t) nordic_nrf5_uart_swi_rx_0); - nrf_drv_common_irq_enable(UARTE0_SWI_TX_0_IRQ, APP_IRQ_PRIORITY_LOWEST); - nrf_drv_common_irq_enable(UARTE0_SWI_RX_0_IRQ, APP_IRQ_PRIORITY_LOWEST); - -#if UART1_ENABLED - NVIC_SetVector(UARTE1_SWI_TX_0_IRQ, (uint32_t) nordic_nrf5_uart_swi_tx_1); - NVIC_SetVector(UARTE1_SWI_RX_0_IRQ, (uint32_t) nordic_nrf5_uart_swi_rx_1); - nrf_drv_common_irq_enable(UARTE1_SWI_TX_0_IRQ, APP_IRQ_PRIORITY_LOWEST); - nrf_drv_common_irq_enable(UARTE1_SWI_RX_0_IRQ, APP_IRQ_PRIORITY_LOWEST); -#endif + NVIC_SetVector(SWI0_EGU0_IRQn, (uint32_t) nordic_nrf5_uart_swi0); + nrf_drv_common_irq_enable(SWI0_EGU0_IRQn, APP_IRQ_PRIORITY_LOWEST); /* Initialize FIFO buffer for UARTE0. */ NRF_ATFIFO_INIT(nordic_nrf5_uart_fifo_0); @@ -1056,9 +1025,13 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) /* Initialize owner to NULL. */ nordic_nrf5_uart_state[0].owner = NULL; - /* Enable interrupts for UARTE0. */ + /* Clear any old events and enable interrupts for UARTE0. */ + nrf_uarte_int_disable(nordic_nrf5_uart_register[0], NRF_UARTE_INT_RXSTARTED_MASK | + NRF_UARTE_INT_ENDRX_MASK | + NRF_UARTE_INT_RXDRDY_MASK); + NVIC_SetVector(UARTE0_UART0_IRQn, (uint32_t) nordic_nrf5_uart0_handler); - nordic_nrf5_uart_irq_enable(0); + nrf_drv_common_irq_enable(UARTE0_UART0_IRQn, APP_IRQ_PRIORITY_HIGHEST); #if UART1_ENABLED /* Initialize FIFO buffer for UARTE1. */ @@ -1068,9 +1041,13 @@ void serial_init(serial_t *obj, PinName tx, PinName rx) /* Initialize owner to NULL. */ nordic_nrf5_uart_state[1].owner = NULL; - /* Enable interrupts for UARTE1. */ + /* Clear any old events and enable interrupts for UARTE1. */ + nrf_uarte_int_disable(nordic_nrf5_uart_register[1], NRF_UARTE_INT_RXSTARTED_MASK | + NRF_UARTE_INT_ENDRX_MASK | + NRF_UARTE_INT_RXDRDY_MASK); + NVIC_SetVector(UARTE1_IRQn, (uint32_t) nordic_nrf5_uart1_handler); - nordic_nrf5_uart_irq_enable(1); + nrf_drv_common_irq_enable(UARTE1_IRQn, APP_IRQ_PRIORITY_HIGHEST); #endif } @@ -1411,21 +1388,6 @@ void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable) uart_object->mask &= ~type; } - - /* Enable TXDRDY event. */ - if ((type == NORDIC_TX_IRQ) && enable) { - - /* Clear Tx ready event and enable Tx ready interrupts. */ - nrf_uarte_event_clear(nordic_nrf5_uart_register[uart_object->instance], NRF_UARTE_EVENT_TXDRDY); - nordic_nrf5_uart_register[uart_object->instance]->INTEN |= NRF_UARTE_INT_TXDRDY_MASK; - - /* Disable TXDRDY event. */ - } else if ((type == NORDIC_TX_IRQ) && !enable) { - - /* Disable Tx ready interrupts and clear Tx ready event. */ - nordic_nrf5_uart_register[uart_object->instance]->INTEN &= ~NRF_UARTE_INT_TXDRDY_MASK; - nrf_uarte_event_clear(nordic_nrf5_uart_register[uart_object->instance], NRF_UARTE_EVENT_TXDRDY); - } } /** Get character. This is a blocking call, waiting for a character @@ -1503,26 +1465,15 @@ void serial_putc(serial_t *obj, int character) /* Take ownership and configure UART if necessary. */ nordic_nrf5_serial_configure(obj); - /** - * The UARTE module can generate two different Tx events: TXDRDY when each character has - * been transmitted and ENDTX when the entire buffer has been sent. - * - * For the blocking serial_putc, TXDRDY interrupts are enabled and only used for the - * single character TX IRQ callback handler. - */ - /* Arm Tx DMA buffer. */ nordic_nrf5_uart_state[instance].tx_data = character; nrf_uarte_tx_buffer_set(nordic_nrf5_uart_register[instance], &nordic_nrf5_uart_state[instance].tx_data, 1); - /* Clear TXDRDY event and enable TXDRDY interrupts. */ - nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_TXDRDY); - nordic_nrf5_uart_register[instance]->INTEN |= NRF_UARTE_INT_TXDRDY_MASK; - - /* Clear ENDTX event. */ + /* Clear ENDTX event and enable interrupts. */ nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDTX); + nrf_uarte_int_enable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_ENDTX_MASK); /* Trigger DMA transfer. */ nrf_uarte_task_trigger(nordic_nrf5_uart_register[instance], @@ -1680,19 +1631,9 @@ int serial_tx_asynch(serial_t *obj, const void *tx, size_t tx_length, uint8_t tx nordic_nrf5_uart_state[instance].tx_asynch = true; nordic_nrf5_serial_configure(obj); - /** - * The UARTE module can generate two different Tx events: TXDRDY when each - * character has been transmitted and ENDTX when the entire buffer has been sent. - * - * For the async serial_tx_async, TXDRDY interrupts are disabled completely. ENDTX - * interrupts are enabled and used to signal the completion of the async transfer. - * - * The ENDTX interrupt is diabled immediately after it is fired in the ISR. - */ - /* Clear Tx event and enable Tx interrupts. */ nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDTX); - nordic_nrf5_uart_register[instance]->INTEN |= NRF_UARTE_INT_ENDTX_MASK; + nrf_uarte_int_enable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_ENDTX_MASK); /* Set Tx DMA buffer. */ nrf_uarte_tx_buffer_set(nordic_nrf5_uart_register[obj->serial.instance], @@ -1831,7 +1772,7 @@ void serial_tx_abort_asynch(serial_t *obj) int instance = obj->serial.instance; /* Disable ENDTX interrupts. */ - nordic_nrf5_uart_register[instance]->INTEN &= ~NRF_UARTE_INT_ENDTX_MASK; + nrf_uarte_int_disable(nordic_nrf5_uart_register[instance], NRF_UARTE_INT_ENDTX_MASK); /* Clear ENDTX event. */ nrf_uarte_event_clear(nordic_nrf5_uart_register[instance], NRF_UARTE_EVENT_ENDTX); diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S132_FULL/mbed_lib.json b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S132_FULL/mbed_lib.json index 33fed4b63ac..6fdffbe1481 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S132_FULL/mbed_lib.json +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S132_FULL/mbed_lib.json @@ -28,7 +28,11 @@ "NRF_SDH_BLE_STACK_OBSERVER_PRIO=0", "NRF_SDH_SOC_STACK_OBSERVER_PRIO=0", "FDS_BACKEND=2", - "SWI_DISABLE1=1" + "SWI_DISABLE1", + "SWI_DISABLE2", + "SWI_DISABLE3", + "SWI_DISABLE4", + "SWI_DISABLE5" ], "target_overrides": { "*": { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S132_OTA/mbed_lib.json b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S132_OTA/mbed_lib.json index 158c66c33f3..6fdffbe1481 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S132_OTA/mbed_lib.json +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S132_OTA/mbed_lib.json @@ -12,13 +12,7 @@ "NRF_SDH_ENABLED=1", "NRF_SDH_BLE_ENABLED=1", "PEER_MANAGER_ENABLED=1", - "NRF_SDH_BLE_PERIPHERAL_LINK_COUNT=3", - "NRF_SDH_BLE_CENTRAL_LINK_COUNT=1", - "NRF_SDH_BLE_TOTAL_LINK_COUNT=4", - "NRF_SDH_BLE_SERVICE_CHANGED=1", "NRF_SDH_BLE_GATT_MAX_MTU_SIZE=23", - "NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE=0x600", - "NRF_SDH_BLE_VS_UUID_COUNT=4", "NRF_SDH_BLE_OBSERVER_PRIO_LEVELS=4", "NRF_SDH_BLE_GAP_EVENT_LENGTH=3", "BLE_ADV_BLE_OBSERVER_PRIO=1", @@ -34,7 +28,11 @@ "NRF_SDH_BLE_STACK_OBSERVER_PRIO=0", "NRF_SDH_SOC_STACK_OBSERVER_PRIO=0", "FDS_BACKEND=2", - "SWI_DISABLE1=1" + "SWI_DISABLE1", + "SWI_DISABLE2", + "SWI_DISABLE3", + "SWI_DISABLE4", + "SWI_DISABLE5" ], "target_overrides": { "*": { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S140_FULL/mbed_lib.json b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S140_FULL/mbed_lib.json index 6d07cdb4584..0d1c8845108 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S140_FULL/mbed_lib.json +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S140_FULL/mbed_lib.json @@ -28,7 +28,11 @@ "NRF_SDH_BLE_STACK_OBSERVER_PRIO=0", "NRF_SDH_SOC_STACK_OBSERVER_PRIO=0", "FDS_BACKEND=2", - "SWI_DISABLE1=1" + "SWI_DISABLE1", + "SWI_DISABLE2", + "SWI_DISABLE3", + "SWI_DISABLE4", + "SWI_DISABLE5" ], "target_overrides": { "*": { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S140_OTA/mbed_lib.json b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S140_OTA/mbed_lib.json index 838a47704b6..0d1c8845108 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S140_OTA/mbed_lib.json +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_SDK_14_2/TARGET_SOFTDEVICE_S140_OTA/mbed_lib.json @@ -12,13 +12,7 @@ "NRF_SDH_ENABLED=1", "NRF_SDH_BLE_ENABLED=1", "PEER_MANAGER_ENABLED=1", - "NRF_SDH_BLE_PERIPHERAL_LINK_COUNT=3", - "NRF_SDH_BLE_CENTRAL_LINK_COUNT=1", - "NRF_SDH_BLE_TOTAL_LINK_COUNT=4", - "NRF_SDH_BLE_SERVICE_CHANGED=1", "NRF_SDH_BLE_GATT_MAX_MTU_SIZE=23", - "NRF_SDH_BLE_GATTS_ATTR_TAB_SIZE=0x600", - "NRF_SDH_BLE_VS_UUID_COUNT=4", "NRF_SDH_BLE_OBSERVER_PRIO_LEVELS=4", "NRF_SDH_BLE_GAP_EVENT_LENGTH=3", "BLE_ADV_BLE_OBSERVER_PRIO=1", @@ -34,7 +28,11 @@ "NRF_SDH_BLE_STACK_OBSERVER_PRIO=0", "NRF_SDH_SOC_STACK_OBSERVER_PRIO=0", "FDS_BACKEND=2", - "SWI_DISABLE1=1" + "SWI_DISABLE1", + "SWI_DISABLE2", + "SWI_DISABLE3", + "SWI_DISABLE4", + "SWI_DISABLE5" ], "target_overrides": { "*": { diff --git a/targets/TARGET_NUVOTON/TARGET_M451/lp_ticker.c b/targets/TARGET_NUVOTON/TARGET_M451/lp_ticker.c index 282005904fe..5a09e84a3df 100644 --- a/targets/TARGET_NUVOTON/TARGET_M451/lp_ticker.c +++ b/targets/TARGET_NUVOTON/TARGET_M451/lp_ticker.c @@ -42,17 +42,42 @@ static const struct nu_modinit_s timer1_modinit = {TIMER_1, TMR1_MODULE, CLK_CLK #define TIMER_MODINIT timer1_modinit -static int ticker_inited = 0; +/* Timer interrupt enable/disable + * + * Because Timer interrupt enable/disable (TIMER_EnableInt/TIMER_DisableInt) needs wait for lp_ticker, + * we call NVIC_DisableIRQ/NVIC_EnableIRQ instead. + */ + +/* Track ticker status */ +static volatile uint16_t ticker_inited = 0; #define TMR_CMP_MIN 2 #define TMR_CMP_MAX 0xFFFFFFu -/* NOTE: When system clock is higher than timer clock, we need to add 3 engine clock - * (recommended by designer) delay to wait for above timer control to take effect. */ +/* Synchronization issue with LXT/LIRC-clocked Timer + * + * PCLK : typical HCLK/2 + * ECLK (engine clock) : LXT/LIRC for Timer used to implement lp_ticker + * + * When system clock is higher than Timer clock (LXT/LIRC), we need to add delay for ECLK + * domain to take effect: + * 1. Write : typical 1PCLK + 2ECLK + * Read-check doesn't work because it just checks PCLK domain and doesn't check into + * ECLK domain. + * 2. Clear interrupt flag : typical 2PCLK + * It is very rare that we would meet dummy interrupt and get stuck in ISR until + * 'clear interrupt flag' takes effect. The issue is ignorable because the pending + * time is very short (at most 1 dummy interrupt). We won't take special handling for it. + */ void lp_ticker_init(void) { if (ticker_inited) { + /* By HAL spec, ticker_init allows the ticker to keep counting and disables the + * ticker interrupt. */ + lp_ticker_disable_interrupt(); + lp_ticker_clear_interrupt(); + NVIC_ClearPendingIRQ(TIMER_MODINIT.irq_n); return; } ticker_inited = 1; @@ -86,7 +111,7 @@ void lp_ticker_init(void) // Set vector NVIC_SetVector(TIMER_MODINIT.irq_n, (uint32_t) TIMER_MODINIT.var); - NVIC_EnableIRQ(TIMER_MODINIT.irq_n); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); TIMER_EnableInt(timer_base); wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); @@ -101,6 +126,33 @@ void lp_ticker_init(void) while(! (timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); } +void lp_ticker_free(void) +{ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + + /* Stop counting */ + TIMER_Stop(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* Wait for timer to stop counting and unset active flag */ + while((timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); + + /* Disable wakeup */ + TIMER_DisableWakeup(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* Disable interrupt */ + TIMER_DisableInt(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); + + /* Disable IP clock */ + CLK_DisableModuleClock(TIMER_MODINIT.clkidx); + + ticker_inited = 0; +} + timestamp_t lp_ticker_read() { if (! ticker_inited) { @@ -129,20 +181,29 @@ void lp_ticker_set_interrupt(timestamp_t timestamp) uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK; cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX); + /* NOTE: Rely on LPTICKER_DELAY_TICKS to be non-blocking. */ timer_base->CMP = cmp_timer; - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } void lp_ticker_disable_interrupt(void) { - TIMER_DisableInt((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + /* We cannot call ticker_irq_handler now. */ + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); } void lp_ticker_clear_interrupt(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + /* To avoid sync issue, we clear TIF/TWKF simultaneously rather than call separate + * driver API: + * + * TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + * TIMER_ClearWakeupFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + */ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + timer_base->INTSTS = TIMER_INTSTS_TIF_Msk | TIMER_INTSTS_TWKF_Msk; } void lp_ticker_fire_interrupt(void) @@ -150,6 +211,9 @@ void lp_ticker_fire_interrupt(void) // NOTE: This event was in the past. Set the interrupt as pending, but don't process it here. // This prevents a recursive loop under heavy load which can lead to a stack overflow. NVIC_SetPendingIRQ(TIMER_MODINIT.irq_n); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } const ticker_info_t* lp_ticker_get_info() @@ -163,11 +227,7 @@ const ticker_info_t* lp_ticker_get_info() static void tmr1_vec(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); - - TIMER_ClearWakeupFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + lp_ticker_clear_interrupt(); // NOTE: lp_ticker_set_interrupt() may get called in lp_ticker_irq_handler(); lp_ticker_irq_handler(); diff --git a/targets/TARGET_NUVOTON/TARGET_M451/us_ticker.c b/targets/TARGET_NUVOTON/TARGET_M451/us_ticker.c index 51072c13b0a..0fadea09deb 100644 --- a/targets/TARGET_NUVOTON/TARGET_M451/us_ticker.c +++ b/targets/TARGET_NUVOTON/TARGET_M451/us_ticker.c @@ -15,6 +15,9 @@ */ #include "us_ticker_api.h" + +#if DEVICE_USTICKER + #include "sleep_api.h" #include "mbed_assert.h" #include "nu_modutil.h" @@ -37,7 +40,8 @@ static const struct nu_modinit_s timer0_modinit = {TIMER_0, TMR0_MODULE, CLK_CLK #define TIMER_MODINIT timer0_modinit -static int ticker_inited = 0; +/* Track ticker status */ +static volatile uint16_t ticker_inited = 0; #define TMR_CMP_MIN 2 #define TMR_CMP_MAX 0xFFFFFFu @@ -45,6 +49,11 @@ static int ticker_inited = 0; void us_ticker_init(void) { if (ticker_inited) { + /* By HAL spec, ticker_init allows the ticker to keep counting and disables the + * ticker interrupt. */ + us_ticker_disable_interrupt(); + us_ticker_clear_interrupt(); + NVIC_ClearPendingIRQ(TIMER_MODINIT.irq_n); return; } ticker_inited = 1; @@ -73,7 +82,7 @@ void us_ticker_init(void) NVIC_SetVector(TIMER_MODINIT.irq_n, (uint32_t) TIMER_MODINIT.var); - NVIC_EnableIRQ(TIMER_MODINIT.irq_n); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); TIMER_EnableInt(timer_base); @@ -82,6 +91,26 @@ void us_ticker_init(void) while(! (timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); } +void us_ticker_free(void) +{ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + + /* Stop counting */ + TIMER_Stop(timer_base); + + /* Wait for timer to stop counting and unset active flag */ + while((timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); + + /* Disable interrupt */ + TIMER_DisableInt(timer_base); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); + + /* Disable IP clock */ + CLK_DisableModuleClock(TIMER_MODINIT.clkidx); + + ticker_inited = 0; +} + uint32_t us_ticker_read() { if (! ticker_inited) { @@ -110,11 +139,15 @@ void us_ticker_set_interrupt(timestamp_t timestamp) uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK; cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX); timer_base->CMP = cmp_timer; + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } void us_ticker_disable_interrupt(void) { - TIMER_DisableInt((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + /* We cannot call ticker_irq_handler now. */ + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); } void us_ticker_clear_interrupt(void) @@ -127,6 +160,9 @@ void us_ticker_fire_interrupt(void) // NOTE: This event was in the past. Set the interrupt as pending, but don't process it here. // This prevents a recursive loop under heavy load which can lead to a stack overflow. NVIC_SetPendingIRQ(TIMER_MODINIT.irq_n); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } const ticker_info_t* us_ticker_get_info() @@ -140,8 +176,10 @@ const ticker_info_t* us_ticker_get_info() static void tmr0_vec(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - + us_ticker_clear_interrupt(); + // NOTE: us_ticker_set_interrupt() may get called in us_ticker_irq_handler(); us_ticker_irq_handler(); } + +#endif diff --git a/targets/TARGET_NUVOTON/TARGET_M480/lp_ticker.c b/targets/TARGET_NUVOTON/TARGET_M480/lp_ticker.c index a09360608ea..1811c72dfcf 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/lp_ticker.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/lp_ticker.c @@ -42,17 +42,42 @@ static const struct nu_modinit_s timer1_modinit = {TIMER_1, TMR1_MODULE, CLK_CLK #define TIMER_MODINIT timer1_modinit -static int ticker_inited = 0; +/* Timer interrupt enable/disable + * + * Because Timer interrupt enable/disable (TIMER_EnableInt/TIMER_DisableInt) needs wait for lp_ticker, + * we call NVIC_DisableIRQ/NVIC_EnableIRQ instead. + */ + +/* Track ticker status */ +static volatile uint16_t ticker_inited = 0; #define TMR_CMP_MIN 2 #define TMR_CMP_MAX 0xFFFFFFu -/* NOTE: When system clock is higher than timer clock, we need to add 3 engine clock - * (recommended by designer) delay to wait for above timer control to take effect. */ +/* Synchronization issue with LXT/LIRC-clocked Timer + * + * PCLK : typical HCLK/2 + * ECLK (engine clock) : LXT/LIRC for Timer used to implement lp_ticker + * + * When system clock is higher than Timer clock (LXT/LIRC), we need to add delay for ECLK + * domain to take effect: + * 1. Write : typical 1PCLK + 2ECLK + * Read-check doesn't work because it just checks PCLK domain and doesn't check into + * ECLK domain. + * 2. Clear interrupt flag : typical 2PCLK + * It is very rare that we would meet dummy interrupt and get stuck in ISR until + * 'clear interrupt flag' takes effect. The issue is ignorable because the pending + * time is very short (at most 1 dummy interrupt). We won't take special handling for it. + */ void lp_ticker_init(void) { if (ticker_inited) { + /* By HAL spec, ticker_init allows the ticker to keep counting and disables the + * ticker interrupt. */ + lp_ticker_disable_interrupt(); + lp_ticker_clear_interrupt(); + NVIC_ClearPendingIRQ(TIMER_MODINIT.irq_n); return; } ticker_inited = 1; @@ -86,7 +111,7 @@ void lp_ticker_init(void) // Set vector NVIC_SetVector(TIMER_MODINIT.irq_n, (uint32_t) TIMER_MODINIT.var); - NVIC_EnableIRQ(TIMER_MODINIT.irq_n); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); TIMER_EnableInt(timer_base); wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); @@ -101,6 +126,33 @@ void lp_ticker_init(void) while(! (timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); } +void lp_ticker_free(void) +{ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + + /* Stop counting */ + TIMER_Stop(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* Wait for timer to stop counting and unset active flag */ + while((timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); + + /* Disable wakeup */ + TIMER_DisableWakeup(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* Disable interrupt */ + TIMER_DisableInt(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); + + /* Disable IP clock */ + CLK_DisableModuleClock(TIMER_MODINIT.clkidx); + + ticker_inited = 0; +} + timestamp_t lp_ticker_read() { if (! ticker_inited) { @@ -129,20 +181,29 @@ void lp_ticker_set_interrupt(timestamp_t timestamp) uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK; cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX); + /* NOTE: Rely on LPTICKER_DELAY_TICKS to be non-blocking. */ timer_base->CMP = cmp_timer; - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } void lp_ticker_disable_interrupt(void) { - TIMER_DisableInt((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + /* We cannot call ticker_irq_handler now. */ + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); } void lp_ticker_clear_interrupt(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + /* To avoid sync issue, we clear TIF/TWKF simultaneously rather than call separate + * driver API: + * + * TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + * TIMER_ClearWakeupFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + */ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + timer_base->INTSTS = TIMER_INTSTS_TIF_Msk | TIMER_INTSTS_TWKF_Msk; } void lp_ticker_fire_interrupt(void) @@ -150,6 +211,9 @@ void lp_ticker_fire_interrupt(void) // NOTE: This event was in the past. Set the interrupt as pending, but don't process it here. // This prevents a recursive loop under heavy load which can lead to a stack overflow. NVIC_SetPendingIRQ(TIMER_MODINIT.irq_n); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } const ticker_info_t* lp_ticker_get_info() @@ -163,11 +227,7 @@ const ticker_info_t* lp_ticker_get_info() static void tmr1_vec(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); - - TIMER_ClearWakeupFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + lp_ticker_clear_interrupt(); // NOTE: lp_ticker_set_interrupt() may get called in lp_ticker_irq_handler(); lp_ticker_irq_handler(); diff --git a/targets/TARGET_NUVOTON/TARGET_M480/us_ticker.c b/targets/TARGET_NUVOTON/TARGET_M480/us_ticker.c index 9cce7987318..1441cf26b3e 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/us_ticker.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/us_ticker.c @@ -15,6 +15,9 @@ */ #include "us_ticker_api.h" + +#if DEVICE_USTICKER + #include "sleep_api.h" #include "mbed_assert.h" #include "nu_modutil.h" @@ -37,7 +40,8 @@ static const struct nu_modinit_s timer0_modinit = {TIMER_0, TMR0_MODULE, CLK_CLK #define TIMER_MODINIT timer0_modinit -static int ticker_inited = 0; +/* Track ticker status */ +static volatile uint16_t ticker_inited = 0; #define TMR_CMP_MIN 2 #define TMR_CMP_MAX 0xFFFFFFu @@ -45,6 +49,11 @@ static int ticker_inited = 0; void us_ticker_init(void) { if (ticker_inited) { + /* By HAL spec, ticker_init allows the ticker to keep counting and disables the + * ticker interrupt. */ + us_ticker_disable_interrupt(); + us_ticker_clear_interrupt(); + NVIC_ClearPendingIRQ(TIMER_MODINIT.irq_n); return; } ticker_inited = 1; @@ -73,7 +82,7 @@ void us_ticker_init(void) NVIC_SetVector(TIMER_MODINIT.irq_n, (uint32_t) TIMER_MODINIT.var); - NVIC_EnableIRQ(TIMER_MODINIT.irq_n); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); TIMER_EnableInt(timer_base); @@ -82,6 +91,26 @@ void us_ticker_init(void) while(! (timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); } +void us_ticker_free(void) +{ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + + /* Stop counting */ + TIMER_Stop(timer_base); + + /* Wait for timer to stop counting and unset active flag */ + while((timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); + + /* Disable interrupt */ + TIMER_DisableInt(timer_base); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); + + /* Disable IP clock */ + CLK_DisableModuleClock(TIMER_MODINIT.clkidx); + + ticker_inited = 0; +} + uint32_t us_ticker_read() { if (! ticker_inited) { @@ -110,11 +139,15 @@ void us_ticker_set_interrupt(timestamp_t timestamp) uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK; cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX); timer_base->CMP = cmp_timer; + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } void us_ticker_disable_interrupt(void) { - TIMER_DisableInt((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + /* We cannot call ticker_irq_handler now. */ + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); } void us_ticker_clear_interrupt(void) @@ -127,6 +160,9 @@ void us_ticker_fire_interrupt(void) // NOTE: This event was in the past. Set the interrupt as pending, but don't process it here. // This prevents a recursive loop under heavy load which can lead to a stack overflow. NVIC_SetPendingIRQ(TIMER_MODINIT.irq_n); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } const ticker_info_t* us_ticker_get_info() @@ -140,8 +176,10 @@ const ticker_info_t* us_ticker_get_info() static void tmr0_vec(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - + us_ticker_clear_interrupt(); + // NOTE: us_ticker_set_interrupt() may get called in us_ticker_irq_handler(); us_ticker_irq_handler(); } + +#endif diff --git a/targets/TARGET_NUVOTON/TARGET_NANO100/TARGET_NUMAKER_PFM_NANO130/mbed_overrides.c b/targets/TARGET_NUVOTON/TARGET_NANO100/TARGET_NUMAKER_PFM_NANO130/mbed_overrides.c index f3778c22cde..c17d7022b5c 100644 --- a/targets/TARGET_NUVOTON/TARGET_NANO100/TARGET_NUMAKER_PFM_NANO130/mbed_overrides.c +++ b/targets/TARGET_NUVOTON/TARGET_NANO100/TARGET_NUMAKER_PFM_NANO130/mbed_overrides.c @@ -52,8 +52,36 @@ void mbed_sdk_init(void) /* Set HCLK source form HXT and HCLK source divide 1 */ CLK_SetHCLK(CLK_CLKSEL0_HCLK_S_HXT, CLK_HCLK_CLK_DIVIDER(1)); - /* Set HCLK frequency 42MHz */ - CLK_SetCoreClock(42000000); + /* Select HXT/HIRC to clock PLL + * + * Comparison between HXT/HIRC-clocked PLL: + * 1. Spare HXT on board if only HIRC is used. + * 2. HIRC has shorter stable time. + * 3. HXT has better accuracy. USBD requires HXT-clocked PLL. + * 4. HIRC has shorter wake-up time from power-down mode. + * Per test, wake-up time from power-down mode would take: + * T1. 1~13 ms (proportional to deep sleep time) with HXT-clocked PLL as HCLK clock source + * T2. <1 ms with HIRC-clocked PLL as HCLK clock source + * T1 will fail Greentea test which requires max 10 ms wake-up time. + * + * If we just call CLK_SetCoreClock(FREQ_42MHZ) to configure HCLK to 42 MHz, + * it will go T1 with HXT already enabled in front. So we manually configure + * it to choose HXT/HIRC-clocked PLL. + */ +#define NU_HXT_PLL 1 +#define NU_HIRC_PLL 2 + +#ifndef NU_CLOCK_PLL +#define NU_CLOCK_PLL NU_HIRC_PLL +#endif + +#if (NU_CLOCK_PLL == NU_HXT_PLL) + CLK_EnablePLL(CLK_PLLCTL_PLL_SRC_HXT, FREQ_42MHZ*2); + CLK_SetHCLK(CLK_CLKSEL0_HCLK_S_PLL, CLK_HCLK_CLK_DIVIDER(2)); +#elif (NU_CLOCK_PLL == NU_HIRC_PLL) + CLK_EnablePLL(CLK_PLLCTL_PLL_SRC_HIRC, FREQ_42MHZ*2); + CLK_SetHCLK(CLK_CLKSEL0_HCLK_S_PLL, CLK_HCLK_CLK_DIVIDER(2)); +#endif /* Update System Core Clock */ /* User can use SystemCoreClockUpdate() to calculate SystemCoreClock. */ diff --git a/targets/TARGET_NUVOTON/TARGET_NANO100/device/StdDriver/nano100_clk.c b/targets/TARGET_NUVOTON/TARGET_NANO100/device/StdDriver/nano100_clk.c index 32f791872c4..16bcab302dc 100644 --- a/targets/TARGET_NUVOTON/TARGET_NANO100/device/StdDriver/nano100_clk.c +++ b/targets/TARGET_NUVOTON/TARGET_NANO100/device/StdDriver/nano100_clk.c @@ -70,7 +70,9 @@ void CLK_EnableCKO(uint32_t u32ClkSrc, uint32_t u32ClkDiv) */ void CLK_PowerDown(void) { - SCB->SCR = SCB_SCR_SLEEPDEEP_Msk; + /* Set the processor uses deep sleep as its low power mode */ + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + CLK->PWRCTL |= (CLK_PWRCTL_PD_EN_Msk | CLK_PWRCTL_WK_DLY_Msk ); __WFI(); } @@ -81,6 +83,9 @@ void CLK_PowerDown(void) */ void CLK_Idle(void) { + /* Set the processor uses sleep as its low power mode */ + SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; + CLK->PWRCTL &= ~(CLK_PWRCTL_PD_EN_Msk ); __WFI(); } diff --git a/targets/TARGET_NUVOTON/TARGET_NANO100/device/TOOLCHAIN_IAR/NANO130.icf b/targets/TARGET_NUVOTON/TARGET_NANO100/device/TOOLCHAIN_IAR/NANO130.icf index 1663174b16b..af97fd718e0 100644 --- a/targets/TARGET_NUVOTON/TARGET_NANO100/device/TOOLCHAIN_IAR/NANO130.icf +++ b/targets/TARGET_NUVOTON/TARGET_NANO100/device/TOOLCHAIN_IAR/NANO130.icf @@ -10,7 +10,7 @@ define symbol __ICFEDIT_region_IRAM_start__ = 0x20000000; define symbol __ICFEDIT_region_IRAM_end__ = 0x20004000 - 1; /*-Sizes-*/ define symbol __ICFEDIT_size_cstack__ = 0x600; -define symbol __ICFEDIT_size_heap__ = 0x1000; +define symbol __ICFEDIT_size_heap__ = 0xE00; /**** End of ICF editor section. ###ICF###*/ diff --git a/targets/TARGET_NUVOTON/TARGET_NANO100/lp_ticker.c b/targets/TARGET_NUVOTON/TARGET_NANO100/lp_ticker.c index 6355531d330..c2faafc8564 100644 --- a/targets/TARGET_NUVOTON/TARGET_NANO100/lp_ticker.c +++ b/targets/TARGET_NUVOTON/TARGET_NANO100/lp_ticker.c @@ -44,17 +44,42 @@ static const struct nu_modinit_s timer1_modinit = {TIMER_1, TMR1_MODULE, CLK_CLK #define TIMER_MODINIT timer1_modinit -static int ticker_inited = 0; +/* Timer interrupt enable/disable + * + * Because Timer interrupt enable/disable (TIMER_EnableInt/TIMER_DisableInt) needs wait for lp_ticker, + * we call NVIC_DisableIRQ/NVIC_EnableIRQ instead. + */ + +/* Track ticker status */ +static volatile uint16_t ticker_inited = 0; #define TMR_CMP_MIN 2 #define TMR_CMP_MAX 0xFFFFFFu -/* NOTE: When system clock is higher than timer clock, we need to add 3 engine clock - * (recommended by designer) delay to wait for above timer control to take effect. */ +/* Synchronization issue with LXT/LIRC-clocked Timer + * + * PCLK : typical HCLK/2 + * ECLK (engine clock) : LXT/LIRC for Timer used to implement lp_ticker + * + * When system clock is higher than Timer clock (LXT/LIRC), we need to add delay for ECLK + * domain to take effect: + * 1. Write : typical 1PCLK + 2ECLK + * Read-check doesn't work because it just checks PCLK domain and doesn't check into + * ECLK domain. + * 2. Clear interrupt flag : typical 2PCLK + * It is very rare that we would meet dummy interrupt and get stuck in ISR until + * 'clear interrupt flag' takes effect. The issue is ignorable because the pending + * time is very short (at most 1 dummy interrupt). We won't take special handling for it. + */ void lp_ticker_init(void) { if (ticker_inited) { + /* By HAL spec, ticker_init allows the ticker to keep counting and disables the + * ticker interrupt. */ + lp_ticker_disable_interrupt(); + lp_ticker_clear_interrupt(); + NVIC_ClearPendingIRQ(TIMER_MODINIT.irq_n); return; } ticker_inited = 1; @@ -90,7 +115,7 @@ void lp_ticker_init(void) // Set vector NVIC_SetVector(TIMER_MODINIT.irq_n, (uint32_t) TIMER_MODINIT.var); - NVIC_EnableIRQ(TIMER_MODINIT.irq_n); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); TIMER_EnableInt(timer_base); wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); @@ -105,6 +130,33 @@ void lp_ticker_init(void) while(! (timer_base->CTL & TIMER_CTL_TMR_ACT_Msk)); } +void lp_ticker_free(void) +{ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + + /* Stop counting */ + TIMER_Stop(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* Wait for timer to stop counting and unset active flag */ + while((timer_base->CTL & TIMER_CTL_TMR_ACT_Msk)); + + /* Disable wakeup */ + TIMER_DisableWakeup(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* Disable interrupt */ + TIMER_DisableInt(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); + + /* Disable IP clock */ + CLK_DisableModuleClock(TIMER_MODINIT.clkidx); + + ticker_inited = 0; +} + timestamp_t lp_ticker_read() { if (! ticker_inited) { @@ -133,20 +185,29 @@ void lp_ticker_set_interrupt(timestamp_t timestamp) uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK; cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX); + /* NOTE: Rely on LPTICKER_DELAY_TICKS to be non-blocking. */ timer_base->CMPR = cmp_timer; - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } void lp_ticker_disable_interrupt(void) { - TIMER_DisableInt((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + /* We cannot call ticker_irq_handler now. */ + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); } void lp_ticker_clear_interrupt(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + /* To avoid sync issue, we clear TIF/TWKF simultaneously rather than call separate + * driver API: + * + * TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + * TIMER_ClearWakeupFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + */ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + timer_base->ISR = TIMER_ISR_TMR_IS_Msk | TIMER_ISR_TMR_WAKE_STS_Msk; } void lp_ticker_fire_interrupt(void) @@ -154,6 +215,9 @@ void lp_ticker_fire_interrupt(void) // NOTE: This event was in the past. Set the interrupt as pending, but don't process it here. // This prevents a recursive loop under heavy load which can lead to a stack overflow. NVIC_SetPendingIRQ(TIMER_MODINIT.irq_n); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } const ticker_info_t* lp_ticker_get_info() @@ -167,11 +231,7 @@ const ticker_info_t* lp_ticker_get_info() void TMR1_IRQHandler(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); - - TIMER_ClearWakeupFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + lp_ticker_clear_interrupt(); // NOTE: lp_ticker_set_interrupt() may get called in lp_ticker_irq_handler(); lp_ticker_irq_handler(); diff --git a/targets/TARGET_NUVOTON/TARGET_NANO100/us_ticker.c b/targets/TARGET_NUVOTON/TARGET_NANO100/us_ticker.c index 07f7ff9adb6..0c5160d839d 100644 --- a/targets/TARGET_NUVOTON/TARGET_NANO100/us_ticker.c +++ b/targets/TARGET_NUVOTON/TARGET_NANO100/us_ticker.c @@ -15,6 +15,9 @@ */ #include "us_ticker_api.h" + +#if DEVICE_USTICKER + #include "sleep_api.h" #include "mbed_assert.h" #include "nu_modutil.h" @@ -39,7 +42,8 @@ static const struct nu_modinit_s timer0_modinit = {TIMER_0, TMR0_MODULE, CLK_CLK #define TIMER_MODINIT timer0_modinit -static int ticker_inited = 0; +/* Track ticker status */ +static volatile uint16_t ticker_inited = 0; #define TMR_CMP_MIN 2 #define TMR_CMP_MAX 0xFFFFFFu @@ -47,6 +51,11 @@ static int ticker_inited = 0; void us_ticker_init(void) { if (ticker_inited) { + /* By HAL spec, ticker_init allows the ticker to keep counting and disables the + * ticker interrupt. */ + us_ticker_disable_interrupt(); + us_ticker_clear_interrupt(); + NVIC_ClearPendingIRQ(TIMER_MODINIT.irq_n); return; } ticker_inited = 1; @@ -75,7 +84,7 @@ void us_ticker_init(void) NVIC_SetVector(TIMER_MODINIT.irq_n, (uint32_t) TIMER_MODINIT.var); - NVIC_EnableIRQ(TIMER_MODINIT.irq_n); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); TIMER_EnableInt(timer_base); @@ -84,6 +93,26 @@ void us_ticker_init(void) while(! (timer_base->CTL & TIMER_CTL_TMR_ACT_Msk)); } +void us_ticker_free(void) +{ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + + /* Stop counting */ + TIMER_Stop(timer_base); + + /* Wait for timer to stop counting and unset active flag */ + while((timer_base->CTL & TIMER_CTL_TMR_ACT_Msk)); + + /* Disable interrupt */ + TIMER_DisableInt(timer_base); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); + + /* Disable IP clock */ + CLK_DisableModuleClock(TIMER_MODINIT.clkidx); + + ticker_inited = 0; +} + uint32_t us_ticker_read() { if (! ticker_inited) { @@ -112,11 +141,15 @@ void us_ticker_set_interrupt(timestamp_t timestamp) uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK; cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX); timer_base->CMPR = cmp_timer; + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } void us_ticker_disable_interrupt(void) { - TIMER_DisableInt((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + /* We cannot call ticker_irq_handler now. */ + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); } void us_ticker_clear_interrupt(void) @@ -129,6 +162,9 @@ void us_ticker_fire_interrupt(void) // NOTE: This event was in the past. Set the interrupt as pending, but don't process it here. // This prevents a recursive loop under heavy load which can lead to a stack overflow. NVIC_SetPendingIRQ(TIMER_MODINIT.irq_n); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } const ticker_info_t* us_ticker_get_info() @@ -142,8 +178,10 @@ const ticker_info_t* us_ticker_get_info() void TMR0_IRQHandler(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - + us_ticker_clear_interrupt(); + // NOTE: us_ticker_set_interrupt() may get called in us_ticker_irq_handler(); us_ticker_irq_handler(); } + +#endif diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/lp_ticker.c b/targets/TARGET_NUVOTON/TARGET_NUC472/lp_ticker.c index 08ce7f8989b..1f55c08ca21 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/lp_ticker.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/lp_ticker.c @@ -42,17 +42,42 @@ static const struct nu_modinit_s timer1_modinit = {TIMER_1, TMR1_MODULE, CLK_CLK #define TIMER_MODINIT timer1_modinit -static int ticker_inited = 0; +/* Timer interrupt enable/disable + * + * Because Timer interrupt enable/disable (TIMER_EnableInt/TIMER_DisableInt) needs wait for lp_ticker, + * we call NVIC_DisableIRQ/NVIC_EnableIRQ instead. + */ + +/* Track ticker status */ +static volatile uint16_t ticker_inited = 0; #define TMR_CMP_MIN 2 #define TMR_CMP_MAX 0xFFFFFFu -/* NOTE: When system clock is higher than timer clock, we need to add 3 engine clock - * (recommended by designer) delay to wait for above timer control to take effect. */ +/* Synchronization issue with LXT/LIRC-clocked Timer + * + * PCLK : typical HCLK/2 + * ECLK (engine clock) : LXT/LIRC for Timer used to implement lp_ticker + * + * When system clock is higher than Timer clock (LXT/LIRC), we need to add delay for ECLK + * domain to take effect: + * 1. Write : typical 1PCLK + 2ECLK + * Read-check doesn't work because it just checks PCLK domain and doesn't check into + * ECLK domain. + * 2. Clear interrupt flag : typical 2PCLK + * It is very rare that we would meet dummy interrupt and get stuck in ISR until + * 'clear interrupt flag' takes effect. The issue is ignorable because the pending + * time is very short (at most 1 dummy interrupt). We won't take special handling for it. + */ void lp_ticker_init(void) { if (ticker_inited) { + /* By HAL spec, ticker_init allows the ticker to keep counting and disables the + * ticker interrupt. */ + lp_ticker_disable_interrupt(); + lp_ticker_clear_interrupt(); + NVIC_ClearPendingIRQ(TIMER_MODINIT.irq_n); return; } ticker_inited = 1; @@ -85,7 +110,7 @@ void lp_ticker_init(void) // Set vector NVIC_SetVector(TIMER_MODINIT.irq_n, (uint32_t) TIMER_MODINIT.var); - NVIC_EnableIRQ(TIMER_MODINIT.irq_n); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); TIMER_EnableInt(timer_base); wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); @@ -100,6 +125,33 @@ void lp_ticker_init(void) while(! (timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); } +void lp_ticker_free(void) +{ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + + /* Stop counting */ + TIMER_Stop(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* Wait for timer to stop counting and unset active flag */ + while((timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); + + /* Disable wakeup */ + TIMER_DisableWakeup(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* Disable interrupt */ + TIMER_DisableInt(timer_base); + wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); + + /* Disable IP clock */ + CLK_DisableModuleClock(TIMER_MODINIT.clkidx); + + ticker_inited = 0; +} + timestamp_t lp_ticker_read() { if (! ticker_inited) { @@ -128,20 +180,29 @@ void lp_ticker_set_interrupt(timestamp_t timestamp) uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK; cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX); + /* NOTE: Rely on LPTICKER_DELAY_TICKS to be non-blocking. */ timer_base->CMP = cmp_timer; - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } void lp_ticker_disable_interrupt(void) { - TIMER_DisableInt((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + /* We cannot call ticker_irq_handler now. */ + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); } void lp_ticker_clear_interrupt(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + /* To avoid sync issue, we clear TIF/TWKF simultaneously rather than call separate + * driver API: + * + * TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + * TIMER_ClearWakeupFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + */ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + timer_base->INTSTS = TIMER_INTSTS_TIF_Msk | TIMER_INTSTS_TWKF_Msk; } void lp_ticker_fire_interrupt(void) @@ -149,6 +210,9 @@ void lp_ticker_fire_interrupt(void) // NOTE: This event was in the past. Set the interrupt as pending, but don't process it here. // This prevents a recursive loop under heavy load which can lead to a stack overflow. NVIC_SetPendingIRQ(TIMER_MODINIT.irq_n); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } const ticker_info_t* lp_ticker_get_info() @@ -162,11 +226,7 @@ const ticker_info_t* lp_ticker_get_info() static void tmr1_vec(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); - - TIMER_ClearWakeupFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - wait_us((NU_US_PER_SEC / NU_TMRCLK_PER_SEC) * 3); + lp_ticker_clear_interrupt(); // NOTE: lp_ticker_set_interrupt() may get called in lp_ticker_irq_handler(); lp_ticker_irq_handler(); diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/us_ticker.c b/targets/TARGET_NUVOTON/TARGET_NUC472/us_ticker.c index 30836509add..03e58bac608 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/us_ticker.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/us_ticker.c @@ -15,6 +15,9 @@ */ #include "us_ticker_api.h" + +#if DEVICE_USTICKER + #include "sleep_api.h" #include "mbed_assert.h" #include "nu_modutil.h" @@ -37,7 +40,8 @@ static const struct nu_modinit_s timer0_modinit = {TIMER_0, TMR0_MODULE, CLK_CLK #define TIMER_MODINIT timer0_modinit -static int ticker_inited = 0; +/* Track ticker status */ +static volatile uint16_t ticker_inited = 0; #define TMR_CMP_MIN 2 #define TMR_CMP_MAX 0xFFFFFFu @@ -45,6 +49,11 @@ static int ticker_inited = 0; void us_ticker_init(void) { if (ticker_inited) { + /* By HAL spec, ticker_init allows the ticker to keep counting and disables the + * ticker interrupt. */ + us_ticker_disable_interrupt(); + us_ticker_clear_interrupt(); + NVIC_ClearPendingIRQ(TIMER_MODINIT.irq_n); return; } ticker_inited = 1; @@ -72,7 +81,7 @@ void us_ticker_init(void) NVIC_SetVector(TIMER_MODINIT.irq_n, (uint32_t) TIMER_MODINIT.var); - NVIC_EnableIRQ(TIMER_MODINIT.irq_n); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); TIMER_EnableInt(timer_base); @@ -81,6 +90,26 @@ void us_ticker_init(void) while(! (timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); } +void us_ticker_free(void) +{ + TIMER_T *timer_base = (TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname); + + /* Stop counting */ + TIMER_Stop(timer_base); + + /* Wait for timer to stop counting and unset active flag */ + while((timer_base->CTL & TIMER_CTL_ACTSTS_Msk)); + + /* Disable interrupt */ + TIMER_DisableInt(timer_base); + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); + + /* Disable IP clock */ + CLK_DisableModuleClock(TIMER_MODINIT.clkidx); + + ticker_inited = 0; +} + uint32_t us_ticker_read() { if (! ticker_inited) { @@ -109,11 +138,15 @@ void us_ticker_set_interrupt(timestamp_t timestamp) uint32_t cmp_timer = timestamp * NU_TMRCLK_PER_TICK; cmp_timer = NU_CLAMP(cmp_timer, TMR_CMP_MIN, TMR_CMP_MAX); timer_base->CMP = cmp_timer; + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } void us_ticker_disable_interrupt(void) { - TIMER_DisableInt((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); + /* We cannot call ticker_irq_handler now. */ + NVIC_DisableIRQ(TIMER_MODINIT.irq_n); } void us_ticker_clear_interrupt(void) @@ -126,6 +159,9 @@ void us_ticker_fire_interrupt(void) // NOTE: This event was in the past. Set the interrupt as pending, but don't process it here. // This prevents a recursive loop under heavy load which can lead to a stack overflow. NVIC_SetPendingIRQ(TIMER_MODINIT.irq_n); + + /* We can call ticker_irq_handler now. */ + NVIC_EnableIRQ(TIMER_MODINIT.irq_n); } const ticker_info_t* us_ticker_get_info() @@ -139,8 +175,10 @@ const ticker_info_t* us_ticker_get_info() static void tmr0_vec(void) { - TIMER_ClearIntFlag((TIMER_T *) NU_MODBASE(TIMER_MODINIT.modname)); - + us_ticker_clear_interrupt(); + // NOTE: us_ticker_set_interrupt() may get called in us_ticker_irq_handler(); us_ticker_irq_handler(); } + +#endif diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/analogin_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/analogin_api.c index a92d38c6dde..c699b992a70 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/analogin_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/analogin_api.c @@ -20,6 +20,7 @@ #include "cmsis.h" #include "pinmap.h" +#include "gpio_api.h" #include "PeripheralNames.h" #include "fsl_adc.h" #include "PeripheralPins.h" @@ -34,6 +35,7 @@ void analogin_init(analogin_t *obj, PinName pin) uint32_t instance = obj->adc >> ADC_INSTANCE_SHIFT; adc_config_t adc_config; + gpio_t gpio; ADC_GetDefaultConfig(&adc_config); ADC_Init(adc_addrs[instance], &adc_config); @@ -41,6 +43,10 @@ void analogin_init(analogin_t *obj, PinName pin) ADC_EnableHardwareTrigger(adc_addrs[instance], false); #endif ADC_DoAutoCalibration(adc_addrs[instance]); + + /* Need to ensure the pin is in input mode */ + gpio_init(&gpio, pin); + gpio_dir(&gpio, PIN_INPUT); } uint16_t analogin_read_u16(analogin_t *obj) diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/gpio_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/gpio_api.c index 03604ac6bb5..76e9624341f 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/gpio_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/gpio_api.c @@ -33,12 +33,12 @@ void gpio_init(gpio_t *obj, PinName pin) { clock_ip_name_t gpio_clocks[] = GPIO_CLOCKS; - CLOCK_EnableClock(gpio_clocks[pin >> GPIO_PORT_SHIFT]); - obj->pin = pin; if (pin == (PinName)NC) return; + CLOCK_EnableClock(gpio_clocks[pin >> GPIO_PORT_SHIFT]); + pin_function(pin, GPIO_MUX_PORT); } diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/gpio_irq_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/gpio_irq_api.c index 2e0ecd06c87..0d87dc44f01 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/gpio_irq_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/gpio_irq_api.c @@ -38,7 +38,7 @@ static gpio_irq_handler irq_handler; static GPIO_Type * const gpio_addrs[] = GPIO_BASE_PTRS; /* Array of PORT IRQ number. */ -static const IRQn_Type gpio_irqs[] = GPIO_IRQS; +static const IRQn_Type gpio_irqs[] = GPIO_COMBINED_IRQS; static void handle_interrupt_in(PortName port, int ch_base) { @@ -117,6 +117,8 @@ void gpio5_irq(void) int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32_t id) { + uint32_t int_index; + if (pin == NC) { return -1; } @@ -153,8 +155,14 @@ int gpio_irq_init(gpio_irq_t *obj, PinName pin, gpio_irq_handler handler, uint32 error("gpio_irq only supported on port A-E."); break; } - NVIC_SetVector(gpio_irqs[obj->port], vector); - NVIC_EnableIRQ(gpio_irqs[obj->port]); + + int_index = 2 * obj->port; + if (obj->pin > 15) { + int_index -= 1; + } + + NVIC_SetVector(gpio_irqs[int_index], vector); + NVIC_EnableIRQ(gpio_irqs[int_index]); obj->ch = ch_base + obj->pin; channel_ids[obj->ch] = id; diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC546XX/TARGET_LPCXpresso/PeripheralPins.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC546XX/TARGET_LPCXpresso/PeripheralPins.c index 60f8246b942..99dc80db819 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC546XX/TARGET_LPCXpresso/PeripheralPins.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC546XX/TARGET_LPCXpresso/PeripheralPins.c @@ -65,13 +65,13 @@ const PinMap PinMap_I2C_SCL[] = { /************UART***************/ const PinMap PinMap_UART_TX[] = { {P0_30, UART_0, 1}, - {P3_27, UART_1, 1}, + {P3_27, UART_1, 3}, {NC , NC , 0} }; const PinMap PinMap_UART_RX[] = { {P0_29, UART_0, 1}, - {P3_26, UART_1, 1}, + {P3_26, UART_1, 3}, {NC , NC , 0} }; diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/TARGET_EVK/PeripheralPins.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/TARGET_EVK/PeripheralPins.c index 648f2b54b29..db5a02e4863 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/TARGET_EVK/PeripheralPins.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/TARGET_EVK/PeripheralPins.c @@ -23,8 +23,12 @@ const PinMap PinMap_RTC[] = { /************ADC***************/ const PinMap PinMap_ADC[] = { - {GPIO_AD_B1_11, ADC1_0, 0}, - {GPIO_AD_B1_04, ADC1_9, 0}, + {GPIO_AD_B1_10, ADC1_15, 5}, + {GPIO_AD_B1_11, ADC2_0, 5}, + {GPIO_AD_B1_04, ADC1_9, 5}, + {GPIO_AD_B1_05, ADC1_10, 5}, + {GPIO_AD_B1_01, ADC1_6, 5}, + {GPIO_AD_B1_00, ADC1_5, 5}, {NC , NC , 0} }; diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/device/MIMXRT1052.h b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/device/MIMXRT1052.h index 09e8044a630..0399bc70709 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/device/MIMXRT1052.h +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT1050/device/MIMXRT1052.h @@ -12095,7 +12095,7 @@ typedef struct { #define GPIO_BASE_PTRS { (GPIO_Type *)0u, GPIO1, GPIO2, GPIO3, GPIO4, GPIO5 } /** Interrupt vectors for the GPIO peripheral type */ #define GPIO_IRQS { NotAvail_IRQn, GPIO1_INT0_IRQn, GPIO1_INT1_IRQn, GPIO1_INT2_IRQn, GPIO1_INT3_IRQn, GPIO1_INT4_IRQn, GPIO1_INT5_IRQn, GPIO1_INT6_IRQn, GPIO1_INT7_IRQn, NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn, NotAvail_IRQn } -#define GPIO_COMBINED_IRQS { NotAvail_IRQn, GPIO1_Combined_16_31_IRQn, GPIO2_Combined_16_31_IRQn, GPIO2_Combined_0_15_IRQn, GPIO3_Combined_16_31_IRQn, GPIO3_Combined_0_15_IRQn, GPIO4_Combined_16_31_IRQn, GPIO4_Combined_0_15_IRQn, GPIO5_Combined_16_31_IRQn, GPIO5_Combined_0_15_IRQn } +#define GPIO_COMBINED_IRQS { NotAvail_IRQn, GPIO1_Combined_16_31_IRQn, GPIO1_Combined_0_15_IRQn, GPIO2_Combined_16_31_IRQn, GPIO2_Combined_0_15_IRQn, GPIO3_Combined_16_31_IRQn, GPIO3_Combined_0_15_IRQn, GPIO4_Combined_16_31_IRQn, GPIO4_Combined_0_15_IRQn, GPIO5_Combined_16_31_IRQn, GPIO5_Combined_0_15_IRQn } /*! * @} diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/device/hal_tick.h deleted file mode 100644 index 06a4fce8ecd..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/device/hal_tick.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f0xx.h" -#include "stm32f0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM1 -#define TIM_MST_UP_IRQ TIM1_BRK_UP_TRG_COM_IRQn -#define TIM_MST_OC_IRQ TIM1_CC_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM1_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM1() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM1_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM1_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/device/us_ticker_data.h new file mode 100644 index 00000000000..4fc73ab4b89 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/device/us_ticker_data.h @@ -0,0 +1,46 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f0xx.h" +#include "stm32f0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM1 +#define TIM_MST_UP_IRQ TIM1_BRK_UP_TRG_COM_IRQn +#define TIM_MST_OC_IRQ TIM1_CC_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM1_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM1() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM1_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM1_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/device/hal_tick.h deleted file mode 100644 index 06a4fce8ecd..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/device/hal_tick.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f0xx.h" -#include "stm32f0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM1 -#define TIM_MST_UP_IRQ TIM1_BRK_UP_TRG_COM_IRQn -#define TIM_MST_OC_IRQ TIM1_CC_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM1_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM1() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM1_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM1_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/device/us_ticker_data.h new file mode 100644 index 00000000000..4fc73ab4b89 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F030R8/device/us_ticker_data.h @@ -0,0 +1,46 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f0xx.h" +#include "stm32f0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM1 +#define TIM_MST_UP_IRQ TIM1_BRK_UP_TRG_COM_IRQn +#define TIM_MST_OC_IRQ TIM1_CC_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM1_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM1() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM1_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM1_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/device/hal_tick.h deleted file mode 100644 index a140fe2cdd1..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "stm32f0xx.h" -#include "stm32f0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/device/us_ticker_data.h new file mode 100644 index 00000000000..48cc56a2288 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F031K6/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "stm32f0xx.h" +#include "stm32f0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/hal_tick.h deleted file mode 100644 index 7e0ce365fda..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "stm32f0xx.h" -#include "stm32f0xx_ll_tim.h": -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/us_ticker_data.h new file mode 100644 index 00000000000..8277c334f9b --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "stm32f0xx.h" +#include "stm32f0xx_ll_tim.h": +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/device/hal_tick.h deleted file mode 100644 index 06a4fce8ecd..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/device/hal_tick.h +++ /dev/null @@ -1,66 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f0xx.h" -#include "stm32f0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM1 -#define TIM_MST_UP_IRQ TIM1_BRK_UP_TRG_COM_IRQn -#define TIM_MST_OC_IRQ TIM1_CC_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM1_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM1() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM1_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM1_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/device/us_ticker_data.h new file mode 100644 index 00000000000..4fc73ab4b89 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F070RB/device/us_ticker_data.h @@ -0,0 +1,46 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f0xx.h" +#include "stm32f0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM1 +#define TIM_MST_UP_IRQ TIM1_BRK_UP_TRG_COM_IRQn +#define TIM_MST_OC_IRQ TIM1_CC_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM1_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM1() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM1_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM1_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/hal_tick.h deleted file mode 100644 index bc4d8b732fc..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f0xx.h" -#include "stm32f0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/us_ticker_data.h new file mode 100644 index 00000000000..360a5c5e9cb --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F072RB/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f0xx.h" +#include "stm32f0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/hal_tick.h deleted file mode 100644 index bc4d8b732fc..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f0xx.h" -#include "stm32f0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/us_ticker_data.h new file mode 100644 index 00000000000..360a5c5e9cb --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F091RC/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f0xx.h" +#include "stm32f0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/hal_tick.h deleted file mode 100644 index 572b63e8126..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2016 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f1xx.h" -#include "stm32f1xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM4 -#define TIM_MST_IRQ TIM4_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM4_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM4() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM4_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM4_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/us_ticker_data.h new file mode 100644 index 00000000000..3bfb085eafe --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f1xx.h" +#include "stm32f1xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM4 +#define TIM_MST_IRQ TIM4_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM4_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM4() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM4_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM4_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/device/hal_tick.h deleted file mode 100644 index 572b63e8126..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2016 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f1xx.h" -#include "stm32f1xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM4 -#define TIM_MST_IRQ TIM4_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM4_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM4() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM4_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM4_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/device/us_ticker_data.h new file mode 100644 index 00000000000..3bfb085eafe --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F1/TARGET_DISCO_F100RB/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f1xx.h" +#include "stm32f1xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM4 +#define TIM_MST_IRQ TIM4_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM4_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM4() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM4_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM4_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/device/hal_tick.h deleted file mode 100644 index 572b63e8126..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2016 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f1xx.h" -#include "stm32f1xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM4 -#define TIM_MST_IRQ TIM4_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM4_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM4() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM4_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM4_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/device/us_ticker_data.h new file mode 100644 index 00000000000..3bfb085eafe --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F1/TARGET_NUCLEO_F103RB/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f1xx.h" +#include "stm32f1xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM4 +#define TIM_MST_IRQ TIM4_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM4_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM4() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM4_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM4_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/device/hal_tick.h deleted file mode 100644 index d6aefa0d666..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "stm32f2xx.h" -#include "stm32f2xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/device/us_ticker_data.h new file mode 100644 index 00000000000..be9f0158908 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "stm32f2xx.h" +#include "stm32f2xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F302x8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F302x8/device/hal_tick.h deleted file mode 100644 index f3771b2820a..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F302x8/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f3xx.h" -#include "stm32f3xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F302x8/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F302x8/device/us_ticker_data.h new file mode 100644 index 00000000000..f727b6655fa --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F302x8/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f3xx.h" +#include "stm32f3xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/device/hal_tick.h deleted file mode 100644 index f3771b2820a..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f3xx.h" -#include "stm32f3xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/device/us_ticker_data.h new file mode 100644 index 00000000000..f727b6655fa --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303x8/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f3xx.h" +#include "stm32f3xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/device/hal_tick.h deleted file mode 100644 index f3771b2820a..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f3xx.h" -#include "stm32f3xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/device/us_ticker_data.h new file mode 100644 index 00000000000..f727b6655fa --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xC/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f3xx.h" +#include "stm32f3xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/hal_tick.h deleted file mode 100644 index f3771b2820a..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f3xx.h" -#include "stm32f3xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/us_ticker_data.h new file mode 100644 index 00000000000..f727b6655fa --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f3xx.h" +#include "stm32f3xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F334x8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F334x8/device/hal_tick.h deleted file mode 100644 index f3771b2820a..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F334x8/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f3xx.h" -#include "stm32f3xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F334x8/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F334x8/device/us_ticker_data.h new file mode 100644 index 00000000000..f727b6655fa --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F334x8/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f3xx.h" +#include "stm32f3xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTB_MTS_DRAGONFLY/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTB_MTS_DRAGONFLY/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTB_MTS_DRAGONFLY/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTB_MTS_DRAGONFLY/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTB_MTS_DRAGONFLY/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTB_MTS_DRAGONFLY/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xC/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F401xE/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F410xB/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F410xB/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F410xB/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F410xB/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F410xB/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F410xB/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F412xG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F412xG/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F412xG/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F412xG/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F412xG/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F412xG/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/device/hal_tick.h deleted file mode 100644 index a76334d826c..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F413xH/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F437xG/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device/hal_tick.h deleted file mode 100644 index 93306fe86b9..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F446xE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F446xE/device/hal_tick.h deleted file mode 100644 index 22209f948ac..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F446xE/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F446xE/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F446xE/device/us_ticker_data.h new file mode 100644 index 00000000000..112319524f6 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F446xE/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F469xI/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F469xI/device/hal_tick.h deleted file mode 100644 index d63594eb82e..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F469xI/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f4xx.h" -#include "stm32f4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F469xI/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F469xI/device/us_ticker_data.h new file mode 100644 index 00000000000..5db56d2174a --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F469xI/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f4xx.h" +#include "stm32f4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/device/hal_tick.h deleted file mode 100644 index b7eb8382ef7..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/device/hal_tick.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2016 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f7xx.h" -#include "stm32f7xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority); - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/device/us_ticker_data.h new file mode 100644 index 00000000000..65e46d485d9 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F746xG/device/us_ticker_data.h @@ -0,0 +1,47 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f7xx.h" +#include "stm32f7xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority); + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F756xG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F756xG/device/hal_tick.h deleted file mode 100644 index b7eb8382ef7..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F756xG/device/hal_tick.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2016 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f7xx.h" -#include "stm32f7xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority); - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F756xG/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F756xG/device/us_ticker_data.h new file mode 100644 index 00000000000..65e46d485d9 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F756xG/device/us_ticker_data.h @@ -0,0 +1,47 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f7xx.h" +#include "stm32f7xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority); + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F767xI/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F767xI/device/hal_tick.h deleted file mode 100644 index b7eb8382ef7..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F767xI/device/hal_tick.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2016 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f7xx.h" -#include "stm32f7xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority); - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F767xI/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F767xI/device/us_ticker_data.h new file mode 100644 index 00000000000..65e46d485d9 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F767xI/device/us_ticker_data.h @@ -0,0 +1,47 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f7xx.h" +#include "stm32f7xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority); + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F769xI/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F769xI/device/hal_tick.h deleted file mode 100644 index b7eb8382ef7..00000000000 --- a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F769xI/device/hal_tick.h +++ /dev/null @@ -1,67 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2016 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32f7xx.h" -#include "stm32f7xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority); - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F769xI/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F769xI/device/us_ticker_data.h new file mode 100644 index 00000000000..65e46d485d9 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32F7/TARGET_STM32F769xI/device/us_ticker_data.h @@ -0,0 +1,47 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32f7xx.h" +#include "stm32f7xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority); + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L011K4/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L011K4/device/hal_tick.h deleted file mode 100644 index 9de683c3bd5..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L011K4/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l0xx.h" -#include "stm32l0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM21 -#define TIM_MST_IRQ TIM21_IRQn -#define TIM_MST_RCC __TIM21_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() - -#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L011K4/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L011K4/device/us_ticker_data.h new file mode 100644 index 00000000000..1ae9b883759 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L011K4/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l0xx.h" +#include "stm32l0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM21 +#define TIM_MST_IRQ TIM21_IRQn +#define TIM_MST_RCC __TIM21_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() + +#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/device/hal_tick.h deleted file mode 100644 index 9de683c3bd5..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l0xx.h" -#include "stm32l0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM21 -#define TIM_MST_IRQ TIM21_IRQn -#define TIM_MST_RCC __TIM21_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() - -#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/device/us_ticker_data.h new file mode 100644 index 00000000000..1ae9b883759 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L031K6/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l0xx.h" +#include "stm32l0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM21 +#define TIM_MST_IRQ TIM21_IRQn +#define TIM_MST_RCC __TIM21_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() + +#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/hal_tick.h deleted file mode 100644 index 9de683c3bd5..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l0xx.h" -#include "stm32l0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM21 -#define TIM_MST_IRQ TIM21_IRQn -#define TIM_MST_RCC __TIM21_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() - -#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/us_ticker_data.h new file mode 100644 index 00000000000..1ae9b883759 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l0xx.h" +#include "stm32l0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM21 +#define TIM_MST_IRQ TIM21_IRQn +#define TIM_MST_RCC __TIM21_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() + +#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L053x8/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L053x8/device/hal_tick.h deleted file mode 100644 index 9de683c3bd5..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L053x8/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l0xx.h" -#include "stm32l0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM21 -#define TIM_MST_IRQ TIM21_IRQn -#define TIM_MST_RCC __TIM21_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() - -#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L053x8/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L053x8/device/us_ticker_data.h new file mode 100644 index 00000000000..1ae9b883759 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L053x8/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l0xx.h" +#include "stm32l0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM21 +#define TIM_MST_IRQ TIM21_IRQn +#define TIM_MST_RCC __TIM21_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() + +#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L072xZ/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L072xZ/device/hal_tick.h deleted file mode 100644 index cce8982ac7e..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L072xZ/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l0xx.h" -#include "stm32l0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM21 -#define TIM_MST_IRQ TIM21_IRQn -#define TIM_MST_RCC __TIM21_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() - -#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L072xZ/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L072xZ/device/us_ticker_data.h new file mode 100644 index 00000000000..1ae9b883759 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L072xZ/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l0xx.h" +#include "stm32l0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM21 +#define TIM_MST_IRQ TIM21_IRQn +#define TIM_MST_RCC __TIM21_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() + +#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L0x2xZ/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L0x2xZ/device/hal_tick.h deleted file mode 100644 index 9de683c3bd5..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L0x2xZ/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l0xx.h" -#include "stm32l0xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM21 -#define TIM_MST_IRQ TIM21_IRQn -#define TIM_MST_RCC __TIM21_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() - -#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L0x2xZ/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L0x2xZ/device/us_ticker_data.h new file mode 100644 index 00000000000..1ae9b883759 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_STM32L0x2xZ/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l0xx.h" +#include "stm32l0xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM21 +#define TIM_MST_IRQ TIM21_IRQn +#define TIM_MST_RCC __TIM21_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM21() + +#define TIM_MST_RESET_ON __TIM21_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM21_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 2 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/device/hal_tick.h deleted file mode 100644 index a060c43f5e3..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l1xx.h" -#include "stm32l1xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/device/us_ticker_data.h new file mode 100644 index 00000000000..b32bd97db96 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L1/TARGET_MOTE_L152RC/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l1xx.h" +#include "stm32l1xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_MTS_XDOT/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_MTS_XDOT/device/hal_tick.h deleted file mode 100644 index 39b37212f21..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_MTS_XDOT/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l1xx.h" -#include "stm32l1xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_MTS_XDOT/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_MTS_XDOT/device/us_ticker_data.h new file mode 100644 index 00000000000..b32bd97db96 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_MTS_XDOT/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l1xx.h" +#include "stm32l1xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_RAK811/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_RAK811/device/hal_tick.h deleted file mode 100644 index 4f915df8dff..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_RAK811/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l1xx.h" -#include "stm32l1xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM4 -#define TIM_MST_IRQ TIM4_IRQn -#define TIM_MST_RCC __TIM4_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __TIM4_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM4_RELEASE_RESET() - -#define TIM_MST_16BIT 1 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_RAK811/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_RAK811/device/us_ticker_data.h new file mode 100644 index 00000000000..1480b81f7a4 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L1/TARGET_MTB_RAK811/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l1xx.h" +#include "stm32l1xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM4 +#define TIM_MST_IRQ TIM4_IRQn +#define TIM_MST_RCC __TIM4_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __TIM4_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM4_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 16 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/device/hal_tick.h deleted file mode 100644 index a060c43f5e3..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2014 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l1xx.h" -#include "stm32l1xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/device/us_ticker_data.h new file mode 100644 index 00000000000..b32bd97db96 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L1/TARGET_NUCLEO_L152RE/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l1xx.h" +#include "stm32l1xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/device/hal_tick.h deleted file mode 100644 index 39b37212f21..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l1xx.h" -#include "stm32l1xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/device/us_ticker_data.h new file mode 100644 index 00000000000..b32bd97db96 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L1/TARGET_NZ32_SC151/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l1xx.h" +#include "stm32l1xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_XDOT_L151CC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_XDOT_L151CC/device/hal_tick.h deleted file mode 100644 index 39b37212f21..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L1/TARGET_XDOT_L151CC/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l1xx.h" -#include "stm32l1xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L1/TARGET_XDOT_L151CC/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L1/TARGET_XDOT_L151CC/device/us_ticker_data.h new file mode 100644 index 00000000000..b32bd97db96 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L1/TARGET_XDOT_L151CC/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l1xx.h" +#include "stm32l1xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/hal_tick.h deleted file mode 100644 index 9fcdd8db16e..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l4xx.h" -#include "stm32l4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/us_ticker_data.h new file mode 100644 index 00000000000..cf4de8b5bb8 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L432xC/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l4xx.h" +#include "stm32l4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L433xC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L433xC/device/hal_tick.h deleted file mode 100644 index 9fcdd8db16e..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L433xC/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l4xx.h" -#include "stm32l4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L433xC/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L433xC/device/us_ticker_data.h new file mode 100644 index 00000000000..cf4de8b5bb8 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L433xC/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l4xx.h" +#include "stm32l4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L443xC/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L443xC/device/hal_tick.h deleted file mode 100644 index 9fcdd8db16e..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L443xC/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l4xx.h" -#include "stm32l4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM2 -#define TIM_MST_IRQ TIM2_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L443xC/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L443xC/device/us_ticker_data.h new file mode 100644 index 00000000000..cf4de8b5bb8 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L443xC/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l4xx.h" +#include "stm32l4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM2 +#define TIM_MST_IRQ TIM2_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM2_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM2() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM2_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM2_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/device/hal_tick.h deleted file mode 100644 index a63c215500a..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2017 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l4xx.h" -#include "stm32l4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/device/us_ticker_data.h new file mode 100644 index 00000000000..93a3a31c0f0 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l4xx.h" +#include "stm32l4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/device/hal_tick.h deleted file mode 100644 index bf6dab14404..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l4xx.h" -#include "stm32l4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/device/us_ticker_data.h new file mode 100644 index 00000000000..93a3a31c0f0 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L476xG/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l4xx.h" +#include "stm32l4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/device/hal_tick.h deleted file mode 100644 index bf6dab14404..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/device/hal_tick.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l4xx.h" -#include "stm32l4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() -#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/device/us_ticker_data.h new file mode 100644 index 00000000000..93a3a31c0f0 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/device/us_ticker_data.h @@ -0,0 +1,45 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l4xx.h" +#include "stm32l4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() +#define TIM_MST_DBGMCU_FREEZE __HAL_DBGMCU_FREEZE_TIM5() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_DISCO_L496AG/PeripheralPins.c b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_DISCO_L496AG/PeripheralPins.c index 185aa4f699a..a8254ebd4de 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_DISCO_L496AG/PeripheralPins.c +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_DISCO_L496AG/PeripheralPins.c @@ -63,8 +63,8 @@ MBED_WEAK const PinMap PinMap_ADC[] = { {PA_3_ALT0, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8 // Connected to QSPI_CLK [MX25R6435FM2IL0_SCLK] {PA_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 // Connected to STMOD_ADC {PA_4_ALT0, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9 // Connected to STMOD_ADC - {PA_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 // Connected to ARD_D13 - {PA_5_ALT0, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10 // Connected to ARD_D13 + {PA_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 // Connected to ARD_D13 // Connected to LED1 (LD3 on the board) + {PA_5_ALT0, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10 // Connected to ARD_D13 // Connected to LED1 (LD3 on the board) {PA_6, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 // Connected to QSPI_BK1_IO3 [MX25R6435FM2IL0_SIO3] {PA_6_ALT0, ADC_2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 // Connected to QSPI_BK1_IO3 [MX25R6435FM2IL0_SIO3] {PA_7, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 // Connected to QSPI_BK1_IO2 [MX25R6435FM2IL0_SIO2] @@ -107,7 +107,7 @@ MBED_WEAK const PinMap PinMap_ADC_Internal[] = { MBED_WEAK const PinMap PinMap_DAC[] = { {PA_4, DAC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC1_OUT1 // Connected to STMOD_ADC - {PA_5, DAC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC1_OUT2 // Connected to ARD_D13 + {PA_5, DAC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC1_OUT2 // Connected to ARD_D13 // Connected to LED1 (LD3 on the board) {NC, NC, 0} }; @@ -141,7 +141,7 @@ MBED_WEAK const PinMap PinMap_I2C_SCL[] = { {PB_8, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // Connected to I2C1_SCL {PB_10, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, // Connected to SAI1_SCK_A {PB_10_ALT0, I2C_4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF3_I2C4)}, // Connected to SAI1_SCK_A - {PB_13, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, // Connected to LED1 + {PB_13, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, // Connected to LED2 (LD2 on the board) {PC_0, I2C_3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, // Connected to ARD_A5 {PC_0_ALT0, I2C_4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF2_I2C4)}, // Connected to ARD_A5 {PD_12, I2C_4, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C4)}, // Connected to PSRAM_A17 [A17_IS66WV51216EBLL] @@ -169,8 +169,8 @@ MBED_WEAK const PinMap PinMap_PWM[] = { {PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 // Connected to QSPI_CLK [MX25R6435FM2IL0_SCLK] // {PA_3, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 // Connected to QSPI_CLK [MX25R6435FM2IL0_SCLK] {PA_3_ALT0, PWM_15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM15, 2, 0)}, // TIM15_CH2 // Connected to QSPI_CLK [MX25R6435FM2IL0_SCLK] - {PA_5, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 // Connected to ARD_D13 - {PA_5_ALT0, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N // Connected to ARD_D13 + {PA_5, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 // Connected to ARD_D13 // Connected to LED1 (LD3 on the board) + {PA_5_ALT0, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 1, 1)}, // TIM8_CH1N // Connected to ARD_D13 // Connected to LED1 (LD3 on the board) {PA_6, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 // Connected to QSPI_BK1_IO3 [MX25R6435FM2IL0_SIO3] {PA_6_ALT0, PWM_16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM16, 1, 0)}, // TIM16_CH1 // Connected to QSPI_BK1_IO3 [MX25R6435FM2IL0_SIO3] {PA_7, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N // Connected to QSPI_BK1_IO2 [MX25R6435FM2IL0_SIO2] @@ -201,8 +201,8 @@ MBED_WEAK const PinMap PinMap_PWM[] = { {PB_9_ALT0, PWM_17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM17, 1, 0)}, // TIM17_CH1 // Connected to ARD_D5 {PB_10, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 // Connected to SAI1_SCK_A {PB_11, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 // Connected to QSPI_BK1_NCS [MX25R6435FM2IL0_CS] - {PB_13, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N // Connected to LED1 - {PB_13_ALT0, PWM_15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM15, 1, 1)}, // TIM15_CH1N // Connected to LED1 + {PB_13, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N // Connected to LED2 (LD2 on the board) + {PB_13_ALT0, PWM_15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM15, 1, 1)}, // TIM15_CH1N // Connected to LED2 (LD2 on the board) {PB_14, PWM_1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N // Connected to I2C2_SDA [CS42L51_SDA] {PB_14_ALT0, PWM_8, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8, 2, 1)}, // TIM8_CH2N // Connected to I2C2_SDA [CS42L51_SDA] {PB_14_ALT1, PWM_15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM15, 1, 0)}, // TIM15_CH1 // Connected to I2C2_SDA [CS42L51_SDA] @@ -322,8 +322,8 @@ MBED_WEAK const PinMap PinMap_UART_CTS[] = { {PB_4, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, {PB_5, UART_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, // Connected to ARD_D11 {PB_7, UART_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, // Connected to I2C1_SDA - {PB_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // Connected to LED1 - {PB_13_ALT0, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // Connected to LED1 + {PB_13, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // Connected to LED2 (LD2 on the board) + {PB_13_ALT0, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // Connected to LED2 (LD2 on the board) {PD_3, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, {PD_11, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // Connected to PSRAM_A16 [A16_IS66WV51216EBLL] {PG_5, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, // Connected to PSRAM_A15 [A15_IS66WV51216EBLL] @@ -368,12 +368,12 @@ MBED_WEAK const PinMap PinMap_SPI_MISO[] = { MBED_WEAK const PinMap PinMap_SPI_SCLK[] = { {PA_1, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, // Connected to ARD_A4 - {PA_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, // Connected to ARD_D13 + {PA_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, // Connected to ARD_D13 // Connected to LED1 (LD3 on the board) {PA_9, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF3_SPI2)}, // Connected to USB_OTGFS_VBUS {PB_3, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI1)}, {PB_3_ALT0, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF6_SPI3)}, {PB_10, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI2)}, // Connected to SAI1_SCK_A - {PB_13, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI2)}, // Connected to LED1 + {PB_13, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI2)}, // Connected to LED2 (LD2 on the board) {PC_10, SPI_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF6_SPI3)}, // Connected to uSD_D2 {PD_1, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF5_SPI2)}, // Connected to D3 [D3_IS66WV51216EBLL] {PD_3, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF3_SPI2)}, @@ -416,7 +416,7 @@ MBED_WEAK const PinMap PinMap_CAN_TD[] = { {PA_12, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, // Connected to USB_OTGFS_DP {PB_6, CAN_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF8_CAN2)}, // Connected to USART1_TX {PB_9, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, // Connected to ARD_D5 - {PB_13, CAN_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_CAN2)}, // Connected to LED1 + {PB_13, CAN_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_CAN2)}, // Connected to LED2 (LD2 on the board) {PD_1, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, // Connected to D3 [D3_IS66WV51216EBLL] {PH_13, CAN_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF9_CAN1)}, // Connected to ARD_D9 {NC, NC, 0} diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_DISCO_L496AG/PinNames.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_DISCO_L496AG/PinNames.h index 371a5c249e1..7b41515f0b6 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_DISCO_L496AG/PinNames.h +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_DISCO_L496AG/PinNames.h @@ -285,8 +285,8 @@ typedef enum { #endif // Generic signals - LED1 = PB_13, // Green LD2 on board - LED2 = LED1, + LED1 = PA_5, // Green LD3 on board + LED2 = PB_13, // Green LD2 on board --> Warning: the state is reverted (1=OFF and 0=ON) LED3 = LED1, LED4 = LED1, USER_BUTTON = PC_13, // Joystick Center diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/device/hal_tick.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/device/hal_tick.h deleted file mode 100644 index 1e6dfe339a8..00000000000 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/device/hal_tick.h +++ /dev/null @@ -1,64 +0,0 @@ -/** - ****************************************************************************** - * @file hal_tick.h - * @author MCD Application Team - * @brief Initialization of HAL tick - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2015 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ -#ifndef __HAL_TICK_H -#define __HAL_TICK_H - -#ifdef __cplusplus - extern "C" { -#endif - -#include "stm32l4xx.h" -#include "stm32l4xx_ll_tim.h" -#include "cmsis_nvic.h" - -#define TIM_MST TIM5 -#define TIM_MST_IRQ TIM5_IRQn -#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() - -#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() -#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() - -#define TIM_MST_16BIT 0 // 1=16-bit timer, 0=32-bit timer - -#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) - - -#ifdef __cplusplus -} -#endif - -#endif // __HAL_TICK_H - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/device/us_ticker_data.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/device/us_ticker_data.h new file mode 100644 index 00000000000..833e724d812 --- /dev/null +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/device/us_ticker_data.h @@ -0,0 +1,44 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef __US_TICKER_DATA_H +#define __US_TICKER_DATA_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "stm32l4xx.h" +#include "stm32l4xx_ll_tim.h" +#include "cmsis_nvic.h" + +#define TIM_MST TIM5 +#define TIM_MST_IRQ TIM5_IRQn +#define TIM_MST_RCC __HAL_RCC_TIM5_CLK_ENABLE() + +#define TIM_MST_RESET_ON __HAL_RCC_TIM5_FORCE_RESET() +#define TIM_MST_RESET_OFF __HAL_RCC_TIM5_RELEASE_RESET() + +#define TIM_MST_BIT_WIDTH 32 // 16 or 32 + +#define TIM_MST_PCLK 1 // Select the peripheral clock number (1 or 2) + + +#ifdef __cplusplus +} +#endif + +#endif // __US_TICKER_DATA_H + diff --git a/targets/TARGET_STM/hal_tick_16b.c b/targets/TARGET_STM/hal_tick_16b.c deleted file mode 100644 index 32d67c96b80..00000000000 --- a/targets/TARGET_STM/hal_tick_16b.c +++ /dev/null @@ -1,114 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2016 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "hal_tick.h" - -// A 16-bit timer is used -#if TIM_MST_16BIT - -extern TIM_HandleTypeDef TimMasterHandle; - -volatile uint32_t PreviousVal = 0; - -void us_ticker_irq_handler(void); - -#if defined(TARGET_STM32F0) -void timer_update_irq_handler(void) -{ -#else -void timer_irq_handler(void) -{ -#endif - TimMasterHandle.Instance = TIM_MST; - -#if defined(TARGET_STM32F0) -} // end timer_update_irq_handler function - -// Channel 1 used for mbed timeout -void timer_oc_irq_handler(void) -{ - TimMasterHandle.Instance = TIM_MST; -#endif - - // Channel 1 for mbed timeout - if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1) == SET) { - if (__HAL_TIM_GET_IT_SOURCE(&TimMasterHandle, TIM_IT_CC1) == SET) { - __HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC1); - us_ticker_irq_handler(); - } - } -} - -// Overwrite the default ST HAL function (defined as "weak") in order to configure an HW timer -// used for mbed timeouts only (not used for the Systick configuration). -// Additional notes: -// - The default ST HAL_InitTick function initializes the Systick to 1 ms and this is not correct for mbed -// as the mbed Systick as to be configured to 1 us instead. -// - Furthermore the Systick is configured by mbed RTOS directly. -HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) -{ - // Enable timer clock - TIM_MST_RCC; - - // Reset timer - TIM_MST_RESET_ON; - TIM_MST_RESET_OFF; - - // Update the SystemCoreClock variable - SystemCoreClockUpdate(); - - // Configure time base - TimMasterHandle.Instance = TIM_MST; - TimMasterHandle.Init.Period = 0xFFFF; - TimMasterHandle.Init.Prescaler = (uint32_t)(SystemCoreClock / 1000000) - 1; // 1 us tick - TimMasterHandle.Init.ClockDivision = 0; - TimMasterHandle.Init.CounterMode = TIM_COUNTERMODE_UP; -#if !defined(TARGET_STM32L0) && !defined(TARGET_STM32L1) - TimMasterHandle.Init.RepetitionCounter = 0; -#endif -#ifdef TIM_AUTORELOAD_PRELOAD_DISABLE - TimMasterHandle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; -#endif - HAL_TIM_Base_Init(&TimMasterHandle); - - // Configure output compare channel 1 for mbed timeout (enabled later when used) - HAL_TIM_OC_Start(&TimMasterHandle, TIM_CHANNEL_1); - - // Output compare channel 1 interrupt for mbed timeout -#if defined(TARGET_STM32F0) - NVIC_SetVector(TIM_MST_UP_IRQ, (uint32_t)timer_update_irq_handler); - NVIC_EnableIRQ(TIM_MST_UP_IRQ); - NVIC_SetPriority(TIM_MST_UP_IRQ, 0); - NVIC_SetVector(TIM_MST_OC_IRQ, (uint32_t)timer_oc_irq_handler); - NVIC_EnableIRQ(TIM_MST_OC_IRQ); - NVIC_SetPriority(TIM_MST_OC_IRQ, 1); -#else - NVIC_SetVector(TIM_MST_IRQ, (uint32_t)timer_irq_handler); - NVIC_EnableIRQ(TIM_MST_IRQ); -#endif - - // Enable timer - HAL_TIM_Base_Start(&TimMasterHandle); - - // Freeze timer on stop/breakpoint - // Define the FREEZE_TIMER_ON_DEBUG macro in mbed_app.json for example -#if !defined(NDEBUG) && defined(FREEZE_TIMER_ON_DEBUG) && defined(TIM_MST_DBGMCU_FREEZE) - TIM_MST_DBGMCU_FREEZE; -#endif - - return HAL_OK; -} - -#endif // TIM_MST_16BIT diff --git a/targets/TARGET_STM/hal_tick_32b.c b/targets/TARGET_STM/hal_tick_32b.c deleted file mode 100644 index d056268c2e9..00000000000 --- a/targets/TARGET_STM/hal_tick_32b.c +++ /dev/null @@ -1,107 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2016 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "hal_tick.h" - -// A 32-bit timer is used -#if !TIM_MST_16BIT - -extern TIM_HandleTypeDef TimMasterHandle; - -volatile uint32_t PreviousVal = 0; - -void us_ticker_irq_handler(void); - -void timer_irq_handler(void) -{ - // Channel 1 for mbed timeout - if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1) == SET) { - if (__HAL_TIM_GET_IT_SOURCE(&TimMasterHandle, TIM_IT_CC1) == SET) { - __HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC1); - us_ticker_irq_handler(); - } - } -} - -// Overwrite the default ST HAL function (defined as "weak") in order to configure an HW timer -// used for mbed timeouts only (not used for the Systick configuration). -// Additional notes: -// - The default ST HAL_InitTick function initializes the Systick to 1 ms and this is not correct for mbed -// as the mbed Systick as to be configured to 1 us instead. -// - Furthermore the Systick is configured by mbed RTOS directly. -HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) -{ - RCC_ClkInitTypeDef RCC_ClkInitStruct; - uint32_t PclkFreq; - - // Get clock configuration - // Note: PclkFreq contains here the Latency (not used after) - HAL_RCC_GetClockConfig(&RCC_ClkInitStruct, &PclkFreq); - - // Get timer clock value -#if TIM_MST_PCLK == 1 - PclkFreq = HAL_RCC_GetPCLK1Freq(); -#else - PclkFreq = HAL_RCC_GetPCLK2Freq(); -#endif - - // Enable timer clock - TIM_MST_RCC; - - // Reset timer - TIM_MST_RESET_ON; - TIM_MST_RESET_OFF; - - // Configure time base - TimMasterHandle.Instance = TIM_MST; - TimMasterHandle.Init.Period = 0xFFFFFFFF; - - // TIMxCLK = PCLKx when the APB prescaler = 1 else TIMxCLK = 2 * PCLKx -#if TIM_MST_PCLK == 1 - if (RCC_ClkInitStruct.APB1CLKDivider == RCC_HCLK_DIV1) { -#else - if (RCC_ClkInitStruct.APB2CLKDivider == RCC_HCLK_DIV1) { -#endif - TimMasterHandle.Init.Prescaler = (uint16_t)((PclkFreq) / 1000000) - 1; // 1 us tick - } else { - TimMasterHandle.Init.Prescaler = (uint16_t)((PclkFreq * 2) / 1000000) - 1; // 1 us tick - } - - TimMasterHandle.Init.ClockDivision = 0; - TimMasterHandle.Init.CounterMode = TIM_COUNTERMODE_UP; -#if !TARGET_STM32L1 - TimMasterHandle.Init.RepetitionCounter = 0; -#endif -#ifdef TIM_AUTORELOAD_PRELOAD_DISABLE - TimMasterHandle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; -#endif - HAL_TIM_OC_Init(&TimMasterHandle); - - NVIC_SetVector(TIM_MST_IRQ, (uint32_t)timer_irq_handler); - NVIC_EnableIRQ(TIM_MST_IRQ); - - // Channel 1 for mbed timeout - HAL_TIM_OC_Start(&TimMasterHandle, TIM_CHANNEL_1); - - // Freeze timer on stop/breakpoint - // Define the FREEZE_TIMER_ON_DEBUG macro in mbed_app.json for example -#if !defined(NDEBUG) && defined(FREEZE_TIMER_ON_DEBUG) && defined(TIM_MST_DBGMCU_FREEZE) - TIM_MST_DBGMCU_FREEZE; -#endif - - return HAL_OK; -} - -#endif // !TIM_MST_16BIT diff --git a/targets/TARGET_STM/hal_tick_common.c b/targets/TARGET_STM/hal_tick_common.c deleted file mode 100644 index b5f3aff9b3a..00000000000 --- a/targets/TARGET_STM/hal_tick_common.c +++ /dev/null @@ -1,33 +0,0 @@ -/* mbed Microcontroller Library - * Copyright (c) 2006-2013 ARM Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "hal/us_ticker_api.h" - -// Overwrite default HAL functions defined as "weak" - -uint32_t HAL_GetTick() -{ - return ticker_read_us(get_us_ticker_data()) / 1000; // 1 ms tick is required for ST HAL -} - -void HAL_SuspendTick(void) -{ - // Do nothing -} - -void HAL_ResumeTick(void) -{ - // Do nothing -} diff --git a/targets/TARGET_STM/hal_tick_overrides.c b/targets/TARGET_STM/hal_tick_overrides.c new file mode 100644 index 00000000000..af0f1347c2e --- /dev/null +++ b/targets/TARGET_STM/hal_tick_overrides.c @@ -0,0 +1,79 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2018 ARM Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "hal/us_ticker_api.h" +#include "us_ticker_data.h" + +// This variable is set to 1 at the of mbed_sdk_init function. +// The ticker_read_us function must not be called until the mbed_sdk_init is terminated. +extern int mbed_sdk_inited; + +// Defined in us_ticker.c +void init_16bit_timer(void); +void init_32bit_timer(void); + +#if TIM_MST_BIT_WIDTH == 16 +// Variables also reset in us_ticker_init() +uint32_t prev_time = 0; +uint32_t elapsed_time = 0; +#endif + +// Overwrite default HAL functions defined as "weak" + +HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) +{ +#if TIM_MST_BIT_WIDTH == 16 + init_16bit_timer(); +#else + init_32bit_timer(); +#endif + return HAL_OK; +} + +uint32_t HAL_GetTick() +{ +#if TIM_MST_BIT_WIDTH == 16 + uint32_t new_time; + if (mbed_sdk_inited) { + // Apply the latest time recorded just before the sdk is inited + new_time = ticker_read_us(get_us_ticker_data()) + prev_time; + prev_time = 0; // Use this time only once + return (new_time / 1000); + } + else { + new_time = us_ticker_read(); + elapsed_time += (new_time - prev_time) & 0xFFFF; // Only use the lower 16 bits + prev_time = new_time; + return (elapsed_time / 1000); + } +#else // 32-bit timer + if (mbed_sdk_inited) { + return (ticker_read_us(get_us_ticker_data()) / 1000); + } + else { + return (us_ticker_read() / 1000); + } +#endif +} + +void HAL_SuspendTick(void) +{ + // Do nothing +} + +void HAL_ResumeTick(void) +{ + // Do nothing +} diff --git a/targets/TARGET_STM/lp_ticker.c b/targets/TARGET_STM/lp_ticker.c index b5601fd0304..702ea878d6b 100644 --- a/targets/TARGET_STM/lp_ticker.c +++ b/targets/TARGET_STM/lp_ticker.c @@ -60,18 +60,11 @@ static void (*irq_handler)(void); void lp_ticker_init(void) { - NVIC_DisableIRQ(LPTIM1_IRQn); - /* Check if LPTIM is already configured */ -#if (TARGET_STM32L0) - if (READ_BIT(RCC->APB1ENR, RCC_APB1ENR_LPTIM1EN) != RESET) { - return; - } -#else if (__HAL_RCC_LPTIM1_IS_CLK_ENABLED()) { + lp_ticker_disable_interrupt(); return; } -#endif RCC_PeriphCLKInitTypeDef RCC_PeriphCLKInitStruct = {0}; RCC_OscInitTypeDef RCC_OscInitStruct = {0}; @@ -153,6 +146,7 @@ void lp_ticker_init(void) __HAL_LPTIM_ENABLE_IT(&LptimHandle, LPTIM_IT_CMPM); HAL_LPTIM_Counter_Start(&LptimHandle, 0xFFFF); + /* Need to write a compare value in order to get LPTIM_FLAG_CMPOK in set_interrupt */ __HAL_LPTIM_COMPARE_SET(&LptimHandle, 0); } @@ -201,7 +195,7 @@ void lp_ticker_set_interrupt(timestamp_t timestamp) irq_handler = (void (*)(void))lp_ticker_irq_handler; /* CMPOK is set by hardware to inform application that the APB bus write operation to the LPTIM_CMP register has been successfully completed */ - /* Any successive write before respectively the ARROK flag or the CMPOK flag be set, will lead to unpredictable results */ + /* Any successive write before the CMPOK flag be set, will lead to unpredictable results */ while (__HAL_LPTIM_GET_FLAG(&LptimHandle, LPTIM_FLAG_CMPOK) == RESET) { } @@ -221,8 +215,11 @@ void lp_ticker_fire_interrupt(void) void lp_ticker_disable_interrupt(void) { - LptimHandle.Instance = LPTIM1; NVIC_DisableIRQ(LPTIM1_IRQn); + LptimHandle.Instance = LPTIM1; + /* Waiting last write operation completion */ + while (__HAL_LPTIM_GET_FLAG(&LptimHandle, LPTIM_FLAG_CMPOK) == RESET) { + } } void lp_ticker_clear_interrupt(void) diff --git a/targets/TARGET_STM/mbed_overrides.c b/targets/TARGET_STM/mbed_overrides.c index f2c1d711758..9f794ed3395 100644 --- a/targets/TARGET_STM/mbed_overrides.c +++ b/targets/TARGET_STM/mbed_overrides.c @@ -27,6 +27,8 @@ */ #include "cmsis.h" +int mbed_sdk_inited = 0; + // This function is called after RAM initialization and before main. void mbed_sdk_init() { @@ -51,4 +53,6 @@ void mbed_sdk_init() AHB/APBx prescalers and Flash settings */ SetSysClock(); SystemCoreClockUpdate(); + + mbed_sdk_inited = 1; } diff --git a/targets/TARGET_STM/rtc_api.c b/targets/TARGET_STM/rtc_api.c index d048add6966..7a0e99a1e30 100644 --- a/targets/TARGET_STM/rtc_api.c +++ b/targets/TARGET_STM/rtc_api.c @@ -33,6 +33,14 @@ #include "rtc_api_hal.h" #include "mbed_mktime.h" #include "mbed_error.h" +#include "mbed_critical.h" + +#if DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM +volatile uint32_t LP_continuous_time = 0; +volatile uint32_t LP_last_RTC_time = 0; +#endif + +static int RTC_inited = 0; static RTC_HandleTypeDef RtcHandle; @@ -41,18 +49,15 @@ void rtc_init(void) RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; + if (RTC_inited) { + return; + } + RTC_inited = 1; + // Enable access to Backup domain __HAL_RCC_PWR_CLK_ENABLE(); HAL_PWR_EnableBkUpAccess(); -#if DEVICE_LPTICKER - if ((rtc_isenabled()) && ((RTC->PRER & RTC_PRER_PREDIV_S) == PREDIV_S_VALUE)) { -#else /* DEVICE_LPTICKER */ - if (rtc_isenabled()) { -#endif /* DEVICE_LPTICKER */ - return; - } - #if MBED_CONF_TARGET_LSE_AVAILABLE RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; // Mandatory, otherwise the PLL is reconfigured! @@ -114,48 +119,20 @@ void rtc_init(void) error("RTC initialization failed"); } - rtc_synchronize(); // Wait for RSF - - if (!rtc_isenabled()) { - rtc_write(0); +#if !(TARGET_STM32F1) && !(TARGET_STM32F2) + /* STM32F1 : there are no shadow registers */ + /* STM32F2 : shadow registers can not be bypassed */ + if (HAL_RTCEx_EnableBypassShadow(&RtcHandle) != HAL_OK) { + error("EnableBypassShadow error"); } +#endif /* TARGET_STM32F1 || TARGET_STM32F2 */ } void rtc_free(void) { - // Disable access to Backup domain - HAL_PWR_DisableBkUpAccess(); + /* RTC clock can not be reset */ } -/* - ST RTC_DateTypeDef structure - WeekDay 1=monday, 2=tuesday, ..., 7=sunday - Month 0x1=january, 0x2=february, ..., 0x12=december - Date day of the month 1-31 - Year year 0-99 - - ST RTC_TimeTypeDef structure - Hours 0-12 if the RTC_HourFormat_12 is selected during init - 0-23 if the RTC_HourFormat_24 is selected during init - Minutes 0-59 - Seconds 0-59 - TimeFormat RTC_HOURFORMAT12_AM/RTC_HOURFORMAT12_PM - SubSeconds time unit range between [0-1] Second with [1 Sec / SecondFraction +1] granularity - SecondFraction range or granularity of Sub Second register content corresponding to Synchronous pre-scaler factor value (PREDIV_S) - DayLightSaving RTC_DAYLIGHTSAVING_SUB1H/RTC_DAYLIGHTSAVING_ADD1H/RTC_DAYLIGHTSAVING_NONE - StoreOperation RTC_STOREOPERATION_RESET/RTC_STOREOPERATION_SET - - struct tm - tm_sec seconds after the minute 0-61 - tm_min minutes after the hour 0-59 - tm_hour hours since midnight 0-23 - tm_mday day of the month 1-31 - tm_mon months since January 0-11 - tm_year years since 1900 - tm_wday days since Sunday 0-6 - tm_yday days since January 1 0-365 - tm_isdst Daylight Saving Time flag -*/ /* Information about STM32F0, STM32F2, STM32F3, STM32F4, STM32F7, STM32L0, STM32L1, STM32L4: @@ -172,7 +149,7 @@ Information about STM32F1: For date, there is no specific register, only a software structure. It is then not a problem to not use shifts. */ - +#if TARGET_STM32F1 time_t rtc_read(void) { RTC_DateTypeDef dateStruct = {0}; @@ -186,7 +163,6 @@ time_t rtc_read(void) HAL_RTC_GetTime(&RtcHandle, &timeStruct, RTC_FORMAT_BIN); HAL_RTC_GetDate(&RtcHandle, &dateStruct, RTC_FORMAT_BIN); -#if TARGET_STM32F1 /* date information is null before first write procedure */ /* set 01/01/1970 as default values */ if (dateStruct.Year == 0) { @@ -194,7 +170,6 @@ time_t rtc_read(void) dateStruct.Month = 1 ; dateStruct.Date = 1 ; } -#endif // Setup a tm structure based on the RTC /* tm_wday information is ignored by _rtc_maketime */ @@ -215,11 +190,57 @@ time_t rtc_read(void) return t; } +#else /* TARGET_STM32F1 */ + +time_t rtc_read(void) +{ + struct tm timeinfo; + + /* Since the shadow registers are bypassed we have to read the time twice and compare them until both times are the same */ + uint32_t Read_time = RTC->TR & RTC_TR_RESERVED_MASK; + uint32_t Read_date = RTC->DR & RTC_DR_RESERVED_MASK; + + while ((Read_time != (RTC->TR & RTC_TR_RESERVED_MASK)) || (Read_date != (RTC->DR & RTC_DR_RESERVED_MASK))) { + Read_time = RTC->TR & RTC_TR_RESERVED_MASK; + Read_date = RTC->DR & RTC_DR_RESERVED_MASK; + } + + /* Setup a tm structure based on the RTC + struct tm : + tm_sec seconds after the minute 0-61 + tm_min minutes after the hour 0-59 + tm_hour hours since midnight 0-23 + tm_mday day of the month 1-31 + tm_mon months since January 0-11 + tm_year years since 1900 + tm_yday information is ignored by _rtc_maketime + tm_wday information is ignored by _rtc_maketime + tm_isdst information is ignored by _rtc_maketime + */ + timeinfo.tm_mday = RTC_Bcd2ToByte((uint8_t)(Read_date & (RTC_DR_DT | RTC_DR_DU))); + timeinfo.tm_mon = RTC_Bcd2ToByte((uint8_t)((Read_date & (RTC_DR_MT | RTC_DR_MU)) >> 8)) - 1; + timeinfo.tm_year = RTC_Bcd2ToByte((uint8_t)((Read_date & (RTC_DR_YT | RTC_DR_YU)) >> 16)) + 68; + timeinfo.tm_hour = RTC_Bcd2ToByte((uint8_t)((Read_time & (RTC_TR_HT | RTC_TR_HU)) >> 16)); + timeinfo.tm_min = RTC_Bcd2ToByte((uint8_t)((Read_time & (RTC_TR_MNT | RTC_TR_MNU)) >> 8)); + timeinfo.tm_sec = RTC_Bcd2ToByte((uint8_t)((Read_time & (RTC_TR_ST | RTC_TR_SU)) >> 0)); + + // Convert to timestamp + time_t t; + if (_rtc_maketime(&timeinfo, &t, RTC_4_YEAR_LEAP_YEAR_SUPPORT) == false) { + return 0; + } + + return t; +} + +#endif /* TARGET_STM32F1 */ + void rtc_write(time_t t) { RTC_DateTypeDef dateStruct = {0}; RTC_TimeTypeDef timeStruct = {0}; + core_util_critical_section_enter(); RtcHandle.Instance = RTC; // Convert the time into a tm @@ -247,6 +268,17 @@ void rtc_write(time_t t) timeStruct.StoreOperation = RTC_STOREOPERATION_RESET; #endif /* TARGET_STM32F1 */ +#if DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM + /* Need to update LP_continuous_time value before new RTC time */ + uint32_t current_lp_time = rtc_read_lp(); + + /* LP_last_RTC_time value is updated with the new RTC time */ + LP_last_RTC_time = timeStruct.Seconds + timeStruct.Minutes * 60 + timeStruct.Hours * 60 * 60; + + /* Save current SSR */ + uint32_t Read_SubSeconds = (uint32_t)(RTC->SSR); +#endif /* DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM */ + // Change the RTC current date/time if (HAL_RTC_SetDate(&RtcHandle, &dateStruct, RTC_FORMAT_BIN) != HAL_OK) { error("HAL_RTC_SetDate error\n"); @@ -254,24 +286,24 @@ void rtc_write(time_t t) if (HAL_RTC_SetTime(&RtcHandle, &timeStruct, RTC_FORMAT_BIN) != HAL_OK) { error("HAL_RTC_SetTime error\n"); } + +#if DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM + while (Read_SubSeconds != (RTC->SSR)) { + } +#endif /* DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM */ + + core_util_critical_section_exit(); } int rtc_isenabled(void) { #if !(TARGET_STM32F1) - return (((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) && ((RTC->ISR & RTC_ISR_RSF) == RTC_ISR_RSF)); + return ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS); #else /* TARGET_STM32F1 */ return ((RTC->CRL & RTC_CRL_RSF) == RTC_CRL_RSF); #endif /* TARGET_STM32F1 */ } -void rtc_synchronize(void) -{ - RtcHandle.Instance = RTC; - if (HAL_RTC_WaitForSynchro(&RtcHandle) != HAL_OK) { - error("rtc_synchronize error\n"); - } -} #if DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM @@ -279,8 +311,6 @@ static void RTC_IRQHandler(void); static void (*irq_handler)(void); volatile uint8_t lp_Fired = 0; -volatile uint32_t LP_continuous_time = 0; -volatile uint32_t LP_last_RTC_time = 0; static void RTC_IRQHandler(void) { @@ -311,31 +341,34 @@ static void RTC_IRQHandler(void) uint32_t rtc_read_lp(void) { - RTC_TimeTypeDef timeStruct = {0}; - RTC_DateTypeDef dateStruct = {0}; - - RtcHandle.Instance = RTC; - HAL_RTC_GetTime(&RtcHandle, &timeStruct, RTC_FORMAT_BIN); + struct tm timeinfo; - /* Reading RTC current time locks the values in calendar shadow registers until Current date is read - to ensure consistency between the time and date values */ - HAL_RTC_GetDate(&RtcHandle, &dateStruct, RTC_FORMAT_BIN); + /* Since the shadow registers are bypassed we have to read the time twice and compare them until both times are the same */ + /* We don't have to read date as we bypass shadow registers */ + uint32_t Read_SecondFraction = (uint32_t)(RTC->PRER & RTC_PRER_PREDIV_S); + uint32_t Read_time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); + uint32_t Read_SubSeconds = (uint32_t)(RTC->SSR); - if (timeStruct.SubSeconds > timeStruct.SecondFraction) { - /* SS can be larger than PREDIV_S only after a shift operation. In that case, the correct - time/date is one second less than as indicated by RTC_TR/RTC_DR. */ - timeStruct.Seconds -= 1; + while ((Read_time != (RTC->TR & RTC_TR_RESERVED_MASK)) || (Read_SubSeconds != (RTC->SSR))) { + Read_time = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); + Read_SubSeconds = (uint32_t)(RTC->SSR); } - uint32_t RTC_time_s = timeStruct.Seconds + timeStruct.Minutes * 60 + timeStruct.Hours * 60 * 60; // Max 0x0001-517F => * 8191 + 8191 = 0x2A2E-AE80 + + timeinfo.tm_hour = RTC_Bcd2ToByte((uint8_t)((Read_time & (RTC_TR_HT | RTC_TR_HU)) >> 16)); + timeinfo.tm_min = RTC_Bcd2ToByte((uint8_t)((Read_time & (RTC_TR_MNT | RTC_TR_MNU)) >> 8)); + timeinfo.tm_sec = RTC_Bcd2ToByte((uint8_t)((Read_time & (RTC_TR_ST | RTC_TR_SU)) >> 0)); + + uint32_t RTC_time_s = timeinfo.tm_sec + timeinfo.tm_min * 60 + timeinfo.tm_hour * 60 * 60; // Max 0x0001-517F => * 8191 + 8191 = 0x2A2E-AE80 if (LP_last_RTC_time <= RTC_time_s) { LP_continuous_time += (RTC_time_s - LP_last_RTC_time); } else { + /* Add 24h */ LP_continuous_time += (24 * 60 * 60 + RTC_time_s - LP_last_RTC_time); } LP_last_RTC_time = RTC_time_s; - return LP_continuous_time * PREDIV_S_VALUE + timeStruct.SecondFraction - timeStruct.SubSeconds; + return LP_continuous_time * PREDIV_S_VALUE + Read_SecondFraction - Read_SubSeconds; } void rtc_set_wake_up_timer(timestamp_t timestamp) @@ -377,7 +410,11 @@ void rtc_fire_interrupt(void) void rtc_deactivate_wake_up_timer(void) { RtcHandle.Instance = RTC; - HAL_RTCEx_DeactivateWakeUpTimer(&RtcHandle); + __HAL_RTC_WRITEPROTECTION_DISABLE(&RtcHandle); + __HAL_RTC_WAKEUPTIMER_DISABLE(&RtcHandle); + __HAL_RTC_WAKEUPTIMER_DISABLE_IT(&RtcHandle, RTC_IT_WUT); + __HAL_RTC_WRITEPROTECTION_ENABLE(&RtcHandle); + NVIC_DisableIRQ(RTC_WKUP_IRQn); } #endif /* DEVICE_LPTICKER && !MBED_CONF_TARGET_LPTICKER_LPTIM */ diff --git a/targets/TARGET_STM/serial_api.c b/targets/TARGET_STM/serial_api.c index 065418c74bd..d245a58cf65 100644 --- a/targets/TARGET_STM/serial_api.c +++ b/targets/TARGET_STM/serial_api.c @@ -32,6 +32,11 @@ #include "serial_api_hal.h" +// Possible choices of the LPUART_CLOCK_SOURCE configuration set in json file +#define USE_LPUART_CLK_LSE 0x01 +#define USE_LPUART_CLK_PCLK1 0x02 +#define USE_LPUART_CLK_HSI 0x04 + int stdio_uart_inited = 0; // used in platform/mbed_board.c and platform/mbed_retarget.cpp serial_t stdio_uart; @@ -367,29 +372,64 @@ void serial_baud(serial_t *obj, int baudrate) struct serial_s *obj_s = SERIAL_S(obj); obj_s->baudrate = baudrate; + #if defined(LPUART1_BASE) /* Note that LPUART clock source must be in the range [3 x baud rate, 4096 x baud rate], check Ref Manual */ if (obj_s->uart == LPUART_1) { - /* If baudrate is lower than 9600 try to change to LSE */ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; - if (baudrate <= 9600 && __HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY)) { - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LPUART1; - PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_LSE; - HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); - } else { - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LPUART1; - PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1; - HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LPUART1; +#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_LSE) + if (baudrate <= 9600) { + // Enable LSE in case it is not already done + if (!__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY)) { + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE; + RCC_OscInitStruct.HSIState = RCC_LSE_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_OFF; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + } + // Keep it to verify if HAL_RCC_OscConfig didn't exit with a timeout + if (__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY)) { + PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_LSE; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + if (init_uart(obj) == HAL_OK) { + return; + } + } } +#endif +#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_PCLK1) + PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); if (init_uart(obj) == HAL_OK) { return; } - /* Change LPUART clock source and try again */ - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LPUART1; +#endif +#if ((MBED_CONF_TARGET_LPUART_CLOCK_SOURCE) & USE_LPUART_CLK_HSI) + // Enable HSI in case it is not already done + if (!__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY)) { + RCC_OscInitTypeDef RCC_OscInitStruct = {0}; + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_OFF; + RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + } + // Keep it to verify if HAL_RCC_OscConfig didn't exit with a timeout + if (__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY)) { + PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_HSI; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + if (init_uart(obj) == HAL_OK) { + return; + } + } +#endif + // Last chance using SYSCLK PeriphClkInitStruct.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_SYSCLK; HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); } #endif /* LPUART1_BASE */ + if (init_uart(obj) != HAL_OK) { debug("Cannot initialize UART with baud rate %u\n", baudrate); } diff --git a/targets/TARGET_STM/sleep.c b/targets/TARGET_STM/sleep.c index 5769f3f13d5..866a46aff81 100644 --- a/targets/TARGET_STM/sleep.c +++ b/targets/TARGET_STM/sleep.c @@ -31,11 +31,12 @@ #include "sleep_api.h" #include "us_ticker_api.h" -#include "hal_tick.h" +#include "us_ticker_data.h" #include "mbed_critical.h" #include "mbed_error.h" -extern void rtc_synchronize(void); +extern void save_timer_ctx(void); +extern void restore_timer_ctx(void); /* Wait loop - assuming tick is 1 us */ static void wait_loop(uint32_t timeout) @@ -161,7 +162,7 @@ void hal_deepsleep(void) // Disable IRQs core_util_critical_section_enter(); - uint32_t EnterTimeUS = us_ticker_read(); + save_timer_ctx(); // Request to enter STOP mode with regulator in low power mode #if TARGET_STM32L4 @@ -186,6 +187,7 @@ void hal_deepsleep(void) #else /* TARGET_STM32L4 */ HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); #endif /* TARGET_STM32L4 */ + // Verify Clock Out of Deep Sleep ForceClockOutofDeepSleep(); @@ -198,20 +200,8 @@ void hal_deepsleep(void) * deep sleep */ wait_loop(500); - TIM_HandleTypeDef TimMasterHandle; - TimMasterHandle.Instance = TIM_MST; - __HAL_TIM_SET_COUNTER(&TimMasterHandle, EnterTimeUS); - -#if DEVICE_RTC - /* Wait for RTC RSF bit synchro if RTC is configured */ -#if (TARGET_STM32F2) || (TARGET_STM32F4) || (TARGET_STM32F7) - if (READ_BIT(RCC->BDCR, RCC_BDCR_RTCSEL)) { -#else /* (TARGET_STM32F2) || (TARGET_STM32F4) || (TARGET_STM32F7) */ - if (__HAL_RCC_GET_RTC_SOURCE()) { -#endif /* (TARGET_STM32F2) || (TARGET_STM32F4) || (TARGET_STM32F7) */ - rtc_synchronize(); - } -#endif + restore_timer_ctx(); + // Enable IRQs core_util_critical_section_exit(); } diff --git a/targets/TARGET_STM/us_ticker.c b/targets/TARGET_STM/us_ticker.c index db4a9e96ab4..a04f70527d6 100644 --- a/targets/TARGET_STM/us_ticker.c +++ b/targets/TARGET_STM/us_ticker.c @@ -1,5 +1,5 @@ /* mbed Microcontroller Library - * Copyright (c) 2006-2016 ARM Limited + * Copyright (c) 2006-2018 ARM Limited * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,28 +16,195 @@ #include #include "us_ticker_api.h" #include "PeripheralNames.h" -#include "hal_tick.h" - -#if TIM_MST_16BIT -#define TIMER_TICKER_BIT_WIDTH 16 -#else -#define TIMER_TICKER_BIT_WIDTH 32 -#endif +#include "us_ticker_data.h" TIM_HandleTypeDef TimMasterHandle; +uint32_t timer_cnt_reg; +uint32_t timer_ccr1_reg; +uint32_t timer_dier_reg; + const ticker_info_t *us_ticker_get_info() { static const ticker_info_t info = { 1000000, - TIMER_TICKER_BIT_WIDTH + TIM_MST_BIT_WIDTH }; return &info; } +void us_ticker_irq_handler(void); + +// ************************************ 16-bit timer ************************************ +#if TIM_MST_BIT_WIDTH == 16 + +extern uint32_t prev_time; +extern uint32_t elapsed_time; + +#if defined(TARGET_STM32F0) +void timer_update_irq_handler(void) +{ +#else +void timer_irq_handler(void) +{ +#endif + TimMasterHandle.Instance = TIM_MST; + +#if defined(TARGET_STM32F0) +} // end timer_update_irq_handler function + +void timer_oc_irq_handler(void) +{ + TimMasterHandle.Instance = TIM_MST; +#endif + if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1) == SET) { + if (__HAL_TIM_GET_IT_SOURCE(&TimMasterHandle, TIM_IT_CC1) == SET) { + __HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC1); + us_ticker_irq_handler(); + } + } +} + +void init_16bit_timer(void) +{ + // Enable timer clock + TIM_MST_RCC; + + // Reset timer + TIM_MST_RESET_ON; + TIM_MST_RESET_OFF; + + // Update the SystemCoreClock variable + SystemCoreClockUpdate(); + + // Configure time base + TimMasterHandle.Instance = TIM_MST; + TimMasterHandle.Init.Period = 0xFFFF; + TimMasterHandle.Init.Prescaler = (uint32_t)(SystemCoreClock / 1000000) - 1; // 1 us tick + TimMasterHandle.Init.ClockDivision = 0; + TimMasterHandle.Init.CounterMode = TIM_COUNTERMODE_UP; +#if !defined(TARGET_STM32L0) && !defined(TARGET_STM32L1) + TimMasterHandle.Init.RepetitionCounter = 0; +#endif +#ifdef TIM_AUTORELOAD_PRELOAD_DISABLE + TimMasterHandle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; +#endif + HAL_TIM_Base_Init(&TimMasterHandle); + + // Configure output compare channel 1 for mbed timeout (enabled later when used) + HAL_TIM_OC_Start(&TimMasterHandle, TIM_CHANNEL_1); + + // Output compare channel 1 interrupt for mbed timeout +#if defined(TARGET_STM32F0) + NVIC_SetVector(TIM_MST_UP_IRQ, (uint32_t)timer_update_irq_handler); + NVIC_EnableIRQ(TIM_MST_UP_IRQ); + NVIC_SetPriority(TIM_MST_UP_IRQ, 0); + NVIC_SetVector(TIM_MST_OC_IRQ, (uint32_t)timer_oc_irq_handler); + NVIC_EnableIRQ(TIM_MST_OC_IRQ); + NVIC_SetPriority(TIM_MST_OC_IRQ, 1); +#else + NVIC_SetVector(TIM_MST_IRQ, (uint32_t)timer_irq_handler); + NVIC_EnableIRQ(TIM_MST_IRQ); +#endif + + // Enable timer + HAL_TIM_Base_Start(&TimMasterHandle); + + // Freeze timer on stop/breakpoint + // Define the FREEZE_TIMER_ON_DEBUG macro in mbed_app.json for example +#if !defined(NDEBUG) && defined(FREEZE_TIMER_ON_DEBUG) && defined(TIM_MST_DBGMCU_FREEZE) + TIM_MST_DBGMCU_FREEZE; +#endif + + __HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC1); + + // Used by HAL_GetTick() + prev_time = 0; + elapsed_time = 0; +} + +// ************************************ 32-bit timer ************************************ +#else + +void timer_irq_handler(void) +{ + TimMasterHandle.Instance = TIM_MST; + if (__HAL_TIM_GET_FLAG(&TimMasterHandle, TIM_FLAG_CC1) == SET) { + if (__HAL_TIM_GET_IT_SOURCE(&TimMasterHandle, TIM_IT_CC1) == SET) { + __HAL_TIM_CLEAR_IT(&TimMasterHandle, TIM_IT_CC1); + us_ticker_irq_handler(); + } + } +} + +void init_32bit_timer(void) +{ + RCC_ClkInitTypeDef RCC_ClkInitStruct; + uint32_t PclkFreq; + + // Get clock configuration + // Note: PclkFreq contains here the Latency (not used after) + HAL_RCC_GetClockConfig(&RCC_ClkInitStruct, &PclkFreq); + + // Get timer clock value +#if TIM_MST_PCLK == 1 + PclkFreq = HAL_RCC_GetPCLK1Freq(); +#else + PclkFreq = HAL_RCC_GetPCLK2Freq(); +#endif + + // Enable timer clock + TIM_MST_RCC; + + // Reset timer + TIM_MST_RESET_ON; + TIM_MST_RESET_OFF; + + // Configure time base + TimMasterHandle.Instance = TIM_MST; + TimMasterHandle.Init.Period = 0xFFFFFFFF; + + // TIMxCLK = PCLKx when the APB prescaler = 1 else TIMxCLK = 2 * PCLKx +#if TIM_MST_PCLK == 1 + if (RCC_ClkInitStruct.APB1CLKDivider == RCC_HCLK_DIV1) { +#else + if (RCC_ClkInitStruct.APB2CLKDivider == RCC_HCLK_DIV1) { +#endif + TimMasterHandle.Init.Prescaler = (uint16_t)((PclkFreq) / 1000000) - 1; // 1 us tick + } else { + TimMasterHandle.Init.Prescaler = (uint16_t)((PclkFreq * 2) / 1000000) - 1; // 1 us tick + } + + TimMasterHandle.Init.ClockDivision = 0; + TimMasterHandle.Init.CounterMode = TIM_COUNTERMODE_UP; +#if !TARGET_STM32L1 + TimMasterHandle.Init.RepetitionCounter = 0; +#endif +#ifdef TIM_AUTORELOAD_PRELOAD_DISABLE + TimMasterHandle.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; +#endif + HAL_TIM_OC_Init(&TimMasterHandle); + + NVIC_SetVector(TIM_MST_IRQ, (uint32_t)timer_irq_handler); + NVIC_EnableIRQ(TIM_MST_IRQ); + + // Channel 1 for mbed timeout + HAL_TIM_OC_Start(&TimMasterHandle, TIM_CHANNEL_1); + + // Freeze timer on stop/breakpoint + // Define the FREEZE_TIMER_ON_DEBUG macro in mbed_app.json for example +#if !defined(NDEBUG) && defined(FREEZE_TIMER_ON_DEBUG) && defined(TIM_MST_DBGMCU_FREEZE) + TIM_MST_DBGMCU_FREEZE; +#endif + + __HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC1); +} + +#endif // 16-bit/32-bit timer + void us_ticker_init(void) { - /* NOTE: assuming that HAL tick has already been initialized! */ + // Timer is already initialized in HAL_InitTick() __HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC1); } @@ -62,11 +229,9 @@ void us_ticker_fire_interrupt(void) { __HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_CC1); LL_TIM_GenerateEvent_CC1(TimMasterHandle.Instance); - // Enable IT __HAL_TIM_ENABLE_IT(&TimMasterHandle, TIM_IT_CC1); } -/* NOTE: must be called with interrupts disabled! */ void us_ticker_disable_interrupt(void) { __HAL_TIM_DISABLE_IT(&TimMasterHandle, TIM_IT_CC1); @@ -78,3 +243,16 @@ void us_ticker_clear_interrupt(void) __HAL_TIM_CLEAR_FLAG(&TimMasterHandle, TIM_FLAG_CC1); } +void save_timer_ctx(void) +{ + timer_cnt_reg = __HAL_TIM_GET_COUNTER(&TimMasterHandle); + timer_ccr1_reg = __HAL_TIM_GET_COMPARE(&TimMasterHandle, TIM_CHANNEL_1); + timer_dier_reg = TIM_MST->DIER; +} + +void restore_timer_ctx(void) +{ + __HAL_TIM_SET_COUNTER(&TimMasterHandle, timer_cnt_reg); + __HAL_TIM_SET_COMPARE(&TimMasterHandle, TIM_CHANNEL_1, timer_ccr1_reg); + TIM_MST->DIER = timer_dier_reg; +} diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/mbed_overrides.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/mbed_overrides.c index c39707e7f09..f1c4754c217 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/mbed_overrides.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/common/mbed_overrides.c @@ -29,6 +29,7 @@ #include "device.h" #include "em_usart.h" #include "gpio_api.h" +#include "clocking.h" gpio_t bc_enable; diff --git a/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.ar b/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.ar index 6831273943e..a35d3bea929 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.ar and b/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.ar differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.ar b/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.ar index e937e50252d..b66788e1fa6 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.ar and b/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.ar differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.ar b/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.ar index 84459b2a3d5..e76307dcdc4 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.ar and b/targets/TARGET_WICED/TOOLCHAIN_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.ar differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a index 87bb8118050..af353cea565 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a index bff448018f7..06bfc1cd5d3 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a index 14f43b98053..6fd927a5d75 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_GCC_ARM/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a index 82cb391041e..f908ee0d92c 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_ADV_WISE_1530/libwiced_drivers.a differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a index 2fb820557d0..cd858cb0e8a 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_MXCHIP_EMW3166/libwiced_drivers.a differ diff --git a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a index 261091deae7..575ffd6f628 100644 Binary files a/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a and b/targets/TARGET_WICED/TOOLCHAIN_IAR/TARGET_MTB_USI_WM_BN_BM_22/libwiced_drivers.a differ diff --git a/targets/TARGET_WICED/wiced_interface/WicedInterface.h b/targets/TARGET_WICED/wiced_interface/WicedInterface.h index 80d10b0d387..1cef8522744 100644 --- a/targets/TARGET_WICED/wiced_interface/WicedInterface.h +++ b/targets/TARGET_WICED/wiced_interface/WicedInterface.h @@ -20,6 +20,7 @@ #include "mbed.h" #include "EthernetInterface.h" #include "netsocket/OnboardNetworkStack.h" +#include "wiced_emac.h" /** WicedInterface class @@ -30,7 +31,7 @@ class WicedInterface : public WiFiInterface, public EMACInterface public: WicedInterface( - EMAC &emac = EMAC::get_default_instance(), + EMAC &emac = WICED_EMAC::get_instance(), OnboardNetworkStack &stack = OnboardNetworkStack::get_default_instance()); /** Start the interface diff --git a/targets/targets.json b/targets/targets.json index a3e368ac91d..6cf7cea477c 100755 --- a/targets/targets.json +++ b/targets/targets.json @@ -735,6 +735,10 @@ "help": "Define if a Low Speed External xtal (LSE) is available on the board (0 = No, 1 = Yes). If Yes, the LSE will be used to clock the RTC, LPUART, ... otherwise the Low Speed Internal clock (LSI) will be used", "value": "1" }, + "lpuart_clock_source": { + "help": "Define the LPUART clock source. Mask values: USE_LPUART_CLK_LSE, USE_LPUART_CLK_PCLK1, USE_LPUART_CLK_HSI", + "value": "USE_LPUART_CLK_LSE|USE_LPUART_CLK_PCLK1" + }, "stdio_uart_tx": { "help": "default TX STDIO pins is defined in PinNames.h file, but it can be overridden" }, @@ -1196,6 +1200,9 @@ } }, "MTB_USI_WM_BN_BM_22": { + "overrides": { + "lse_available": 0 + }, "inherits": ["USI_WM_BN_BM_22"] }, "MTB_ADV_WISE_1530": { @@ -1716,10 +1723,11 @@ "config": { "clock_source": { "help": "Mask value : USE_PLL_HSE_EXTC (need HW patch) | USE_PLL_HSE_XTAL (need HW patch) | USE_PLL_HSI | USE_PLL_MSI", - "value": "USE_PLL_HSE_XTAL", + "value": "USE_PLL_HSI", "macro_name": "CLOCK_SOURCE" } }, + "overrides": {"lpuart_clock_source": "USE_LPUART_CLK_HSI"}, "detect_code": ["0460"], "macros_add": ["MBEDTLS_CONFIG_HW_SUPPORT", "WISE_1570", "TWO_RAM_REGIONS"], "device_has_add": ["ANALOGOUT", "CRC", "SERIAL_ASYNCH", "SERIAL_FC", "TRNG", "FLASH"], @@ -2024,7 +2032,7 @@ }, "supported_form_factors": ["ARDUINO"], "detect_code": ["0764"], - "macros_add": ["USBHOST_OTHER"], + "macros_add": ["USBHOST_OTHER", "TWO_RAM_REGIONS"], "device_has_add": ["ANALOGOUT", "CAN", "SERIAL_FC", "TRNG", "FLASH"], "release_versions": ["2", "5"], "device_name": "STM32L475VG", @@ -2046,7 +2054,7 @@ } }, "detect_code": ["0820"], - "macros_add": ["USBHOST_OTHER"], + "macros_add": ["USBHOST_OTHER", "TWO_RAM_REGIONS"], "device_has_add": ["ANALOGOUT", "CAN", "SERIAL_FC", "TRNG", "FLASH"], "release_versions": ["2", "5"], "device_name": "STM32L476VG", @@ -2819,7 +2827,7 @@ "extra_labels": ["ARM_SSG", "CM3DS_MPS2"], "OUTPUT_EXT": "elf", "macros": ["CMSDK_CM3DS"], - "device_has": ["ANALOGIN", "ETHERNET", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "SERIAL", "SPI", "TRNG"], + "device_has": ["ANALOGIN", "ETHERNET", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "SERIAL", "SPI", "TRNG", "FLASH"], "release_versions": ["2", "5"], "copy_method": "mps2", "reset_method": "reboot.txt" @@ -3626,6 +3634,12 @@ }, "device_has": ["ANALOGIN", "I2C", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SLEEP", "SPI", "SPISLAVE"] }, + "MCU_NRF51_16K_UNIFIED_S130": { + "inherits": ["MCU_NRF51_UNIFIED"], + "extra_labels_add": ["MCU_NORDIC_16K", "MCU_NRF51_16K_S130", "MCU_NRF51_16K"], + "macros_add": ["TARGET_MCU_NORDIC_16K", "TARGET_MCU_NRF51_16K_S130", "TARGET_MCU_NRF51_16K"], + "public": false + }, "MCU_NRF51_32K_UNIFIED": { "inherits": ["MCU_NRF51_UNIFIED"], "extra_labels_add": ["MCU_NORDIC_32K", "MCU_NRF51_32K"], @@ -3677,12 +3691,12 @@ "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", + "SLEEP", "SPI", "SPI_ASYNCH", "STCLK_OFF_DURING_SLEEP", "TRNG", - "USTICKER", - "SLEEP" + "USTICKER" ], "extra_labels": [ "NORDIC", @@ -3773,7 +3787,6 @@ "PORTINOUT", "PORTOUT", "PWMOUT", - "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", @@ -3855,9 +3868,9 @@ } }, "inherits": ["Target"], - "macros_add": ["MBEDTLS_CONFIG_HW_SUPPORT"], - "device_has": ["RTC", "ANALOGIN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "TRNG", "CAN", "FLASH", "EMAC"], "features": ["LWIP"], + "macros_add": ["MBEDTLS_CONFIG_HW_SUPPORT", "LPTICKER_DELAY_TICKS=3"], + "device_has": ["USTICKER", "LPTICKER", "RTC", "ANALOGIN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "TRNG", "CAN", "FLASH", "EMAC"], "release_versions": ["5"], "device_name": "NUC472HI8AE", "bootloader_supported": true, @@ -3927,8 +3940,9 @@ } }, "inherits": ["Target"], + "macros_add": ["LPTICKER_DELAY_TICKS=3"], "progen": {"target": "numaker-pfm-m453"}, - "device_has": ["RTC", "ANALOGIN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "CAN", "FLASH"], + "device_has": ["USTICKER", "LPTICKER", "RTC", "ANALOGIN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "CAN", "FLASH"], "release_versions": ["2", "5"], "device_name": "M453VG6AE", "bootloader_supported": true @@ -3955,11 +3969,16 @@ "gpio-irq-debounce-sample-rate": { "help": "Select GPIO IRQ debounce sample rate: GPIO_DBCLKSEL_1, GPIO_DBCLKSEL_2, GPIO_DBCLKSEL_4, ..., or GPIO_DBCLKSEL_32768", "value": "GPIO_DBCLKSEL_16" + }, + "clock-pll": { + "help": "Choose clock source to clock PLL: NU_HXT_PLL or NU_HIRC_PLL", + "macro_name": "NU_CLOCK_PLL", + "value": "NU_HIRC_PLL" } }, "inherits": ["Target"], - "macros": ["CMSIS_VECTAB_VIRTUAL", "CMSIS_VECTAB_VIRTUAL_HEADER_FILE=\"cmsis_nvic.h\"","MBED_FAULT_HANDLER_DISABLED"], - "device_has": ["RTC", "ANALOGIN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH"], + "macros": ["CMSIS_VECTAB_VIRTUAL", "CMSIS_VECTAB_VIRTUAL_HEADER_FILE=\"cmsis_nvic.h\"","MBED_FAULT_HANDLER_DISABLED", "LPTICKER_DELAY_TICKS=3"], + "device_has": ["USTICKER", "LPTICKER", "RTC", "ANALOGIN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH"], "release_versions": ["5"], "device_name": "NANO130KE3BN" }, @@ -4126,9 +4145,9 @@ } }, "inherits": ["Target"], - "macros_add": ["MBEDTLS_CONFIG_HW_SUPPORT"], - "device_has": ["RTC", "ANALOGIN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "TRNG", "FLASH", "CAN", "EMAC"], "features": ["LWIP"], + "macros_add": ["MBEDTLS_CONFIG_HW_SUPPORT", "LPTICKER_DELAY_TICKS=3"], + "device_has": ["USTICKER", "LPTICKER", "RTC", "ANALOGIN", "I2C", "I2CSLAVE", "I2C_ASYNCH", "INTERRUPTIN", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "STDIO_MESSAGES", "SLEEP", "SPI", "SPISLAVE", "SPI_ASYNCH", "TRNG", "FLASH", "CAN", "EMAC"], "release_versions": ["5"], "device_name": "M487JIDAE", "bootloader_supported": true, diff --git a/tools/build_api.py b/tools/build_api.py index 668c38ff1ca..17b7698f59d 100644 --- a/tools/build_api.py +++ b/tools/build_api.py @@ -137,27 +137,7 @@ def get_config(src_paths, target, toolchain_name, app_config=None): app_config=app_config) # Scan src_path for config files - resources = toolchain.scan_resources(src_paths[0]) - for path in src_paths[1:]: - resources.add(toolchain.scan_resources(path)) - - # Update configuration files until added features creates no changes - prev_features = set() - while True: - # Update the configuration with any .json files found while scanning - toolchain.config.add_config_files(resources.json_files) - - # Add features while we find new ones - features = set(toolchain.config.get_features()) - if features == prev_features: - break - - for feature in features: - if feature in resources.features: - resources += resources.features[feature] - - prev_features = features - toolchain.config.validate_config() + scan_resources(src_paths, toolchain) if toolchain.config.has_regions: _ = list(toolchain.config.regions) @@ -1073,6 +1053,7 @@ def build_mbed_libs(target, toolchain_name, clean=False, macros=None, # - mbed_overrides.o: this contains platform overrides of various # weak SDK functions # - mbed_main.o: this contains main redirection + # - PeripheralPins.o: PinMap can be weak separate_names, separate_objects = ['PeripheralPins.o', 'mbed_retarget.o', 'mbed_board.o', 'mbed_overrides.o', 'mbed_main.o', 'mbed_sdk_boot.o'], [] @@ -1138,19 +1119,18 @@ def get_unique_supported_toolchains(release_targets=None): return unique_supported_toolchains + +def _lowercase_release_version(release_version): + try: + return release_version.lower() + except AttributeError: + return 'all' + def mcu_toolchain_list(release_version='5'): """ Shows list of toolchains """ - - if isinstance(release_version, basestring): - # Force release_version to lowercase if it is a string - release_version = release_version.lower() - else: - # Otherwise default to printing all known targets and toolchains - release_version = 'all' - - + release_version = _lowercase_release_version(release_version) version_release_targets = {} version_release_target_names = {} @@ -1175,15 +1155,7 @@ def mcu_target_list(release_version='5'): """ Shows target list """ - - if isinstance(release_version, basestring): - # Force release_version to lowercase if it is a string - release_version = release_version.lower() - else: - # Otherwise default to printing all known targets and toolchains - release_version = 'all' - - + release_version = _lowercase_release_version(release_version) version_release_targets = {} version_release_target_names = {} @@ -1219,15 +1191,7 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None, """ # Only use it in this function so building works without extra modules from prettytable import PrettyTable - - if isinstance(release_version, basestring): - # Force release_version to lowercase if it is a string - release_version = release_version.lower() - else: - # Otherwise default to printing all known targets and toolchains - release_version = 'all' - - + release_version = _lowercase_release_version(release_version) version_release_targets = {} version_release_target_names = {} diff --git a/tools/config/__init__.py b/tools/config/__init__.py index ba86907b738..8a38524ed4a 100644 --- a/tools/config/__init__.py +++ b/tools/config/__init__.py @@ -53,6 +53,19 @@ class ConfigException(Exception): errors""" pass +class UndefinedParameter(ConfigException): + def __init__(self, param, name, kind, label): + self.param = param + self.name = name + self.kind = kind + self.label = label + + def __str__(self): + return "Attempt to override undefined parameter '{}' in '{}'".format( + self.param, + ConfigParameter.get_display_name(self.name, self.kind, self.label), + ) + class ConfigParameter(object): """This class keeps information about a single configuration parameter""" @@ -414,6 +427,7 @@ def __init__(self, tgt, top_level_dirs=None, app_config=None): search for a configuration file). """ config_errors = [] + self.config_errors = [] self.app_config_location = app_config if self.app_config_location is None and top_level_dirs: self.app_config_location = self.find_app_config(top_level_dirs) @@ -545,10 +559,8 @@ def sectors(self): return sectors raise ConfigException("No sector info available") - @property - def regions(self): - """Generate a list of regions from the config""" - if not self.target.bootloader_supported: + def _get_cmsis_part(self): + if not getattr(self.target, "bootloader_supported", False): raise ConfigException("Bootloader not supported on this target.") if not hasattr(self.target, "device_name"): raise ConfigException("Bootloader not supported on this target: " @@ -671,7 +683,7 @@ def _generate_bootloader_build(self, rom_start, rom_size): if start > rom_start + rom_size: raise ConfigException("Not enough memory on device to fit all " "application regions") - + @staticmethod def _find_sector(address, sectors): target_size = -1 @@ -684,13 +696,13 @@ def _find_sector(address, sectors): if (target_size < 0): raise ConfigException("No valid sector found") return target_start, target_size - + @staticmethod def _align_floor(address, sectors): target_start, target_size = Config._find_sector(address, sectors) sector_num = (address - target_start) // target_size return target_start + (sector_num * target_size) - + @staticmethod def _align_ceiling(address, sectors): target_start, target_size = Config._find_sector(address, sectors) @@ -727,7 +739,6 @@ def _process_config_and_overrides(self, data, params, unit_name, unit_kind): unit_name - the unit (library/application) that defines this parameter unit_kind - the kind of the unit ("library" or "application") """ - self.config_errors = [] _process_config_parameters(data.get("config", {}), params, unit_name, unit_kind) for label, overrides in data.get("target_overrides", {}).items(): @@ -796,13 +807,8 @@ def _process_config_and_overrides(self, data, params, unit_name, unit_kind): continue else: self.config_errors.append( - ConfigException( - "Attempt to override undefined parameter" + - (" '%s' in '%s'" - % (full_name, - ConfigParameter.get_display_name(unit_name, - unit_kind, - label))))) + UndefinedParameter( + full_name, unit_name, unit_kind, label)) for cumulatives in self.cumulative_overrides.values(): cumulatives.update_target(self.target) @@ -850,10 +856,7 @@ def get_target_config_data(self): continue if (full_name not in params) or \ (params[full_name].defined_by[7:] not in rel_names): - raise ConfigException( - "Attempt to override undefined parameter '%s' in '%s'" - % (name, - ConfigParameter.get_display_name(tname, "target"))) + raise UndefinedParameter(name, tname, "target", "") # Otherwise update the value of the parameter params[full_name].set_value(val, tname, "target") return params @@ -989,8 +992,13 @@ def validate_config(self): Arguments: None """ - if self.config_errors: - raise self.config_errors[0] + params, _ = self.get_config_data() + for error in self.config_errors: + if (isinstance(error, UndefinedParameter) and + error.param in params): + continue + else: + raise error return True @@ -1010,7 +1018,6 @@ def load_resources(self, resources): """ # Update configuration files until added features creates no changes prev_features = set() - self.validate_config() while True: # Add/update the configuration with any .json files found while # scanning diff --git a/tools/export/__init__.py b/tools/export/__init__.py index 88347157d9f..f0b46c45ce2 100644 --- a/tools/export/__init__.py +++ b/tools/export/__init__.py @@ -34,8 +34,6 @@ EXPORTERS = { u'uvision5': uvision.Uvision, - u'uvision': uvision.Uvision, - u'gcc_arm': makefile.GccArm, u'make_gcc_arm': makefile.GccArm, u'make_armc5': makefile.Armc5, u'make_armc6': makefile.Armc6, diff --git a/tools/export/exporters.py b/tools/export/exporters.py index 8524334a60b..ee900ed8eca 100644 --- a/tools/export/exporters.py +++ b/tools/export/exporters.py @@ -9,6 +9,7 @@ import copy from tools.targets import TARGET_MAP +from tools.utils import mkdir class TargetNotSupportedException(Exception): @@ -139,6 +140,7 @@ def gen_file(self, template_file, data, target_file, **kwargs): """Generates a project file from a template using jinja""" target_text = self._gen_file_inner(template_file, data, target_file, **kwargs) target_path = self.gen_file_dest(target_file) + mkdir(dirname(target_path)) logging.debug("Generating: %s", target_path) open(target_path, "w").write(target_text) self.generated_files += [target_path] diff --git a/tools/export/makefile/__init__.py b/tools/export/makefile/__init__.py index 22ffcc80234..2c94022285f 100644 --- a/tools/export/makefile/__init__.py +++ b/tools/export/makefile/__init__.py @@ -87,17 +87,14 @@ def generate(self): if (basename(dirname(dirname(self.export_dir))) == "projectfiles") else [".."]), - 'cc_cmd': " ".join(["\'" + part + "\'" for part - in ([basename(self.toolchain.cc[0])] + - self.toolchain.cc[1:])]), - 'cppc_cmd': " ".join(["\'" + part + "\'" for part - in ([basename(self.toolchain.cppc[0])] + - self.toolchain.cppc[1:])]), - 'asm_cmd': " ".join(["\'" + part + "\'" for part - in ([basename(self.toolchain.asm[0])] + - self.toolchain.asm[1:])]), - 'ld_cmd': "\'" + basename(self.toolchain.ld[0]) + "\'", - 'elf2bin_cmd': "\'" + basename(self.toolchain.elf2bin) + "\'", + 'cc_cmd': " ".join([basename(self.toolchain.cc[0])] + + self.toolchain.cc[1:]), + 'cppc_cmd': " ".join([basename(self.toolchain.cppc[0])] + + self.toolchain.cppc[1:]), + 'asm_cmd': " ".join([basename(self.toolchain.asm[0])] + + self.toolchain.asm[1:]), + 'ld_cmd': basename(self.toolchain.ld[0]), + 'elf2bin_cmd': basename(self.toolchain.elf2bin), 'link_script_ext': self.toolchain.LINKER_EXT, 'link_script_option': self.LINK_SCRIPT_OPTION, 'user_library_flag': self.USER_LIBRARY_FLAG, @@ -105,10 +102,11 @@ def generate(self): } if hasattr(self.toolchain, "preproc"): - ctx['pp_cmd'] = " ".join(["\'" + part + "\'" for part - in ([basename(self.toolchain.preproc[0])] + - self.toolchain.preproc[1:] + - self.toolchain.ld[1:])]) + ctx['pp_cmd'] = " ".join( + [basename(self.toolchain.preproc[0])] + + self.toolchain.preproc[1:] + + self.toolchain.ld[1:] + ) else: ctx['pp_cmd'] = None diff --git a/tools/memap.py b/tools/memap.py index 3e419e8eb73..29f613c7525 100644 --- a/tools/memap.py +++ b/tools/memap.py @@ -12,6 +12,7 @@ import json from argparse import ArgumentParser from copy import deepcopy +from collections import defaultdict from prettytable import PrettyTable from .utils import (argparse_filestring_type, argparse_lowercase_hyphen_type, @@ -54,7 +55,8 @@ def module_add(self, object_name, size, section): contents[section] += size return - new_module = {section: size} + new_module = defaultdict(int) + new_module[section] = size self.modules[object_name] = new_module def module_replace(self, old_object, new_object): @@ -500,7 +502,7 @@ def reduce_depth(self, depth): if split_name[0] == '': split_name = split_name[1:] new_name = join(*split_name[:depth]) - self.short_modules.setdefault(new_name, {}) + self.short_modules.setdefault(new_name, defaultdict(int)) for section_idx, value in v.items(): self.short_modules[new_name].setdefault(section_idx, 0) self.short_modules[new_name][section_idx] += self.modules[module_name][section_idx] @@ -519,7 +521,8 @@ def generate_output(self, export_format, depth, file_output=None): Returns: generated string for the 'table' format, otherwise None """ - self.reduce_depth(depth) + if depth is None or depth > 0: + self.reduce_depth(depth) self.compute_report() try: if file_output: @@ -625,10 +628,9 @@ def compute_report(self): for k in self.sections: self.subtotal[k] = 0 - for i in self.short_modules: + for mod in self.modules.values(): for k in self.sections: - self.short_modules[i].setdefault(k, 0) - self.subtotal[k] += self.short_modules[i][k] + self.subtotal[k] += mod[k] self.mem_summary = { 'static_ram': (self.subtotal['.data'] + self.subtotal['.bss']), @@ -636,13 +638,14 @@ def compute_report(self): } self.mem_report = [] - for i in sorted(self.short_modules): - self.mem_report.append({ - "module":i, - "size":{ - k: self.short_modules[i][k] for k in self.print_sections - } - }) + if self.short_modules: + for name, sizes in sorted(self.short_modules.items()): + self.mem_report.append({ + "module": name, + "size":{ + k: sizes.get(k, 0) for k in self.print_sections + } + }) self.mem_report.append({ 'summary': self.mem_summary diff --git a/tools/profiles/debug.json b/tools/profiles/debug.json index 18006169677..11799e1f817 100644 --- a/tools/profiles/debug.json +++ b/tools/profiles/debug.json @@ -6,7 +6,7 @@ "-ffunction-sections", "-fdata-sections", "-funsigned-char", "-MMD", "-fno-delete-null-pointer-checks", "-fomit-frame-pointer", "-O0", "-g3", "-DMBED_DEBUG", - "-DMBED_TRAP_ERRORS_ENABLED=1", "-D_RTE_"], + "-DMBED_TRAP_ERRORS_ENABLED=1"], "asm": ["-x", "assembler-with-cpp"], "c": ["-std=gnu99"], "cxx": ["-std=gnu++98", "-fno-rtti", "-Wvla"], @@ -19,7 +19,7 @@ "common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-g", "-O0", "-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions", "-DMULADDC_CANNOT_USE_R7", "-fdata-sections", - "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", "-D_RTE_"], + "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="], "asm": [], "c": ["-D__ASSERT_MSG", "-std=gnu99"], "cxx": ["-fno-rtti", "-std=gnu++98"], @@ -30,7 +30,7 @@ "common": ["-c", "--gnu", "-Otime", "--split_sections", "--apcs=interwork", "--brief_diagnostics", "--restrict", "--multibyte_chars", "-O0", "-g", "-DMBED_DEBUG", - "-DMBED_TRAP_ERRORS_ENABLED=1", "-D_RTE_"], + "-DMBED_TRAP_ERRORS_ENABLED=1"], "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp", "--no_rtti", "--no_vla"], @@ -41,7 +41,7 @@ "--apcs=interwork", "--brief_diagnostics", "--restrict", "--multibyte_chars", "-O0", "-D__MICROLIB", "-g", "--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-DMBED_DEBUG", - "-DMBED_TRAP_ERRORS_ENABLED=1", "-D_RTE_"], + "-DMBED_TRAP_ERRORS_ENABLED=1"], "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp", "--no_rtti", "--no_vla"], @@ -51,7 +51,7 @@ "common": [ "--no_wrap_diagnostics", "-e", "--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-On", "-r", "-DMBED_DEBUG", - "-DMBED_TRAP_ERRORS_ENABLED=1", "--enable_restrict", "-D_RTE_"], + "-DMBED_TRAP_ERRORS_ENABLED=1", "--enable_restrict"], "asm": [], "c": ["--vla", "--diag_suppress=Pe546"], "cxx": ["--guard_calls", "--no_static_destruction"], diff --git a/tools/profiles/develop.json b/tools/profiles/develop.json index ed325060183..d791f55d154 100644 --- a/tools/profiles/develop.json +++ b/tools/profiles/develop.json @@ -5,7 +5,7 @@ "-fmessage-length=0", "-fno-exceptions", "-fno-builtin", "-ffunction-sections", "-fdata-sections", "-funsigned-char", "-MMD", "-fno-delete-null-pointer-checks", - "-fomit-frame-pointer", "-Os", "-g1", "-D_RTE_"], + "-fomit-frame-pointer", "-Os", "-g1"], "asm": ["-x", "assembler-with-cpp"], "c": ["-std=gnu99"], "cxx": ["-std=gnu++98", "-fno-rtti", "-Wvla"], @@ -18,7 +18,7 @@ "common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Os", "-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions", "-DMULADDC_CANNOT_USE_R7", "-fdata-sections", - "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", "-D_RTE_"], + "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="], "asm": [], "c": ["-D__ASSERT_MSG", "-std=gnu99"], "cxx": ["-fno-rtti", "-std=gnu++98"], @@ -27,7 +27,7 @@ "ARM": { "common": ["-c", "--gnu", "-Otime", "--split_sections", "--apcs=interwork", "--brief_diagnostics", "--restrict", - "--multibyte_chars", "-O3", "-D_RTE_"], + "--multibyte_chars", "-O3"], "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp", "--no_rtti", "--no_vla"], @@ -37,7 +37,7 @@ "common": ["-c", "--gnu", "-Otime", "--split_sections", "--apcs=interwork", "--brief_diagnostics", "--restrict", "--multibyte_chars", "-O3", "-D__MICROLIB", - "--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-D_RTE_"], + "--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD"], "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp", "--no_rtti", "--no_vla"], @@ -46,7 +46,7 @@ "IAR": { "common": [ "--no_wrap_diagnostics", "-e", - "--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Oh", "--enable_restrict", "-D_RTE_"], + "--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Oh", "--enable_restrict"], "asm": [], "c": ["--vla", "--diag_suppress=Pe546"], "cxx": ["--guard_calls", "--no_static_destruction"], diff --git a/tools/profiles/release.json b/tools/profiles/release.json index 4fe6f8cd6b8..75186d08f1a 100644 --- a/tools/profiles/release.json +++ b/tools/profiles/release.json @@ -5,7 +5,7 @@ "-fmessage-length=0", "-fno-exceptions", "-fno-builtin", "-ffunction-sections", "-fdata-sections", "-funsigned-char", "-MMD", "-fno-delete-null-pointer-checks", - "-fomit-frame-pointer", "-Os", "-DNDEBUG", "-g1", "-D_RTE_"], + "-fomit-frame-pointer", "-Os", "-DNDEBUG", "-g1"], "asm": ["-x", "assembler-with-cpp"], "c": ["-std=gnu99"], "cxx": ["-std=gnu++98", "-fno-rtti", "-Wvla"], @@ -18,7 +18,7 @@ "common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz", "-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions", "-DMULADDC_CANNOT_USE_R7", "-fdata-sections", - "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", "-D_RTE_"], + "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)="], "asm": [], "c": ["-D__ASSERT_MSG", "-std=gnu99"], "cxx": ["-fno-rtti", "-std=gnu++98"], @@ -28,7 +28,7 @@ "ARM": { "common": ["-c", "--gnu", "-Ospace", "--split_sections", "--apcs=interwork", "--brief_diagnostics", "--restrict", - "--multibyte_chars", "-O3", "-DNDEBUG", "-D_RTE_"], + "--multibyte_chars", "-O3", "-DNDEBUG"], "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp", "--no_rtti", "--no_vla"], @@ -38,7 +38,7 @@ "common": ["-c", "--gnu", "-Ospace", "--split_sections", "--apcs=interwork", "--brief_diagnostics", "--restrict", "--multibyte_chars", "-O3", "-D__MICROLIB", - "--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-DNDEBUG", "-D_RTE_"], + "--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-DNDEBUG"], "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp", "--no_rtti", "--no_vla"], @@ -47,7 +47,7 @@ "IAR": { "common": [ "--no_wrap_diagnostics", "-e", - "--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Ohz", "-DNDEBUG", "--enable_restrict", "-D_RTE_"], + "--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Ohz", "-DNDEBUG", "--enable_restrict"], "asm": [], "c": ["--vla", "--diag_suppress=Pe546"], "cxx": ["--guard_calls", "--no_static_destruction"], diff --git a/tools/project.py b/tools/project.py index 959bf1aa4fe..b9f9e3f63fd 100644 --- a/tools/project.py +++ b/tools/project.py @@ -16,11 +16,22 @@ from tools.paths import EXPORT_DIR, MBED_HAL, MBED_LIBRARIES, MBED_TARGETS_PATH from tools.settings import BUILD_DIR -from tools.export import EXPORTERS, mcu_ide_matrix, mcu_ide_list, export_project, get_exporter_toolchain +from tools.export import ( + EXPORTERS, + mcu_ide_matrix, + mcu_ide_list, + export_project, + get_exporter_toolchain, +) from tools.tests import TESTS, TEST_MAP from tools.tests import test_known, test_name_known, Test from tools.targets import TARGET_NAMES -from tools.utils import argparse_filestring_type, argparse_profile_filestring_type, argparse_many, args_error +from tools.utils import ( + argparse_filestring_type, + argparse_profile_filestring_type, + argparse_many, + args_error, +) from tools.utils import argparse_force_lowercase_type from tools.utils import argparse_force_uppercase_type from tools.utils import print_large_string @@ -28,7 +39,27 @@ from tools.options import extract_profile, list_profiles, extract_mcus from tools.notifier.term import TerminalNotifier -def setup_project(ide, target, program=None, source_dir=None, build=None, export_path=None): +EXPORTER_ALIASES = { + u'gcc_arm': u'make_gcc_arm', + u'uvision': u'uvision5', +} + + +def resolve_exporter_alias(ide): + if ide in EXPORTER_ALIASES: + return EXPORTER_ALIASES[ide] + else: + return ide + + +def setup_project( + ide, + target, + program=None, + source_dir=None, + build=None, + export_path=None +): """Generate a name, if not provided, and find dependencies Positional arguments: @@ -62,7 +93,6 @@ def setup_project(ide, target, program=None, source_dir=None, build=None, export test.dependencies.append(MBED_HAL) test.dependencies.append(MBED_TARGETS_PATH) - src_paths = [test.source_dir] lib_paths = test.dependencies project_name = "_".join([test.id, ide, target]) @@ -91,196 +121,247 @@ def export(target, ide, build=None, src=None, macros=None, project_id=None, Returns an object of type Exporter (tools/exports/exporters.py) """ - project_dir, name, src, lib = setup_project(ide, target, program=project_id, - source_dir=src, build=build, export_path=export_path) + project_dir, name, src, lib = setup_project( + ide, + target, + program=project_id, + source_dir=src, + build=build, + export_path=export_path, + ) zip_name = name+".zip" if zip_proj else None - return export_project(src, project_dir, target, ide, name=name, - macros=macros, libraries_paths=lib, zip_proj=zip_name, - build_profile=build_profile, notify=notify, - app_config=app_config, ignore=ignore) + return export_project( + src, + project_dir, + target, + ide, + name=name, + macros=macros, + libraries_paths=lib, + zip_proj=zip_name, + build_profile=build_profile, + notify=TerminalNotifier(), + app_config=app_config, + ignore=ignore + ) + +def clean(source_dir): + if exists(EXPORT_DIR): + rmtree(EXPORT_DIR) + for cls in EXPORTERS.values(): + try: + cls.clean(basename(abspath(source_dir[0]))) + except (NotImplementedError, IOError, OSError): + pass + for f in list(EXPORTERS.values())[0].CLEAN_FILES: + try: + remove(f) + except (IOError, OSError): + pass -def main(): - """Entry point""" - # Parse Options +def get_args(argv): parser = ArgumentParser() targetnames = TARGET_NAMES targetnames.sort() - toolchainlist = list(EXPORTERS.keys()) + toolchainlist = list(EXPORTERS.keys()) + list(EXPORTER_ALIASES.keys()) toolchainlist.sort() - parser.add_argument("-m", "--mcu", - metavar="MCU", - help="generate project for the given MCU ({})".format( - ', '.join(targetnames))) - - parser.add_argument("-i", - dest="ide", - type=argparse_force_lowercase_type( - toolchainlist, "toolchain"), - help="The target IDE: %s"% str(toolchainlist)) - - parser.add_argument("-c", "--clean", - action="store_true", - default=False, - help="clean the export directory") + parser.add_argument( + "-m", "--mcu", + metavar="MCU", + help="generate project for the given MCU ({})".format( + ', '.join(targetnames)) + ) + + parser.add_argument( + "-i", + dest="ide", + type=argparse_force_lowercase_type( + toolchainlist, "toolchain"), + help="The target IDE: %s" % str(toolchainlist) + ) + + parser.add_argument( + "-c", "--clean", + action="store_true", + default=False, + help="clean the export directory" + ) group = parser.add_mutually_exclusive_group(required=False) group.add_argument( "-p", type=test_known, dest="program", - help="The index of the desired test program: [0-%s]"% (len(TESTS)-1)) - - group.add_argument("-n", - type=test_name_known, - dest="program", - help="The name of the desired test program") - - parser.add_argument("-b", - dest="build", - default=False, - action="store_true", - help="use the mbed library build, instead of the sources") - - group.add_argument("-L", "--list-tests", - action="store_true", - dest="list_tests", - default=False, - help="list available programs in order and exit") - - group.add_argument("-S", "--list-matrix", - dest="supported_ides", - default=False, - const="matrix", - choices=["matrix", "ides"], - nargs="?", - help="displays supported matrix of MCUs and IDEs") - - parser.add_argument("-E", - action="store_true", - dest="supported_ides_html", - default=False, - help="writes tools/export/README.md") - - parser.add_argument("--build", - type=argparse_filestring_type, - dest="build_dir", - default=None, - help="Directory for the exported project files") - - parser.add_argument("--source", - action="append", - type=argparse_filestring_type, - dest="source_dir", - default=[], - help="The source (input) directory") - - parser.add_argument("-D", - action="append", - dest="macros", - help="Add a macro definition") - - parser.add_argument("--profile", dest="profile", action="append", - type=argparse_profile_filestring_type, - help="Build profile to use. Can be either path to json" \ - "file or one of the default one ({})".format(", ".join(list_profiles())), - default=[]) - - parser.add_argument("--update-packs", - dest="update_packs", - action="store_true", - default=False) - parser.add_argument("--app-config", - dest="app_config", - default=None) - - parser.add_argument("--ignore", dest="ignore", type=argparse_many(str), - default=None, help="Comma separated list of patterns to add to mbedignore (eg. ./main.cpp)") - - options = parser.parse_args() + help="The index of the desired test program: [0-%s]" % (len(TESTS) - 1) + ) - # Print available tests in order and exit - if options.list_tests is True: - print('\n'.join([str(test) for test in sorted(TEST_MAP.values())])) - sys.exit() + group.add_argument( + "-n", + type=test_name_known, + dest="program", + help="The name of the desired test program" + ) + + parser.add_argument( + "-b", + dest="build", + default=False, + action="store_true", + help="use the mbed library build, instead of the sources" + ) - # Only prints matrix of supported IDEs - if options.supported_ides: + group.add_argument( + "-L", "--list-tests", + action="store_true", + dest="list_tests", + default=False, + help="list available programs in order and exit" + ) + + group.add_argument( + "-S", "--list-matrix", + dest="supported_ides", + default=False, + const="matrix", + choices=["matrix", "ides"], + nargs="?", + help="displays supported matrix of MCUs and IDEs" + ) + + group.add_argument( + "--update-packs", + dest="update_packs", + action="store_true", + default=False + ) + + parser.add_argument( + "-E", + action="store_true", + dest="supported_ides_html", + default=False, + help="Generate a markdown version of the results of -S in README.md" + ) + + parser.add_argument( + "--build", + type=argparse_filestring_type, + dest="build_dir", + default=None, + help="Directory for the exported project files" + ) + + parser.add_argument( + "--source", + action="append", + type=argparse_filestring_type, + dest="source_dir", + default=[], + help="The source (input) directory" + ) + + parser.add_argument( + "-D", + action="append", + dest="macros", + help="Add a macro definition" + ) + + parser.add_argument( + "--profile", + dest="profile", + action="append", + type=argparse_profile_filestring_type, + help=("Build profile to use. Can be either path to json" + "file or one of the default one ({})".format( + ", ".join(list_profiles()))), + default=[] + ) + + parser.add_argument( + "--app-config", + dest="app_config", + default=None + ) + + parser.add_argument( + "--ignore", + dest="ignore", + type=argparse_many(str), + default=None, + help=("Comma separated list of patterns to add to mbedignore " + "(eg. ./main.cpp)") + ) + + return parser.parse_args(argv), parser + + +def main(): + """Entry point""" + # Parse Options + options, parser = get_args(sys.argv[1:]) + + # Print available tests in order and exit + if options.list_tests: + print('\n'.join(str(test) for test in sorted(TEST_MAP.values()))) + elif options.supported_ides: if options.supported_ides == "matrix": print_large_string(mcu_ide_matrix()) elif options.supported_ides == "ides": print(mcu_ide_list()) - exit(0) - - # Only prints matrix of supported IDEs - if options.supported_ides_html: + elif options.supported_ides_html: html = mcu_ide_matrix(verbose_html=True) - try: - with open("./export/README.md", "w") as readme: - readme.write("Exporter IDE/Platform Support\n") - readme.write("-----------------------------------\n") - readme.write("\n") - readme.write(html) - except IOError as exc: - print("I/O error({0}): {1}".format(exc.errno, exc.strerror)) - except: - print("Unexpected error:", sys.exc_info()[0]) - raise - exit(0) - - if options.update_packs: + with open("README.md", "w") as readme: + readme.write("Exporter IDE/Platform Support\n") + readme.write("-----------------------------------\n") + readme.write("\n") + readme.write(html) + elif options.update_packs: from tools.arm_pack_manager import Cache cache = Cache(True, True) cache.cache_everything() + else: + # Check required arguments + if not options.mcu: + args_error(parser, "argument -m/--mcu is required") + if not options.ide: + args_error(parser, "argument -i is required") + if (options.program is None) and (not options.source_dir): + args_error(parser, "one of -p, -n, or --source is required") + + if options.clean: + clean(options.source_dir) + + ide = resolve_exporter_alias(options.ide) + exporter, toolchain_name = get_exporter_toolchain(ide) + profile = extract_profile(parser, options, toolchain_name, fallback="debug") + mcu = extract_mcus(parser, options)[0] + if not exporter.is_target_supported(mcu): + args_error(parser, "%s not supported by %s" % (mcu, ide)) - # Target - if not options.mcu: - args_error(parser, "argument -m/--mcu is required") - - # Toolchain - if not options.ide: - args_error(parser, "argument -i is required") - - # Clean Export Directory - if options.clean: - if exists(EXPORT_DIR): - rmtree(EXPORT_DIR) - - zip_proj = not bool(options.source_dir) - - notify = TerminalNotifier() - - if (options.program is None) and (not options.source_dir): - args_error(parser, "one of -p, -n, or --source is required") - exporter, toolchain_name = get_exporter_toolchain(options.ide) - mcu = extract_mcus(parser, options)[0] - if not exporter.is_target_supported(mcu): - args_error(parser, "%s not supported by %s"%(mcu,options.ide)) - profile = extract_profile(parser, options, toolchain_name, fallback="debug") - if options.clean: - for cls in EXPORTERS.values(): - try: - cls.clean(basename(abspath(options.source_dir[0]))) - except (NotImplementedError, IOError, OSError): - pass - for f in list(EXPORTERS.values())[0].CLEAN_FILES: - try: - remove(f) - except (IOError, OSError): - pass - try: - export(mcu, options.ide, build=options.build, - src=options.source_dir, macros=options.macros, - project_id=options.program, zip_proj=zip_proj, - build_profile=profile, app_config=options.app_config, - export_path=options.build_dir, notify=notify, - ignore=options.ignore) - except NotSupportedException as exc: - print("[ERROR] %s" % str(exc)) + try: + export( + mcu, + ide, + build=options.build, + src=options.source_dir, + macros=options.macros, + project_id=options.program, + zip_proj=not bool(options.source_dir), + build_profile=profile, + app_config=options.app_config, + export_path=options.build_dir, + ignore=options.ignore + ) + except NotSupportedException as exc: + args_error(parser, "%s not supported by %s" % (mcu, ide)) + print("[Not Supported] %s" % str(exc)) + exit(0) if __name__ == "__main__": main() diff --git a/tools/test/examples/examples_lib.py b/tools/test/examples/examples_lib.py index 9b064cadc74..f215d563801 100644 --- a/tools/test/examples/examples_lib.py +++ b/tools/test/examples/examples_lib.py @@ -17,10 +17,12 @@ from tools.build_api import get_mbed_official_release from tools.targets import TARGET_MAP from tools.export import EXPORTERS +from tools.project import EXPORTER_ALIASES from tools.toolchains import TOOLCHAINS SUPPORTED_TOOLCHAINS = list(TOOLCHAINS - set(u'uARM')) -SUPPORTED_IDES = [exp for exp in EXPORTERS.keys() if exp != "cmsis" and exp != "zip"] +SUPPORTED_IDES = [exp for exp in EXPORTERS.keys() + EXPORTER_ALIASES.keys() + if exp != "cmsis" and exp != "zip"] def print_list(lst): diff --git a/tools/test/toolchains/api_test.py b/tools/test/toolchains/api_test.py index 0e764eaf8ec..6fd9d6ff454 100644 --- a/tools/test/toolchains/api_test.py +++ b/tools/test/toolchains/api_test.py @@ -31,6 +31,13 @@ def test_arm_version_check(_run_cmd): toolchain.version_check() assert notifier.messages == [] _run_cmd.return_value = (""" + Product: MDK Professional 5.22 + Component: ARM Compiler 5.06 update 5 (build 528) + Tool: armcc [4d3621] + """, "", 0) + toolchain.version_check() + assert notifier.messages == [] + _run_cmd.return_value = (""" Product: ARM Compiler Component: ARM Compiler Tool: armcc [4d3621] diff --git a/tools/test_api.py b/tools/test_api.py index 8f46cdac90c..5b569f2f379 100644 --- a/tools/test_api.py +++ b/tools/test_api.py @@ -2225,7 +2225,11 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name, execution_directory = "." base_path = norm_relative_path(build_path, execution_directory) - target_name = target.name if isinstance(target, Target) else target + if isinstance(target, Target): + target_name + else: + target_name = target + target = TARGET_MAP[target_name] cfg, _, _ = get_config(base_source_paths, target_name, toolchain_name, app_config=app_config) baud_rate = 9600 @@ -2255,7 +2259,7 @@ def build_tests(tests, base_source_paths, build_path, target, toolchain_name, bin_file = None test_case_folder_name = os.path.basename(test_paths[0]) - args = (src_paths, test_build_path, target, toolchain_name) + args = (src_paths, test_build_path, deepcopy(target), toolchain_name) kwargs = { 'jobs': 1, 'clean': clean, diff --git a/tools/toolchains/__init__.py b/tools/toolchains/__init__.py index 740296024bb..e0172ef46a8 100644 --- a/tools/toolchains/__init__.py +++ b/tools/toolchains/__init__.py @@ -18,6 +18,7 @@ import re import sys +import json from os import stat, walk, getcwd, sep, remove from copy import copy from time import time, sleep @@ -721,10 +722,10 @@ def _add_file(self, file_path, resources, base_path, exclude_paths=None): elif ext == '.c': resources.c_sources.append(file_path) - elif ext == '.cpp': + elif ext == '.cpp' or ext == '.cc': resources.cpp_sources.append(file_path) - elif ext == '.h' or ext == '.hpp': + elif ext == '.h' or ext == '.hpp' or ext == '.hh': resources.headers.append(file_path) elif ext == '.o': @@ -991,7 +992,9 @@ def compile_command(self, source, object, includes): _, ext = splitext(source) ext = ext.lower() - if ext == '.c' or ext == '.cpp': + source = abspath(source) if PRINT_COMPILER_OUTPUT_AS_LINK else source + + if ext == '.c' or ext == '.cpp' or ext == '.cc': base, _ = splitext(object) dep_path = base + '.d' try: @@ -1001,12 +1004,12 @@ def compile_command(self, source, object, includes): config_file = ([self.config.app_config_location] if self.config.app_config_location else []) deps.extend(config_file) - if ext == '.cpp' or self.COMPILE_C_AS_CPP: + if ext != '.c' or self.COMPILE_C_AS_CPP: deps.append(join(self.build_dir, self.PROFILE_FILE_NAME + "-cxx")) else: deps.append(join(self.build_dir, self.PROFILE_FILE_NAME + "-c")) if len(deps) == 0 or self.need_update(object, deps): - if ext == '.cpp' or self.COMPILE_C_AS_CPP: + if ext != '.c' or self.COMPILE_C_AS_CPP: return self.compile_cpp(source, object, includes) else: return self.compile_c(source, object, includes) @@ -1269,11 +1272,17 @@ def dump_build_profile(self): """Dump the current build profile and macros into the `.profile` file in the build directory""" for key in ["cxx", "c", "asm", "ld"]: - to_dump = (str(self.flags[key]) + str(sorted(self.macros))) + to_dump = { + "flags": sorted(self.flags[key]), + "macros": sorted(self.macros), + "symbols": sorted(self.get_symbols(for_asm=(key == "asm"))), + } if key in ["cxx", "c"]: - to_dump += str(self.flags['common']) + to_dump["symbols"].remove('MBED_BUILD_TIMESTAMP=%s' % self.timestamp) + to_dump["flags"].extend(sorted(self.flags['common'])) where = join(self.build_dir, self.PROFILE_FILE_NAME + "-" + key) - self._overwrite_when_not_equal(where, to_dump) + self._overwrite_when_not_equal(where, json.dumps( + to_dump, sort_keys=True, indent=4)) @staticmethod def _overwrite_when_not_equal(filename, content): diff --git a/tools/toolchains/arm.py b/tools/toolchains/arm.py index 1a98ad320b9..68a7eda0bfc 100644 --- a/tools/toolchains/arm.py +++ b/tools/toolchains/arm.py @@ -41,7 +41,7 @@ class ARM(mbedToolchain): SUPPORTED_CORES = ["Cortex-M0", "Cortex-M0+", "Cortex-M3", "Cortex-M4", "Cortex-M4F", "Cortex-M7", "Cortex-M7F", "Cortex-M7FD", "Cortex-A9"] ARMCC_RANGE = (LooseVersion("5.06"), LooseVersion("5.07")) - ARMCC_VERSION_RE = re.compile("Product: ARM Compiler (\d+\.\d+)") + ARMCC_VERSION_RE = re.compile(b"Component: ARM Compiler (\d+\.\d+)") @staticmethod def check_executable(): @@ -99,7 +99,7 @@ def version_check(self): msg = None min_ver, max_ver = self.ARMCC_RANGE match = self.ARMCC_VERSION_RE.search(stdout) - found_version = LooseVersion(match.group(1)) if match else None + found_version = LooseVersion(match.group(1).decode("utf-8")) if match else None min_ver, max_ver = self.ARMCC_RANGE if found_version and (found_version < min_ver or found_version >= max_ver): msg = ("Compiler version mismatch: Have {}; " diff --git a/tools/toolchains/gcc.py b/tools/toolchains/gcc.py index 9387917bce8..cbc86c7008d 100644 --- a/tools/toolchains/gcc.py +++ b/tools/toolchains/gcc.py @@ -31,7 +31,7 @@ class GCC(mbedToolchain): DIAGNOSTIC_PATTERN = re.compile('((?P[^:]+):(?P\d+):)(?P\d+):? (?Pwarning|[eE]rror|fatal error): (?P.+)') GCC_RANGE = (LooseVersion("6.0.0"), LooseVersion("7.0.0")) - GCC_VERSION_RE = re.compile("\d+\.\d+\.\d+") + GCC_VERSION_RE = re.compile(b"\d+\.\d+\.\d+") def __init__(self, target, notify=None, macros=None, build_profile=None, build_dir=None): @@ -91,6 +91,10 @@ def __init__(self, target, notify=None, macros=None, build_profile=None, target.core.startswith("Cortex-M33")) and not target.core.endswith("-NS")): self.cpu.append("-mcmse") + self.flags["ld"].extend([ + "-Wl,--cmse-implib", + "-Wl,--out-implib=%s" % join(build_dir, "cmse_lib.o") + ]) elif target.core == "Cortex-M23-NS" or target.core == "Cortex-M33-NS": self.flags["ld"].append("-D__DOMAIN_NS=1") @@ -116,7 +120,7 @@ def version_check(self): stdout, _, retcode = run_cmd([self.cc[0], "--version"], redirect=True) msg = None match = self.GCC_VERSION_RE.search(stdout) - found_version = LooseVersion(match.group(0)) if match else None + found_version = LooseVersion(match.group(0).decode('utf-8')) if match else None min_ver, max_ver = self.GCC_RANGE if found_version and (found_version < min_ver or found_version >= max_ver): msg = ("Compiler version mismatch: Have {}; " @@ -233,11 +237,6 @@ def link(self, output, objects, libraries, lib_dirs, mem_map): # Build linker command map_file = splitext(output)[0] + ".map" cmd = self.ld + ["-o", output, "-Wl,-Map=%s" % map_file] + objects + ["-Wl,--start-group"] + libs + ["-Wl,--end-group"] - # Create Secure library - if self.target.core == "Cortex-M23" or self.target.core == "Cortex-M33": - secure_file = join(dirname(output), "cmse_lib.o") - cmd.extend(["-Wl,--cmse-implib"]) - cmd.extend(["-Wl,--out-implib=%s" % secure_file]) if mem_map: cmd.extend(['-T', mem_map]) diff --git a/tools/toolchains/iar.py b/tools/toolchains/iar.py index 92d9af82623..bf3712a76be 100644 --- a/tools/toolchains/iar.py +++ b/tools/toolchains/iar.py @@ -30,7 +30,7 @@ class IAR(mbedToolchain): DIAGNOSTIC_PATTERN = re.compile('"(?P[^"]+)",(?P[\d]+)\s+(?PWarning|Error|Fatal error)(?P.+)') INDEX_PATTERN = re.compile('(?P\s*)\^') - IAR_VERSION_RE = re.compile("IAR ANSI C/C\+\+ Compiler V(\d+\.\d+)") + IAR_VERSION_RE = re.compile(b"IAR ANSI C/C\+\+ Compiler V(\d+\.\d+)") IAR_VERSION = LooseVersion("7.80") @staticmethod @@ -99,7 +99,7 @@ def version_check(self): stdout, _, retcode = run_cmd([self.cc[0], "--version"], redirect=True) msg = None match = self.IAR_VERSION_RE.search(stdout) - found_version = match.group(1) if match else None + found_version = match.group(1).decode("utf-8") if match else None if found_version and LooseVersion(found_version) != self.IAR_VERSION: msg = "Compiler version mismatch: Have {}; expected {}".format( found_version, self.IAR_VERSION)