mirror of https://github.com/ARMmbed/mbed-os.git
Fixed issue with integer overflow when converting time units
parent
154d51b040
commit
2d757fc321
|
@ -167,7 +167,8 @@ extern cy_rtos_error_t cy_rtos_last_error();
|
||||||
* @param[in] entry_function Function pointer which points to the main function for the new thread
|
* @param[in] entry_function Function pointer which points to the main function for the new thread
|
||||||
* @param[in] name String thread name used for a debugger
|
* @param[in] name String thread name used for a debugger
|
||||||
* @param[in] stack The buffer to use for the thread stack. This must be aligned to
|
* @param[in] stack The buffer to use for the thread stack. This must be aligned to
|
||||||
CY_RTOS_ALIGNMENT with a size of at least CY_RTOS_MIN_STACK_SIZE
|
* CY_RTOS_ALIGNMENT with a size of at least CY_RTOS_MIN_STACK_SIZE.
|
||||||
|
* If stack is null, cy_rtos_create_thread will allocate a stack from the heap.
|
||||||
* @param[in] stack_size The size of the thread stack in bytes
|
* @param[in] stack_size The size of the thread stack in bytes
|
||||||
* @param[in] priority The priority of the thread. Values are operating system specific, but some
|
* @param[in] priority The priority of the thread. Values are operating system specific, but some
|
||||||
* common priority levels are defined:
|
* common priority levels are defined:
|
||||||
|
|
|
@ -803,7 +803,7 @@ cy_rslt_t cy_rtos_get_time(cy_time_t *tval)
|
||||||
|
|
||||||
/* Convert ticks count to time in milliseconds */
|
/* Convert ticks count to time in milliseconds */
|
||||||
if (tick_freq != 0)
|
if (tick_freq != 0)
|
||||||
*tval = ((osKernelGetTickCount() * 1000) / tick_freq);
|
*tval = (cy_time_t)((osKernelGetTickCount() * 1000LL) / tick_freq);
|
||||||
else
|
else
|
||||||
status = CY_RTOS_GENERAL_ERROR;
|
status = CY_RTOS_GENERAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue