ODeV framework
v2
|
Define the global error management API. More...
Go to the source code of this file.
Data Structures | |
union | sys_error_t |
Macros | |
#define | SYS_ERR_EVT_SRC_IAED 0x1U |
Event generated from the IApplicationErrorDelegate. | |
#define | SYS_ERR_EVT_PARAM_CHECK_TASKS 0x1U |
Event parameter: check is tasks are still running. | |
#define | SYS_ERR_EVT_PARAM_EFT 0x2U |
Event parameter: EFT error detected. | |
#define | SYS_ERR_EVT_PARAM_EFT_TIMEOUT 0x3U |
Event parameter: EFT error timeout. | |
#define | SYS_ERR_EVT_PARAM_NOP 0x4U |
Event parameter: EFT IRQ to be ignored. | |
#define | SYS_ERR_MAKE_EVENT(src, params) ((((src) & 0X7U) | (((params)<<3) & 0xF8U) | (0x1U<<31)) & 0x800000FF) |
#define | SYS_IS_ERROR_EVENT(evt) ((evt).xEvent.nEventType == 1) |
#define | APP_BASE_ERROR_CODE SYS_LAST_ERROR_CODE + 1 |
< Initial value for the application defined error codes. | |
Typedefs | |
typedef unsigned short | sys_error_code_t |
Functions | |
sys_error_code_t | SysPostErrorEvent (SysEvent xEvent) |
void | SysResetAEDCounter () |
void | sys_error_handler (void) |
Variables | |
sys_error_t | g_nSysError |
Define the global error management API.
Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:
http://www.st.com/software_license_agreement_liberty_v2
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
#define SYS_ERR_MAKE_EVENT | ( | src, | |
params | |||
) | ((((src) & 0X7U) | (((params)<<3) & 0xF8U) | (0x1U<<31)) & 0x800000FF) |
Macro to make system error event.
src | [IN] specifies the source of the event |
params | [IN] specifies a parameter. Its value depend on the event source. |
#define SYS_IS_ERROR_EVENT | ( | evt | ) | ((evt).xEvent.nEventType == 1) |
Macro to check the .nEventType of a system event.
evt | [IN] specifies an event |
typedef unsigned short sys_error_code_t |
Create type name for sys_error_code_t.
void sys_error_handler | ( | void | ) |
This function is executed in case of error occurrence. If the application is in Debug configuration it inserts a dynamic breakpoint.
sys_error_code_t SysPostErrorEvent | ( | SysEvent | xEvent | ) |
Notify the system about an event related to the error management. This function can be called also from an ISR.
xEvent | [IN] specifies a error event. |
void SysResetAEDCounter | ( | ) |
Reset the counter of the AED. Usually an AED use some kind of timeout to check that all managed tasks are working fine. A task should call this method before a critical operation, that is for example a write operation in FLASH or EEPROM, or a long critical section. For convenience the managed task interface has a function IMTResetAEDCounter() that can be used by a task instead of call directly the system function.
sys_error_t g_nSysError |
This is the global variable that store the last low level and the last service level error code.