Without OsInterruptTimeFrame, a CAN bus error storm can generate thousands of Rx interrupts per second, completely starving all tasks. The time frame imposes a minimum inter-arrival time enforced by the OS timer.
/* OS enforces: CanIsr_Core0 may not fire more than once per 1000 us */
/* Configuration: OsInterruptTimeFrame = 1000 us */
/* If CAN error storm fires ISR at 50us intervals: */
/* After first ISR fires: OS arms 1000us timeframe timer */
/* Second ISR arrives at 50us: OS detects timeframe violation */
/* → OsProtectionHook(E_OS_PROTECTION_ARRIVAL) called */
/* → Return PRO_TERMINATETASKISR: ISR terminated, rest of system unaffected */
/* DEM event records the ISR flood: */
FUNC(ProtectionReturnType, OS_APPL_CODE) OsProtectionHook(StatusType err) {
if (err == E_OS_PROTECTION_ARRIVAL) {
Dem_ReportErrorStatus(DEM_EVENT_ISR_TIMEFRAME_VIOLATED,
DEM_EVENT_STATUS_FAILED);
return PRO_TERMINATETASKISR;
}
return PRO_SHUTDOWN;
}