1 /* -------------------------------- Arctic Core ------------------------------
\r
2 * Arctic Core - the open source AUTOSAR platform http://arccore.com
\r
4 * Copyright (C) 2009 ArcCore AB <contact@arccore.com>
\r
6 * This source code is free software; you can redistribute it and/or modify it
\r
7 * under the terms of the GNU General Public License version 2 as published by the
\r
8 * Free Software Foundation; See <http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt>.
\r
10 * This program is distributed in the hope that it will be useful, but
\r
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
\r
14 * -------------------------------- Arctic Core ------------------------------*/
\r
24 #include "EcuM_Internals.h"
\r
26 void EcuM_MainFunction(void)
\r
28 #if (ECUM_DEV_ERROR_DETECT == STD_ON)
\r
29 if (!internal_data->initiated)
\r
31 Det_ReportError(MODULE_ID_ECUM, 1, ECUM_MAINFUNCTION_ID, ECUM_E_NOT_INITIATED);
\r
36 // If coming from startup sequence, enter Run mode
\r
37 if (internal_data->current_state == ECUM_STATE_STARTUP_TWO)
\r
40 if (internal_data->current_state == ECUM_STATE_APP_RUN)
\r
42 if (!hasRunRequests() && (internal_data_run_state_timeout == 0))
\r
44 enter_post_run_mode();
\r
49 if (internal_data->current_state == ECUM_STATE_APP_POST_RUN)
\r
51 if (hasRunRequests())
\r
53 enter_run_mode(); // ECUM_2866
\r
57 if (!hasPostRunRequests())
\r
59 EcuM_OnExitPostRun(); // ECUM_2761
\r
60 enter_prep_shutdown_mode();
\r