Skip to content

Commit

Permalink
Merge pull request weston-embedded#18 from forg0ne/tmr_state_mod
Browse files Browse the repository at this point in the history
os_tmr.c - prevent tmr corruption on double-create
  • Loading branch information
forg0ne authored Apr 30, 2021
2 parents 4dc0492 + f4fad0c commit a52c14a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/os_tmr.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ void OSTmrCreate (OS_TMR *p_tmr,
OS_TmrLock();
}

p_tmr->State = OS_TMR_STATE_STOPPED; /* Initialize the timer fields */
#if (OS_OBJ_TYPE_REQ > 0u)
#if (OS_CFG_OBJ_CREATED_CHK_EN > 0u)
if (p_tmr->Type == OS_OBJ_TYPE_TMR) {
Expand All @@ -177,6 +176,8 @@ void OSTmrCreate (OS_TMR *p_tmr,
#endif
p_tmr->Type = OS_OBJ_TYPE_TMR;
#endif

p_tmr->State = OS_TMR_STATE_STOPPED; /* Initialize the timer fields */
#if (OS_CFG_DBG_EN > 0u)
p_tmr->NamePtr = p_name;
#else
Expand Down

0 comments on commit a52c14a

Please sign in to comment.