Skip to content

Commit

Permalink
Merge pull request #2093 from abakosh/no_osal_delay
Browse files Browse the repository at this point in the history
osal_none: make it possible to override the task delay function
  • Loading branch information
hathach authored Jul 31, 2023
2 parents db59494 + 3fdd2a4 commit ce54984
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/host/usbh.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static bool usbh_control_xfer_cb (uint8_t daddr, uint8_t ep_addr, xfer_result_t

#if CFG_TUSB_OS == OPT_OS_NONE
// TODO rework time-related function later
void osal_task_delay(uint32_t msec)
TU_ATTR_WEAK void osal_task_delay(uint32_t msec)
{
const uint32_t start = hcd_frame_number(_usbh_controller);
while ( ( hcd_frame_number(_usbh_controller) - start ) < msec ) {}
Expand Down
2 changes: 1 addition & 1 deletion src/osal/osal_none.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

#if CFG_TUH_ENABLED
// currently only needed/available in host mode
void osal_task_delay(uint32_t msec);
TU_ATTR_WEAK void osal_task_delay(uint32_t msec);
#endif

//--------------------------------------------------------------------+
Expand Down

0 comments on commit ce54984

Please sign in to comment.