diff --git a/pw_thread_freertos/thread.cc b/pw_thread_freertos/thread.cc index d516b65c5..740f46fa2 100644 --- a/pw_thread_freertos/thread.cc +++ b/pw_thread_freertos/thread.cc @@ -49,7 +49,8 @@ void Context::ThreadEntryPoint(void* void_context_ptr) { // If the thread handle was detached before the thread finished execution, // i.e. got here, then we are responsible for cleaning up the join event // group. - vEventGroupDelete(&context.join_event_group()); + vEventGroupDelete( + reinterpret_cast(&context.join_event_group())); #endif // PW_THREAD_JOINING_ENABLED #if PW_THREAD_FREERTOS_CONFIG_DYNAMIC_ALLOCATION_ENABLED @@ -72,7 +73,9 @@ void Context::ThreadEntryPoint(void* void_context_ptr) { xTaskResumeAll(); #if PW_THREAD_JOINING_ENABLED - xEventGroupSetBits(&context.join_event_group(), kThreadDoneBit); + xEventGroupSetBits( + reinterpret_cast(&context.join_event_group()), + kThreadDoneBit); #endif // PW_THREAD_JOINING_ENABLED while (true) { @@ -97,7 +100,8 @@ void Context::TerminateThread(Context& context) { #if PW_THREAD_JOINING_ENABLED // Just in case someone abused our API, ensure their use of the event group is // properly handled by the kernel regardless. - vEventGroupDelete(&context.join_event_group()); + vEventGroupDelete( + reinterpret_cast(&context.join_event_group())); #endif // PW_THREAD_JOINING_ENABLED #if PW_THREAD_FREERTOS_CONFIG_DYNAMIC_ALLOCATION_ENABLED @@ -225,7 +229,8 @@ void Thread::join() { PW_CHECK(this_thread::get_id() != get_id()); // Wait indefinitely until kThreadDoneBit is set. - while (xEventGroupWaitBits(&native_type_->join_event_group(), + while (xEventGroupWaitBits(reinterpret_cast( + &native_type_->join_event_group()), kThreadDoneBit, pdTRUE, // Clear the bits. pdFALSE, // Any bits is fine, N/A.