Fix mstimer elapsed time (#58)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
@@ -76,7 +76,7 @@ void lse_init(
|
||||
while (1) {
|
||||
if (LSE_Delay < LSE_FAIL_FLAG) {
|
||||
mstimer_set(&Delay_Timer, 0);
|
||||
while (mstimer_remaining(&Delay_Timer) < 500) {
|
||||
while (mstimer_elapsed(&Delay_Timer) < 500) {
|
||||
/* do nothing */
|
||||
}
|
||||
/* check whether LSE is ready, with 4 seconds timeout */
|
||||
|
||||
@@ -72,7 +72,7 @@ void rs485_silence_reset(
|
||||
bool rs485_silence_elapsed(
|
||||
uint32_t interval)
|
||||
{
|
||||
return (mstimer_remaining(&Silence_Timer) > interval);
|
||||
return (mstimer_elapsed(&Silence_Timer) > interval);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
@@ -101,7 +101,7 @@ static uint16_t rs485_turnaround_time(
|
||||
bool rs485_turnaround_elapsed(
|
||||
void)
|
||||
{
|
||||
return (mstimer_remaining(&Silence_Timer) > rs485_turnaround_time());
|
||||
return (mstimer_elapsed(&Silence_Timer) > rs485_turnaround_time());
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user