Reduce frequency of DC Sync debug messages

This commit is contained in:
Dave Page 2015-03-16 14:18:55 -04:00
parent 42745f4ebb
commit f9dfaf3f9b
2 changed files with 7 additions and 3 deletions

View File

@ -54,7 +54,7 @@
// uint8_t reserved
// uint32_t PacketNo, Password, ErrorCode
//#define DEBUG_FOE
#define DEBUG_FOE
/*****************************************************************************/

8
master/fsm_slave_config.c Normal file → Executable file
View File

@ -1399,8 +1399,12 @@ void ec_fsm_slave_config_state_dc_sync_check(
EC_SLAVE_WARN(slave, "Slave did not sync after %lu ms.\n",
diff_ms);
} else {
EC_SLAVE_DBG(slave, 1, "Sync after %4lu ms: %10u ns\n",
diff_ms, abs_sync_diff);
static unsigned long last_diff_ms = 0;
if ((diff_ms < last_diff_ms) || (diff_ms >= (last_diff_ms + 100))) {
last_diff_ms = diff_ms;
EC_SLAVE_DBG(slave, 1, "Sync after %4lu ms: %10u ns\n",
diff_ms, abs_sync_diff);
}
// check synchrony again
ec_datagram_fprd(datagram, slave->station_address, 0x092c, 4);