31 #define EVENT_THROTTLE_BACKOFF_MAX 10
33 static int _evtThrottleBackOff = 0;
34 static int _evtThrottleTimeOut = 0;
37 const char _appName[] =
"KM3NeT CLB v2 BASE";
39 const char _appName[] =
"KM3NeT CLB v2 Runtime";
42 void appPeriodicUpdate();
71 _evtThrottleBackOff = 0;
76 void appPeriodicUpdate()
79 if (_evtThrottleTimeOut > _evtThrottleBackOff) {
80 _evtThrottleTimeOut = _evtThrottleBackOff;
84 if (_evtThrottleTimeOut == 0)
88 if (_evtThrottleBackOff < EVENT_THROTTLE_BACKOFF_MAX) _evtThrottleBackOff ++;
90 _evtThrottleBackOff = _evtThrottleBackOff >> 1;
92 _evtThrottleTimeOut = _evtThrottleBackOff;
99 if (_rateTimer == 0) {
101 }
else if (_rateTimer % 10 == 0) {
105 if (_rateTimer >= 59) {
122 _evtThrottleTimeOut --;
bool errHas()
Returns whether there is an error pending.
void _appInit()
Prototype to be implemented by higher-level function to start the application.
The shell is a ASCII command interpreter and effort has been made to simplify creation of additional ...
void schdRunPeriodic(int taskId, int interval)
Schedule a task to run periodically.
White Rabbit simple timer 'Ticks' driver.
bool schdRegister(SchdTaskF task, bool priority, int *taskId)
Register a task with the scheduler.
System start up and management.
bool evtClbEmitUpdate()
Emit an update.
White Rabbit Simple UART Driver.
Simple task scheduler for tasks.
void errFatal()
Prints the last error and halts the system.
CLB Remote message processor.
void clbUpdateSubsys()
Invoked the update method on each subsystem.
Manages the global system error.
void errPrint(bool clear)
Prints the last error.
void clbStateInit()
Initializes the state machine.
uint32_t netEventFailedCount()
Returns the number of events failed to be transmitted since the the function was previously invoked...
The CLB stare module tracks is responsible for state management of the various sub-systems on the CLB...
void shellSetPrompt(const char *newPrompt)
Sets the prompt for the shell.
bool evtClbEmitStateChange()
Indicates the CLB to emit a state change event to the slow control.
void shellDo()
Checks if there is any ASCII characters of the UART, and execute any commands issued.
bool evtClbEmitUpdateVars(int rate)
Indicates it should emit an vars update.
Configures the board-specific peripherals, like I2C, SPI etc...
OpenCores I2C device driver.