![]() |
AVR SD Safety Framework 1.0.0
|
Contains API prototypes for Tasks shared between several Task Managers. More...
Files | |
| file | tasks_shared.c |
| Implements APIs for Tasks shared between several Task Managers. | |
| file | tasks_shared.h |
| Contains API prototypes for Tasks shared between several Task Managers. | |
| file | tasks_shared_private.c |
| Implements private functions for tasks_shared.c. | |
| file | tasks_shared_private.h |
| Contains private function prototypes for tasks_shared.c. | |
Functions | |
| void | T_HandleSyncWatchdog (uint32_t newTimeout) |
| Waits until the current Synchronous Watchdog timeout is completed before clearing and setting the next timeout. | |
| void | T_HandleWatchdog (void) |
| Clears the Watchdog Timer (WDT) while performing the WDT count diagnostic. | |
| void | T_HandleNotificationErrors (void) |
| Ensures Error IDs with 'NOTIFICATION' criticality are handled. | |
| void | ReportClearVregfailChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearBuserrChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearRam2ChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearFlash2ChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearOpcChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearSplimChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearRam1ChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearFlash1ChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearVregwarnChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearCfd0ChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearCfd1ChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearCfm0ChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearCfm1ChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearSwdtChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearEepromChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearEvsys0ChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
| void | ReportClearEvsys1ChannelError (void) |
| Private function, only exposed for unit testing and should not be called directly. | |
Contains API prototypes for Tasks shared between several Task Managers.
| void ReportClearBuserrChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearCfd0ChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearCfd1ChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearCfm0ChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearCfm1ChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearEepromChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearEvsys0ChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearEvsys1ChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearFlash1ChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearFlash2ChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearOpcChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearRam1ChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearRam2ChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearSplimChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearSwdtChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearVregfailChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void ReportClearVregwarnChannelError | ( | void | ) |
Private function, only exposed for unit testing and should not be called directly.
| void T_HandleNotificationErrors | ( | void | ) |
Ensures Error IDs with 'NOTIFICATION' criticality are handled.
This function checks all Error Controller channels configured with 'NOTIFICATION' criticality. For each set channel, except EVSYS0 and EVSYS1, it reads and clears the error source, clears the channel, and reports the error to the Error Handler to be logged as a 'NOTIFICATION' error. Once all the notification errors are logged, the function invokes the Error Handler to process the log, which may include previously logged errors.
For scheduling of this Task see DUR_HANDLE_NOTIFICATION_ERRORS.
Configuring the EVSYS0 or EVSYS1 Error Controller channels to use a "level" event type as the error source in the Event System will prevent clearing the channel, requiring both the source and channel to be cleared in the notification error handler callback.
The following Error IDs may be reported to the Error Handler by this Task and corresponds to error channel hardware flags or their sources:
ERRID_BUSERR_CH, ERRID_OPC_OPC, ERRID_OPC_PARITYI, ERRID_OPC_CH, ERRID_SPLIM_CH, ERRID_RAM2_ECC2, ERRID_RAM2_COMP, ERRID_RAM2_CH, ERRID_FLASH2_ECC2, ERRID_FLASH2_COMP, ERRID_FLASH2_CH, ERRID_RAM1_CH, ERRID_FLASH1_CH, ERRID_EEPROM_ECC1, ERRID_EEPROM_ECC2, ERRID_EEPROM_CH, ERRID_VREGFAIL_VOV, ERRID_VREGFAIL_VUV, ERRID_VREGFAIL_CH, ERRID_VREGWARN_VDENTER, ERRID_VREGWARN_VDEXIT, ERRID_VREGWARN_VERR, ERRID_VREGWARN_VSLP, ERRID_VREGWARN_VDIS, ERRID_VREGWARN_SERR, ERRID_VREGWARN_CH, ERRID_SWDT_BADPC, ERRID_SWDT_BADC, ERRID_SWDT_UC, ERRID_SWDT_EXP, ERRID_SWDT_CH, ERRID_EVSYS0_CH, ERRID_EVSYS0_CLEAR, ERRID_EVSYS1_CH, ERRID_EVSYS1_CLEAR
| void T_HandleSyncWatchdog | ( | uint32_t | newTimeout | ) |
Waits until the current Synchronous Watchdog timeout is completed before clearing and setting the next timeout.
This function handles the Synchronous Watchdog Timer (SWDT) by pre-clearing and clearing it in the correctly timed sequence, and setting a new timeout period value. With this, the SWDT is restarted with a new initial counter value after waiting until the previous timeout has ended.
It is also responsible for executing the optional MW_DiagSwdtCount diagnostic, if enabled compile-time. See DIAG_PERIODIC_SWDT_COUNT for more details. Any detected diagnostic faults and input parameter errors are reported to the Error Handler.
The 'newTimeout' value is the closed window for the SWDT. Adding the configured SWDT_OPEN_WINDOW yields the SWDT RESET value. Once the SWDT window has opened, the SWDT can be cleared and hence, restart immediately. This ensures that the SWDT period is always 'newTimeout' clock cycles.
This Task will busy wait until the SWDT can be cleared in its open window. If the SWDT expires while waiting or the SWDT is already expired, an error is reported and the function returns.
A 'newTimeout' value resulting in a calculated SWDT RESET that overflows 32 bits or exceeds 24 bits is reported as an error and discarded, and the current SWDT RESET value is re-used for the next period.
| newTimeout | Number of clock cycles until the SWDT can be pre-cleared after the current timeout period is completed. |
The following Error IDs may be reported to the Error Handler by this Task:
| void T_HandleWatchdog | ( | void | ) |
Clears the Watchdog Timer (WDT) while performing the WDT count diagnostic.
This function is responsible for clearing the Watchdog timer. It is intended to be called at a set interval to ensure that the Watchdog is cleared within the Fault Detection Time Interval (FDTI) of the device. The function is also responsible for optionally executing the MW_DiagWdtCountEnd diagnostic, which detects whether the WDT counter is stuck and reports any detected faults to the Error Handler. See DIAG_PERIODIC_WDT_COUNT for enabling or disabling this feature.
It is assumed that this function is called at the correct time to clear the Watchdog. If called while the Watchdog is in the closed window, the device will be reset by the Watchdog.
See WWDT_CLOSED_WINDOW, WWDT_OPEN_WINDOW and INIT_WDT_DURATION for configuration of the watchdog timeout.
The following Error IDs may be reported to the Error Handler by this Task: