Fix mstimer elapsed time (#58)

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
This commit is contained in:
Steve Karg
2020-03-17 17:27:25 -05:00
committed by GitHub
parent 1b9c1ad3b3
commit f18612f1ec
9 changed files with 29 additions and 10 deletions
+4 -2
View File
@@ -62,12 +62,14 @@ static volatile struct mstp_port_struct_t MSTP_Port;
/* buffers needed by mstp port struct */
static uint8_t RxBuffer[MAX_MPDU];
static uint8_t TxBuffer[MAX_MPDU];
static struct mstimer Silence_Timer;
static uint32_t Timer_Silence(
void *pArg)
{
uint32_t delta_time = 0;
delta_time = timer_milliseconds(TIMER_SILENCE);
delta_time = mstimer_elapsed(&Silence_Timer);
if (delta_time > 0xFFFF) {
delta_time = 0xFFFF;
}
@@ -78,7 +80,7 @@ static uint32_t Timer_Silence(
static void Timer_Silence_Reset(
void *pArg)
{
timer_reset(TIMER_SILENCE);
mstimer_set(&Silence_Timer, 0);
}
/* functions used by the MS/TP state machine to put or get data */