Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions TESTS/mbedmicro-rtos-mbed/kernel_tick_count/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#if !defined(MBED_CONF_RTOS_PRESENT)
#error [NOT_SUPPORTED] kernel tick count test cases require a RTOS to run.
#else

#include "greentea-client/test_env.h"
#include "utest/utest.h"
#include "unity/unity.h"
Expand All @@ -36,6 +32,7 @@ using utest::v1::Case;
#define SMALL_DELTA 1500 // 0.15%
#define BIG_DELTA 15000 // 1.5%

#if defined(MBED_CONF_RTOS_PRESENT)
/** Test if kernel ticker frequency is 1kHz

Given a RTOS kernel ticker
Expand All @@ -47,6 +44,7 @@ void test_frequency()
uint32_t freq = osKernelGetTickFreq();
TEST_ASSERT_EQUAL_UINT32_MESSAGE(1000, freq, "Expected SysTick frequency is 1kHz");
}
#endif

/** Test if kernel ticker increments by one

Expand Down Expand Up @@ -105,7 +103,9 @@ void test_interval()

// Test cases
Case cases[] = {
#if defined(MBED_CONF_RTOS_PRESENT)
Case("Test kernel ticker frequency", test_frequency),
#endif
Case("Test if kernel ticker increments by one", test_increment),
Case("Test if kernel ticker interval is 1ms", test_interval)
};
Expand All @@ -122,4 +122,3 @@ int main()
{
return !utest::v1::Harness::run(specification);
}
#endif // !defined(MBED_CONF_RTOS_PRESENT)