[wpilib] Add option to flush NetworkTables every iterative loop

This functionality is disabled by default, but can be enabled by the user
program by calling setNetworkTablesFlushEnabled.
This commit is contained in:
Peter Johnson
2020-12-12 23:16:50 -08:00
parent acfbb1a44a
commit 581b7ec553
3 changed files with 34 additions and 0 deletions

View File

@@ -155,6 +155,14 @@ class IterativeRobotBase : public RobotBase {
*/
virtual void TestPeriodic();
/**
* Enables or disables flushing NetworkTables every loop iteration.
* By default, this is disabled.
*
* @param enabled True to enable, false to disable
*/
void SetNetworkTablesFlushEnabled(bool enabled);
/**
* Constructor for IterativeRobotBase.
*
@@ -188,6 +196,7 @@ class IterativeRobotBase : public RobotBase {
Mode m_lastMode = Mode::kNone;
Watchdog m_watchdog;
bool m_ntFlushEnabled = false;
void PrintLoopOverrunMessage();
};