Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed issue with integer overflow when converting time units #11669

Merged
merged 1 commit into from
Oct 15, 2019
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -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] name String thread name used for a debugger
* @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] priority The priority of the thread. Values are operating system specific, but some
* common priority levels are defined:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ cy_rslt_t cy_rtos_get_time(cy_time_t *tval)

/* Convert ticks count to time in milliseconds */
if (tick_freq != 0)
*tval = ((osKernelGetTickCount() * 1000) / tick_freq);
*tval = (cy_time_t)((osKernelGetTickCount() * 1000LL) / tick_freq);
else
status = CY_RTOS_GENERAL_ERROR;
}
Expand Down