Skip to content

Commit

Permalink
updated periodic print defines
Browse files Browse the repository at this point in the history
  • Loading branch information
W3AXL committed Oct 9, 2024
1 parent 570a91a commit b3f11ce
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 3 additions & 1 deletion fw/v24/inc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ extern "C" {
//#define TRACE_VCP

// Enable periodic status print
//#define PERIODIC_STATUS
#define PERIODIC_STATUS
// Interval in ms for the periodic status print
#define PERIODIC_STATUS_INT 30000

// Report buffer space in 16-byte blocks instead of LDUs
#define STATUS_SPACE_BLOCKS
Expand Down
3 changes: 0 additions & 3 deletions fw/v24/inc/hdlc.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@ extern "C" {
/* Interval between sending RRs in idle mode */
#define RR_INTERVAL 5000

/* Periodic Status Report Interval */
#define STATUS_INTERVAL 30000

#define FRAME_SPACING 2

/* Macros for getting high/low bits of 16 bit numbers */
Expand Down
6 changes: 3 additions & 3 deletions fw/v24/src/hdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ void HdlcCallback()
}

// Periodic status print
if (HAL_GetTick() - lastStatus > STATUS_INTERVAL)
#ifdef PERIODIC_STATUS
if (HAL_GetTick() - lastStatus > PERIODIC_STATUS_INT)
{
lastStatus = HAL_GetTick();
#ifdef PERIODIC_STATUS
uint32_t errFrames = rxTotalFrames - rxValidFrames;
if (HDLCPeerConnected)
{
Expand All @@ -108,8 +108,8 @@ void HdlcCallback()
log_warn("HDLC frame sync lost");
VCPWriteDebug1("HDLC frame sync lost");
}
#endif
}
#endif
}

void hdlcFrameSpace()
Expand Down

0 comments on commit b3f11ce

Please sign in to comment.