ODeV framework
v2
|
TODO - insert here the file description. More...
#include "systypes.h"
#include "syserror.h"
#include "systp.h"
#include "FreeRTOS.h"
#include "task.h"
Go to the source code of this file.
Data Structures | |
struct | _AMTStatus |
struct | _AManagedTask |
Typedefs | |
typedef struct _AManagedTask_vtbl | AManagedTask_vtbl |
typedef struct _AMTStatus | AMTStatus |
Functions | |
SYS_DEFINE_INLINE sys_error_code_t | AMTHardwareInit (AManagedTask *this, void *pParams) |
SYS_DEFINE_INLINE sys_error_code_t | AMTOnCreateTask (AManagedTask *this, TaskFunction_t *pvTaskCode, const char **pcName, unsigned short *pnStackDepth, void **pParams, UBaseType_t *pxPriority) |
SYS_DEFINE_INLINE sys_error_code_t | AMTDoEnterPowerMode (AManagedTask *this, const EPowerMode eActivePowerMode, const EPowerMode eNewPowerMode) |
SYS_DEFINE_INLINE sys_error_code_t | AMTHandleError (AManagedTask *this, SysEvent xError) |
SYS_DEFINE_INLINE sys_error_code_t | AMTInit (AManagedTask *this) |
SYS_DEFINE_INLINE EPowerMode | AMTGetSystemPowerMode () |
SYS_DEFINE_INLINE sys_error_code_t | AMTNotifyIsStillRunning (AManagedTask *this, sys_error_code_t nStepError) |
SYS_DEFINE_INLINE void | AMTResetAEDCounter (AManagedTask *this) |
SYS_DEFINE_INLINE boolean_t | AMTIsPowerModeSwitchPending (AManagedTask *this) |
SYS_DEFINE_INLINE void | AMTReportErrOnStepExecution (AManagedTask *this, sys_error_code_t nStepError) |
TODO - insert here the file description.
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.
typedef struct _AManagedTask_vtbl AManagedTask_vtbl |
Create type name for _IManagedTask_vtb.
typedef struct _AMTStatus AMTStatus |
Managed Task status field. This data is used to coordinate the power mode switch between the INIT task and the application managed tasks.
|
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. |