Esempio n. 1
0
/* LEJOS OSEK hook to be invoked from an ISR in category 2 */
void user_1ms_isr_type2(void)
{
  StatusType ercd;

  ercd = SignalCounter(SysTimerCnt); /* Increment OSEK Alarm Counter */
  if(ercd != E_OK)
  {
    ShutdownOS(ercd);
  }
}
Esempio n. 2
0
/*test case:test the reaction of the system called with 
an activation of a task*/
static void test_startup_instance(void)
{
	StatusType result_inst_1;
	
	SCHEDULING_CHECK_INIT(1);
	result_inst_1 = GetActiveApplicationMode();
	SCHEDULING_CHECK_AND_EQUAL_INT(1,OSDEFAULTAPPMODE , result_inst_1); 

	ShutdownOS(E_OK);
	
}
// nxtOSEK hook to be invoked from an ISR in category 2
void user_1ms_isr_type2(void)
{
	SleeperMonitor(); // must be called here to use sleep function.
	StatusType ercd;

	ercd = SignalCounter(SysTimerCnt); /* Increment OSEK Alarm Counter */
	if (ercd != E_OK) 
	{
	    ShutdownOS(ercd);
	}
	
	AuxLight.processBackground();
}
static inline void in_state_goOffOne(void){

    /* @req EcuMf2328 */
    /* !req EcuM2756 */

#if defined(USE_NVM)
    if (EcuM_World_go_off_one_state_timeout){
        EcuM_World_go_off_one_state_timeout--;
    }

    // Wait for the NVM job (NvmWriteAll) to terminate

    Std_ReturnType ret = NvM_GetErrorStatus(0, &writeAllResult);

    if (((ret == E_OK) && (writeAllResult != NVM_REQ_PENDING)) ||
         (EcuM_World_go_off_one_state_timeout == 0)) {
        ShutdownOS(E_OK);
    }
#else
    ShutdownOS(E_OK);
#endif
}
Esempio n. 5
0
void user_1ms_isr_type2(void)
{
    StatusType ercd;
#if 0
    /*check value of timestamp to prevent an overflow
    * if maximum value is reached reset it to 0*/
    /*TODO: Handle the time_stamp reset*/
    if(unlikely (timestamp == (uintmax_t) UINT32_MAX))
        timestamp = 0;
    else
        ++timestamp;
#endif
    ercd = SignalCounter(SysTimerCnt);
    if(ercd != E_OK)
        ShutdownOS(ercd);
}
Esempio n. 6
0
/*
 *  �G���[�t�b�N�̌Ăяo��
 */
void
call_errorhook(StatusType ercd, OSServiceIdType svcid)
{
	UINT8	saved_callevel;
	IPL	saved_ipl;
	volatile FP	errorhook_adr;
	
	/*
	 *  C�����̋K�i�ł͊֐��̃A�h���X��0�ɂȂ��Ȃ��Ƃ����O�񂩂�,
	 *  �R���p�C���̍œK���ɂ���ErrorHook�̃A�h���X���蕪����
	 *  �폜�����Ă��܂��ꍇ�����邽��, volatile�w�肵�����[�J���ϐ���
	 *  �A�h���X���������Ă��画�肵�Ă����D
	*/
	errorhook_adr = (FP)ErrorHook;
	
	if (sus_all_cnt > 0) {
		if ((errorhook_adr != NULL) && (callevel != TCL_ERROR)) {
			_errorhook_svcid = svcid;
			ErrorHook(ercd);
		}
		ShutdownOS(E_OS_CALLEVEL);	/* �񕜕s�”\ */
	}
	else {
		if (( errorhook_adr != NULL) && (callevel != TCL_ERROR)) {
			_errorhook_svcid = svcid;
			saved_callevel = callevel;
			callevel = TCL_ERROR;
			saved_ipl = current_ipl();
			if (saved_ipl < ipl_maxisr2) {
				set_ipl(ipl_maxisr2);
			}
			unlock_cpu();
			ErrorHook(ercd);
			lock_cpu();
			if (saved_ipl < ipl_maxisr2) {
				set_ipl(saved_ipl);
			}
			callevel = saved_callevel;	
		}
	}
}
Esempio n. 7
0
/*
 *  エラーフックの呼び出し
 */
void
call_errorhook(StatusType ercd, OSServiceIdType svcid)
{
	UINT8	saved_callevel;
	IPL	saved_ipl;
	volatile FP	errorhook_adr;
	
	/*
	 *  C言語の規格では関数のアドレスは0にならないという前提から,
	 *  コンパイラの最適化によりErrorHookのアドレス判定分岐が
	 *  削除されてしまう場合があるため, volatile指定したローカル変数に
	 *  アドレスを代入してから判定している.
	*/
	errorhook_adr = (FP)ErrorHook;
	
	if (sus_all_cnt > 0) {
		if ((errorhook_adr != NULL) && (callevel != TCL_ERROR)) {
			_errorhook_svcid = svcid;
			ErrorHook(ercd);
		}
		ShutdownOS(E_OS_CALLEVEL);	/* 回復不可能 */
	}
	else {
		if (( errorhook_adr != NULL) && (callevel != TCL_ERROR)) {
			_errorhook_svcid = svcid;
			saved_callevel = callevel;
			callevel = TCL_ERROR;
			saved_ipl = current_ipl();
			if (saved_ipl < ipl_maxisr2) {
				set_ipl(ipl_maxisr2);
			}
			unlock_cpu();
			ErrorHook(ercd);
			lock_cpu();
			if (saved_ipl < ipl_maxisr2) {
				set_ipl(saved_ipl);
			}
			callevel = saved_callevel;	
		}
	}
}
Esempio n. 8
0
/*
 * Por ahora no vamos a entrar en detalle sobre esta función
 * La veremos más adelante
 */
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);
}
Esempio n. 9
0
/** \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)
{
   ShutdownOS(0);
}
Esempio n. 10
0
File: main.c Progetto: cpantel/ciaa
void ErrorHook(void)
{
   printError();
   uartWriteString( UART_USB, "ShutdownOS\n");
   ShutdownOS(0);
}
Esempio n. 11
0
void quit(int n)
{
    ShutdownOS(E_OK);  
}
Esempio n. 12
0
void ErrorHook(void) {
	/* kernel panic :( */
	ShutdownOS(0);
}
Esempio n. 13
0
void ErrorHook(StatusType error)
{
  errorstatus = error;
  TestRunner_runTest(AutosarTPTest_seq6_error_instance());
  ShutdownOS(E_OK);
}