ODeV framework
v2
|
This file declare the Managed task Interface. More...
Go to the source code of this file.
Macros | |
#define | MT_MAX_ERROR_COUNT 0x7 |
#define | MT_ALLOWED_ERROR_COUNT 0x2 |
Typedefs | |
typedef struct _AManagedTask | AManagedTask |
Functions | |
sys_error_code_t | AMTHardwareInit (AManagedTask *this, void *pParams) |
sys_error_code_t | AMTOnCreateTask (AManagedTask *this, TaskFunction_t *pvTaskCode, const char **pcName, unsigned short *pnStackDepth, void **pParams, UBaseType_t *pxPriority) |
sys_error_code_t | AMTDoEnterPowerMode (AManagedTask *this, const EPowerMode eActivePowerMode, const EPowerMode eNewPowerMode) |
sys_error_code_t | AMTHandleError (AManagedTask *this, SysEvent xError) |
sys_error_code_t | AMTInit (AManagedTask *this) |
EPowerMode | AMTGetSystemPowerMode () |
sys_error_code_t | AMTNotifyIsStillRunning (AManagedTask *this, sys_error_code_t nStepError) |
void | AMTReportErrOnStepExecution (AManagedTask *this, sys_error_code_t nStepError) |
void | AMTResetAEDCounter (AManagedTask *this) |
boolean_t | AMTIsPowerModeSwitchPending (AManagedTask *this) |
This file declare the Managed task Interface.
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 MT_ALLOWED_ERROR_COUNT 0x2 |
Specifies the maximum number of error a task can report before resetting the nIsTaskStillRunning flag. If the AEM (::AppErrorManager) is used it will in turn trigger a system reset due to the WWDG.
#define MT_MAX_ERROR_COUNT 0x7 |
Specifies the maximum number of errors that can be tracked by a managed task.
typedef struct _AManagedTask AManagedTask |
Create type name for _AManagedTask.
|
inline |
Task specific function called by the framework when the system is entering a specific power mode. This function is executed in the INIT task execution flow. A managed task should ... TBC
this | [IN] specifies a task object pointer. |
eActivePowerMode | [IN] specifies the current power mode of the system. |
eNewPowerMode | [IN] specifies the new power mode that is to be activated by the system. |
|
inline |
Utility function to retrieve the current power mode of the system.
|
inline |
Called by the framework to handle a system wide error. This function is executed in the INIT task execution flow.
this | [IN] specifies a task object pointer. |
xError | [IN] specifies a system error |
|
inline |
Task specific function called by the framework to initialize task related hardware resources. This function is called by the INIT task.
this | [IN] specifies a task object pointer. |
pParams | [IN] specifies a pointer to task specific hardware initialization parameters. |
|
inline |
Initialize a managed task structure. The application is responsible to allocate a managed task in memory. This method must be called after the allocation.
this | [IN] specifies a task object pointer. |
|
inline |
Check if the INIT task has requested a power mode switch.
this | [IN] specifies a task object pointer. |
TRUE
if there is power mode switch pending request, FALSE
otherwise.
|
inline |
Notify the system that the task is still running. If an application error manage delegate is installed (_IApplicationErrorDelegate), then a managed task must notify the system that it is working fine in order to prevent a system reset.
this | [IN] specifies a task object pointer. |
nStepError | [IN] specifies an error code. Usually it is the error code reported during the task step execution. |
|
inline |
Task specific function called by the framework before the task is created. An application should use this function in order to perform task specific software initialization and pass task specific parameters to the INIT task.
this | [IN] specifies a task object pointer. |
pvTaskCode | [OUT] used by the application to specify the task main function. |
pcName | [OUT] used by the application to specify a descriptive name for the task. |
pnStackDepth | [OUT] used by the application to specify the task stack size. |
pxPriority | [OUT] used by the application to specify the task priority. |
pParams | [OUT] specifies a pointer to the parameters passed from the application to the task. |
|
inline |
A managed task can handle an error during the step execution by itself. Another option is to let the error navigate up to the main control loop of the task where it will be reported to the system using the AMTNotifyIsStillRunning() function. But if an error occurs and the managed task want to ignore the error and proceed with the step execution, it should notify the system using this function before the error is overwritten. For example:
xRes = HCPExeuteCommand(&this->m_xProtocol, xReport.outputReport11.nCommandID, NULL, this->m_pxDriver); if (SYS_IS_ERROR_CODE(xRes)) { AMTReportErrOnStepExecution(this, xRes); } // continue with the step execution.
In this why the error is logged and the AED count the error when it check if the task is still running properly.
this | [IN] specifies a task object pointer. |
nStepError | [IN] specifies an error code. |
|
inline |
This function is a convenient method to call the call the system function SysResetAEDCounter() from a task code.
this | [IN] specifies a task object pointer. |