Skip to content
Open
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
1 change: 1 addition & 0 deletions inc/nOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,7 @@ nOS_TickCounter nOS_GetTickCount (void);
* *
**********************************************************************************************************************/
#define nOS_MsToTicks(MS) (nOS_TickCounter)(((uint32_t)(MS)+((1000UL/(uint32_t)NOS_CONFIG_TICKS_PER_SECOND)-1UL))/(1000UL/(uint32_t)NOS_CONFIG_TICKS_PER_SECOND))
#define nOS_TicksToMs(Tick) (nOS_TickCounter)(((uint32_t)(Tick)*1000UL)+1UL)/NOS_CONFIG_TICKS_PER_SECOND
#endif

#if (NOS_CONFIG_SLEEP_ENABLE > 0)
Expand Down
2 changes: 1 addition & 1 deletion src/nOSTimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ nOS_Error nOS_TimerRestart (nOS_Timer *timer, nOS_TimerCounter reload)
if (timer == NULL) {
err = NOS_E_INV_OBJ;
}
else if (reload == 0) {
else if ((reload == 0) && (timer->state & NOS_TIMER_FREE_RUNNING) == NOS_TIMER_FREE_RUNNING) {
err = NOS_E_INV_VAL;
} else
#endif
Expand Down