mirror of https://github.com/ARMmbed/mbed-os.git
sleep test: fix coding style
parent
8fd6bece75
commit
f90f1fc01d
|
@ -46,12 +46,12 @@
|
|||
|
||||
unsigned int ticks_to_us(unsigned int ticks, unsigned int freq)
|
||||
{
|
||||
return (unsigned int) ((unsigned long long) ticks * US_PER_S / freq);
|
||||
return (unsigned int)((unsigned long long) ticks * US_PER_S / freq);
|
||||
}
|
||||
|
||||
unsigned int us_to_ticks(unsigned int us, unsigned int freq)
|
||||
{
|
||||
return (unsigned int) ((unsigned long long) us * freq / US_PER_S);
|
||||
return (unsigned int)((unsigned long long) us * freq / US_PER_S);
|
||||
}
|
||||
|
||||
unsigned int overflow_protect(unsigned int timestamp, unsigned int ticker_width)
|
||||
|
@ -87,7 +87,7 @@ void busy_wait_ms(int ms)
|
|||
{
|
||||
const ticker_info_t *info = us_ticker_get_info();
|
||||
uint32_t mask = (1 << info->bits) - 1;
|
||||
int delay = (int) ((uint64_t) ms * info->frequency / 1000);
|
||||
int delay = (int)((uint64_t) ms * info->frequency / 1000);
|
||||
|
||||
uint32_t prev = us_ticker_read();
|
||||
while (delay > 0) {
|
||||
|
@ -97,13 +97,13 @@ void busy_wait_ms(int ms)
|
|||
}
|
||||
}
|
||||
|
||||
void us_ticker_isr(const ticker_data_t * const ticker_data)
|
||||
void us_ticker_isr(const ticker_data_t *const ticker_data)
|
||||
{
|
||||
us_ticker_clear_interrupt();
|
||||
}
|
||||
|
||||
#ifdef DEVICE_LPTICKER
|
||||
void lp_ticker_isr(const ticker_data_t * const ticker_data)
|
||||
void lp_ticker_isr(const ticker_data_t *const ticker_data)
|
||||
{
|
||||
lp_ticker_clear_interrupt();
|
||||
}
|
||||
|
|
|
@ -110,7 +110,7 @@ void test_lock_gt_ushrt_max()
|
|||
|
||||
#if DEVICE_LPTICKER
|
||||
#if DEVICE_USTICKER
|
||||
utest::v1::status_t testcase_setup(const Case * const source, const size_t index_of_case)
|
||||
utest::v1::status_t testcase_setup(const Case *const source, const size_t index_of_case)
|
||||
{
|
||||
// Suspend the RTOS kernel scheduler to prevent interference with duration of sleep.
|
||||
osKernelSuspend();
|
||||
|
@ -130,8 +130,8 @@ utest::v1::status_t testcase_setup(const Case * const source, const size_t index
|
|||
return utest::v1::greentea_case_setup_handler(source, index_of_case);
|
||||
}
|
||||
|
||||
utest::v1::status_t testcase_teardown(const Case * const source, const size_t passed, const size_t failed,
|
||||
const utest::v1::failure_t failure)
|
||||
utest::v1::status_t testcase_teardown(const Case *const source, const size_t passed, const size_t failed,
|
||||
const utest::v1::failure_t failure)
|
||||
{
|
||||
ticker_resume(get_us_ticker_data());
|
||||
#if DEVICE_LPTICKER
|
||||
|
|
Loading…
Reference in New Issue