A test for the frequency of interrupts.
Each time an interrupt is executed a counter is increased. The interrupt monitor is executed periodically to check that the counters are within a configurable range. The Real Time Counter is used to run classb_intmon_callback() periodically. The Interrupt monitor is enabled after calling classb_rtc_setup(). Note that CLASSB_INT_MON should be defined. See Real Time Counter Driver for more details.
In order to monitor an interrupt, the following steps should be followed:
M_ENABLE
with classb_intmon_set_state(). The next time the interrupt monitor runs the state of the interrupt will be set to ON
.M_DISABLE
. The interrupt monitor will change the state to OFF
the next time it is executed.The fact that the main application has to request to start monitoring an interrupt (and that it is the monitor sets the ON
state) ensures that the interrupt counter is synchronized with the interrupt monitor, i.e. the interrupt counter starts being increased exactly after a period of the interrupt monitor.
Note that the interrupt counter is only increased if the interrupt is ON
. When an interrupt is OFF
, the counter should be zero and otherwise the error flag will be set. Further, enabling an interrupt that is ON
or disabling an interrupt that is OFF
will call the error handler if CLASSB_STRICT_INTMON is defined.
The error handler related to this test is CLASSB_ERROR_HANDLER_INTERRUPT().
Modules | |
Settings | |
Settings for the interrupt monitor. | |
Interrupt data interface | |
Definition of data structures used by the monitor. | |
Functions | |
Functions related to the interrupt monitor. | |