Skip to content

Commit 9b524b9

Browse files
committed
FW-786. log time correction only when it's larger than LIMITLARGETIMECORRECTION.
1 parent b2c50a9 commit 9b524b9

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

inc/opendefs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
static const uint8_t infoStackName[] = "OpenWSN ";
2323
#define OPENWSN_VERSION_MAJOR 1
2424
#define OPENWSN_VERSION_MINOR 21
25-
#define OPENWSN_VERSION_PATCH 3
25+
#define OPENWSN_VERSION_PATCH 4
2626

2727
#ifndef TRUE
2828
#define TRUE 1

openstack/02a-MAClow/IEEE802154E.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,11 +2617,15 @@ void synchronizePacket(PORT_TIMER_WIDTH timeReceived) {
26172617

26182618
// log a large timeCorrection
26192619
if (
2620-
ieee154e_vars.isSync==TRUE
2620+
ieee154e_vars.isSync==TRUE &&
2621+
(
2622+
timeCorrection<-LIMITLARGETIMECORRECTION ||
2623+
timeCorrection> LIMITLARGETIMECORRECTION
2624+
)
26212625
) {
26222626
openserial_printError(COMPONENT_IEEE802154E,ERR_LARGE_TIMECORRECTION,
2623-
(errorparameter_t)timeCorrection,
2624-
(errorparameter_t)0);
2627+
(errorparameter_t)timeCorrection,
2628+
(errorparameter_t)0);
26252629
}
26262630

26272631
// update the stats
@@ -2661,11 +2665,15 @@ void synchronizeAck(PORT_SIGNED_INT_WIDTH timeCorrection) {
26612665
#endif
26622666
// log a large timeCorrection
26632667
if (
2664-
ieee154e_vars.isSync==TRUE
2668+
ieee154e_vars.isSync==TRUE &&
2669+
(
2670+
timeCorrection<-LIMITLARGETIMECORRECTION ||
2671+
timeCorrection> LIMITLARGETIMECORRECTION
2672+
)
26652673
) {
26662674
openserial_printError(COMPONENT_IEEE802154E,ERR_LARGE_TIMECORRECTION,
2667-
(errorparameter_t)timeCorrection,
2668-
(errorparameter_t)1);
2675+
(errorparameter_t)timeCorrection,
2676+
(errorparameter_t)1);
26692677
}
26702678

26712679
// update the stats

0 commit comments

Comments
 (0)