From 4c69419e2ee95b0573fcaeec2c859e620dc920e7 Mon Sep 17 00:00:00 2001 From: James Wang Date: Mon, 16 Apr 2018 18:13:15 +0800 Subject: [PATCH 1/5] mbed_wait_api: add comments to warn the func will lock deep sleep --- platform/mbed_wait_api.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform/mbed_wait_api.h b/platform/mbed_wait_api.h index a58509f741..5794504c05 100644 --- a/platform/mbed_wait_api.h +++ b/platform/mbed_wait_api.h @@ -53,18 +53,27 @@ extern "C" { * the accuracy of single precision floating point). * * @param s number of seconds to wait + * + * @note + * This func will lock the deep sleep, if you want device entry deep sleep mode, please use Thread::wait() */ void wait(float s); /** Waits a number of milliseconds. * * @param ms the whole number of milliseconds to wait + * + * @note + * This func will lock the deep sleep, if you want device entry deep sleep mode, please use Thread::wait() */ void wait_ms(int ms); /** Waits a number of microseconds. * * @param us the whole number of microseconds to wait + * + * @note + * This func will lock the deep sleep. */ void wait_us(int us); From efc228ff0642d0009b098aeab2730e242e3a6d12 Mon Sep 17 00:00:00 2001 From: James Wang Date: Tue, 17 Apr 2018 15:23:15 +0800 Subject: [PATCH 2/5] accept Cruz Monrreal's review --- platform/mbed_wait_api.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/mbed_wait_api.h b/platform/mbed_wait_api.h index 5794504c05..32df1798e3 100644 --- a/platform/mbed_wait_api.h +++ b/platform/mbed_wait_api.h @@ -55,7 +55,7 @@ extern "C" { * @param s number of seconds to wait * * @note - * This func will lock the deep sleep, if you want device entry deep sleep mode, please use Thread::wait() + * This func will lock deep sleep. If you want device entry deep sleep mode, please use Thread::wait() */ void wait(float s); @@ -64,7 +64,7 @@ void wait(float s); * @param ms the whole number of milliseconds to wait * * @note - * This func will lock the deep sleep, if you want device entry deep sleep mode, please use Thread::wait() + * This func will lock deep sleep. If you want device entry deep sleep mode, please use Thread::wait() */ void wait_ms(int ms); @@ -73,7 +73,7 @@ void wait_ms(int ms); * @param us the whole number of microseconds to wait * * @note - * This func will lock the deep sleep. + * This func will lock deep sleep. */ void wait_us(int us); From 04627992db18e7c7ab5125afa38afee2d130a3e6 Mon Sep 17 00:00:00 2001 From: James Wang Date: Tue, 17 Apr 2018 18:11:59 +0800 Subject: [PATCH 3/5] Accept Kevin Bracey's review, "wait_ms() and wait(float) always spin to get an exact number of microseconds, potentially impacting power and multi-thread performance. Again, avoided by Thread::wait()". --- platform/mbed_wait_api.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/platform/mbed_wait_api.h b/platform/mbed_wait_api.h index 32df1798e3..e3130b084c 100644 --- a/platform/mbed_wait_api.h +++ b/platform/mbed_wait_api.h @@ -55,7 +55,9 @@ extern "C" { * @param s number of seconds to wait * * @note - * This func will lock deep sleep. If you want device entry deep sleep mode, please use Thread::wait() + * This func always spin to get an exact number of microseconds, potentially + * impacting power(like can't deep sleep) and multi-thread performance. + * You can avoided by Thread::wait(). */ void wait(float s); @@ -64,7 +66,9 @@ void wait(float s); * @param ms the whole number of milliseconds to wait * * @note - * This func will lock deep sleep. If you want device entry deep sleep mode, please use Thread::wait() + * This func always spin to get an exact number of microseconds, potentially + * impacting power(like can't deep sleep) and multi-thread performance. + * You can avoided by Thread::wait(). */ void wait_ms(int ms); @@ -73,7 +77,8 @@ void wait_ms(int ms); * @param us the whole number of microseconds to wait * * @note - * This func will lock deep sleep. + * This func always spin to get an exact number of microseconds, potentially + * impacting power(like can't deep sleep) and multi-thread performance. */ void wait_us(int us); From 27ce443a70f165af4b5490ba8d1259235913413d Mon Sep 17 00:00:00 2001 From: James Wang Date: Wed, 18 Apr 2018 10:22:50 +0800 Subject: [PATCH 4/5] accept Amanda Butler's review. change to "This function always spins to get the exact number of microseconds, which potentially affects power (such as preventing deep sleep) and multithread performance. You can avoid it by using Thread::wait()." --- platform/mbed_wait_api.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/platform/mbed_wait_api.h b/platform/mbed_wait_api.h index e3130b084c..22d2b096eb 100644 --- a/platform/mbed_wait_api.h +++ b/platform/mbed_wait_api.h @@ -55,9 +55,9 @@ extern "C" { * @param s number of seconds to wait * * @note - * This func always spin to get an exact number of microseconds, potentially - * impacting power(like can't deep sleep) and multi-thread performance. - * You can avoided by Thread::wait(). + * 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); @@ -66,9 +66,9 @@ void wait(float s); * @param ms the whole number of milliseconds to wait * * @note - * This func always spin to get an exact number of microseconds, potentially - * impacting power(like can't deep sleep) and multi-thread performance. - * You can avoided by Thread::wait(). + * 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); @@ -77,8 +77,8 @@ void wait_ms(int ms); * @param us the whole number of microseconds to wait * * @note - * This func always spin to get an exact number of microseconds, potentially - * impacting power(like can't deep sleep) and multi-thread performance. + * 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); From c9b2640f704580d5ab1b1a9b65a5db42d0a2525c Mon Sep 17 00:00:00 2001 From: James Wang Date: Thu, 3 May 2018 10:22:32 +0800 Subject: [PATCH 5/5] mbed_wait_api: wait_ms() wait() wait_us() add "If the RTOS is present" comments --- platform/mbed_wait_api.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platform/mbed_wait_api.h b/platform/mbed_wait_api.h index 22d2b096eb..10948c84ef 100644 --- a/platform/mbed_wait_api.h +++ b/platform/mbed_wait_api.h @@ -55,7 +55,7 @@ extern "C" { * @param s number of seconds to wait * * @note - * 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. * You can avoid it by using Thread::wait(). */ @@ -66,7 +66,7 @@ void wait(float s); * @param ms the whole number of milliseconds to wait * * @note - * 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. * You can avoid it by using Thread::wait(). */ @@ -77,7 +77,7 @@ void wait_ms(int ms); * @param us the whole number of microseconds to wait * * @note - * 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);