本文整理汇总了C++中OSErrorGetServiceId函数的典型用法代码示例。如果您正苦于以下问题:C++ OSErrorGetServiceId函数的具体用法?C++ OSErrorGetServiceId怎么用?C++ OSErrorGetServiceId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OSErrorGetServiceId函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: printError
/*==================[definiciones de funciones externas]=====================*/
void printError(void)
{
static uint8_t OSErrorGetServiceIdTxt[][25]={
"Undefined",
"ActivateTask",
"TerminateTask",
"ChainTask",
"Schedule",
"GetTAskID",
"GetTaskState",
"DisableAllInterrupts",
"EnableAllInterrupts",
"SuspendAllInterrupts",
"ResumeAllInterrupts",
"SuspendOSInterrupts",
"ResumeOSInterrupts",
"GetResource",
"ReleaseResource",
"SetEvent",
"ClearEvent",
"GetEvent",
"WaitEvent",
"GetAlarmBase",
"GetAlarm",
"SetRelAlarm",
"SetAbsAlarm",
"CancelAlarm",
"GetACtiveApplicationMode",
"StartOS",
"ShutdownOS"
};
static uint8_t OSErrorGetRetTxt[][13]={
"E_OK",
"E_OS_ACCESS",
"E_OS_CALLEVEL",
"E_OS_ID"
"E_OS_LIMIT",
"E_OS_NOFUNC",
"E_OS_RESOURCE",
"E_OS_STATE",
"E_OS_VALUE"
};
uartWriteString(UART_USB, "\n-----------------------------------\n");
uartWriteString(UART_USB, "Service:\n");
uartWriteByte(UART_USB, ( OSErrorGetServiceId() + 48 ) );
uartWriteString(UART_USB, " = ");
uartWriteString(UART_USB, ( OSErrorGetServiceIdTxt[OSErrorGetServiceId()]) );
uartWriteString(UART_USB, " ---> ");
uartWriteByte(UART_USB, ( OSErrorGetRet() + 48 ) );
uartWriteString(UART_USB, " = ");
uartWriteString(UART_USB, ( OSErrorGetRetTxt[OSErrorGetRet()] ) );
uartWriteString(UART_USB, "\n-----------------------------------\n");
}
开发者ID:cpantel,项目名称:ciaa,代码行数:59,代码来源:common.c
示例2: ErrorHook
void
ErrorHook(StatusType Error)
{
TaskType tskid;
StatusType ercd;
#ifdef IOC_E_NO_DATA
/* IOC_E_NO_DATAはエラーではない */
if (Error == IOC_E_NO_DATA) {
return;
}
#endif /* IOC_E_NO_DATA */
syslog(LOG_NOTICE, "## ErrorHook is called !! (%d)", Error);
ercd = GetTaskID(&tskid);
if (ercd == E_OK) {
syslog(LOG_NOTICE, "GetTaskID: %d", (sintptr) tskid);
}
else {
syslog(LOG_NOTICE, "GetTaskID is unavailable.");
}
syslog(LOG_NOTICE, "GetISRID: %d", (sintptr) GetISRID());
syslog(LOG_NOTICE, "OSErrorGetServiceId(): %d", OSErrorGetServiceId());
return;
}
开发者ID:gitter-badger,项目名称:a_rtegen,代码行数:27,代码来源:Os_Hook.c
示例3: ErrorHook
/** \brief Error Hook function
*
* This fucntion is called from the os if an os interface (API) returns an
* error. Is for debugging proposes. If called this function triggers a
* ShutdownOs which ends in a while(1).
*
* The values:
* OSErrorGetServiceId
* OSErrorGetParam1
* OSErrorGetParam2
* OSErrorGetParam3
* OSErrorGetRet
*
* will provide you the interface, the input parameters and the returned value.
* For more details see the OSEK specification:
* http://portal.osek-vdx.org/files/pdf/specs/os223.pdf
*
*/
void ErrorHook(void)
{
ciaaPOSIX_printf("ErrorHook was called\n");
ciaaPOSIX_printf("Service: %d, P1: %d, P2: %d, P3: %d, RET: %d\n",
OSErrorGetServiceId(), OSErrorGetParam1(),
OSErrorGetParam2(), OSErrorGetParam3(), OSErrorGetRet());
ShutdownOS(0);
}
开发者ID:mabeett,项目名称:td3,代码行数:26,代码来源:td3_osek_6.c
示例4: ErrorHook
/**
*
* @param error
*/
void ErrorHook( StatusType error ) {
TaskType task;
static struct LogBad LogBad[ERROR_LOG_SIZE];
static uint8_t ErrorCount = 0;
printf("ErrorHook: %d\r\n", error);
GetTaskID(&task);
OsServiceIdType service = OSErrorGetServiceId();
/* Grab the arguments to the functions
* This is the standard way, see 11.2 in OSEK spec
*/
switch(service) {
case OSServiceId_SetRelAlarm:
{
// Read the arguments to the faulty functions...
AlarmType alarm_id = OSError_SetRelAlarm_AlarmId;
TickType increment = OSError_SetRelAlarm_Increment;
TickType cycle = OSError_SetRelAlarm_Cycle;
(void)alarm_id;
(void)increment;
(void)cycle;
// ... Handle this some way.
break;
}
/*
* The same pattern as above applies for all other OS functions.
* See Os.h for names and definitions.
*/
default:
break;
}
LDEBUG_PRINTF("## ErrorHook err=%u\n",Error);
/* Log the errors in a buffer for later review */
LogBad[ErrorCount].param1 = os_error.param1;
LogBad[ErrorCount].param2 = os_error.param2;
LogBad[ErrorCount].param3 = os_error.param3;
LogBad[ErrorCount].serviceId = service;
LogBad[ErrorCount].taskId = task;
LogBad[ErrorCount].error = error;
ErrorCount++;
/* Keep compiler silent */
(void)LogBad[ErrorCount].param1;
// Stall if buffer is full.
while(ErrorCount >= ERROR_LOG_SIZE)
{
};
}
开发者ID:digideskio,项目名称:moped,代码行数:62,代码来源:system_hooks.c
示例5: test_error_instance9
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance9(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(19);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT(19,OSServiceId_StartScheduleTableSynchron, result_inst_1);
}
开发者ID:1984c,项目名称:trampoline,代码行数:11,代码来源:error_instance9.c
示例6: test_error_instance2
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance2(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(9);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT(9,OSServiceId_SetEvent , result_inst_1);
}
开发者ID:TrampolineRTOS,项目名称:trampoline,代码行数:11,代码来源:error_instance2.c
示例7: test_error_instance7
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance7(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(16);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT(16,OSServiceId_GetResource, result_inst_1);
}
开发者ID:TrampolineRTOS,项目名称:trampoline,代码行数:11,代码来源:error_instance7.c
示例8: test_error_instance1
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance1(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(4);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT(4,OSServiceId_ActivateTask, result_inst_1);
}
开发者ID:1984c,项目名称:trampoline,代码行数:11,代码来源:error_instance1.c
示例9: test_error_instance6
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance6(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(14);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT(14,OSServiceId_GetTaskState, result_inst_1);
}
开发者ID:1984c,项目名称:trampoline,代码行数:11,代码来源:error_instance6.c
示例10: test_error_instance15
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance15(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(32);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT(32,OSServiceId_SetRelAlarm, result_inst_1);
}
开发者ID:TrampolineRTOS,项目名称:trampoline,代码行数:11,代码来源:error_instance15.c
示例11: test_error_instance3
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance3(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(8);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT(8,OSServiceId_ChainTask, result_inst_1);
}
开发者ID:1984c,项目名称:trampoline,代码行数:11,代码来源:error_instance3.c
示例12: test_error_instance8
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance8(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(17);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT(17,OSServiceId_NextScheduleTable, result_inst_1);
}
开发者ID:1984c,项目名称:trampoline,代码行数:11,代码来源:error_instance8.c
示例13: test_error_instance16
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance16(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(33);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT(33,OSServiceId_TerminateApplication, result_inst_1);
}
开发者ID:1984c,项目名称:trampoline,代码行数:11,代码来源:error_instance16.c
示例14: test_error_instance10
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance10(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(37);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(37, OSServiceId_GetScheduleTableStatus , result_inst_1);
SCHEDULING_CHECK_AND_EQUAL_INT(37, INVALID_SCHEDULETABLE , OSError_GetScheduleTableStatus_ScheduleTableID());
}
开发者ID:1984c,项目名称:trampoline,代码行数:11,代码来源:error_instance10.c
示例15: test_error_instance1
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance1(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(8);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(8, INVALID_RESTART , OSError_TerminateApplication_opt());
SCHEDULING_CHECK_AND_EQUAL_INT(8,OSServiceId_TerminateApplication , result_inst_1);
}
开发者ID:TrampolineRTOS,项目名称:trampoline,代码行数:12,代码来源:error_instance1.c
示例16: test_error_instance6
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance6(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(12);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(12,OSServiceId_GetElapsedCounterValue , result_inst_1);
SCHEDULING_CHECK_AND_EQUAL_INT(12, INVALID_COUNTER , OSError_GetElapsedCounterValue_CounterID());
}
开发者ID:TrampolineRTOS,项目名称:trampoline,代码行数:12,代码来源:error_instance6.c
示例17: test_error_instance6
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance6(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(18);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(18,OSServiceId_StartScheduleTableSynchron, result_inst_1);
SCHEDULING_CHECK_AND_EQUAL_INT(18,sched_explicit, OSError_StartScheduleTableSynchron_ScheduleTableID());
}
开发者ID:1984c,项目名称:trampoline,代码行数:12,代码来源:error_instance6.c
示例18: test_error_instance2
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance2(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(4);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(4,OSServiceId_IncrementCounter , result_inst_1);
SCHEDULING_CHECK_AND_EQUAL_INT(4, INVALID_COUNTER , OSError_IncrementCounter_CounterID());
}
开发者ID:1984c,项目名称:trampoline,代码行数:12,代码来源:error_instance2.c
示例19: test_error_instance12
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance12(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(26);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(26,sched_nosync, OSError_SetScheduleTableAsync_ScheduleTableID());
SCHEDULING_CHECK_AND_EQUAL_INT(26,OSServiceId_SetScheduleTableAsync, result_inst_1);
}
开发者ID:1984c,项目名称:trampoline,代码行数:12,代码来源:error_instance12.c
示例20: test_error_instance5
/*test case:test the reaction of the system called with
an activation of a task*/
static void test_error_instance5(void)
{
StatusType result_inst_1;
SCHEDULING_CHECK_INIT(13);
result_inst_1 = OSErrorGetServiceId();
SCHEDULING_CHECK_AND_EQUAL_INT_FIRST(13,OSServiceId_StopScheduleTable , result_inst_1);
SCHEDULING_CHECK_AND_EQUAL_INT(13, INVALID_SCHEDULETABLE , OSError_StopScheduleTable_ScheduleTableID());
}
开发者ID:1984c,项目名称:trampoline,代码行数:12,代码来源:error_instance5.c
注:本文中的OSErrorGetServiceId函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论