Skip to content

Commit

Permalink
источники сообщения в лог теперь пишутся единообразно
Browse files Browse the repository at this point in the history
  • Loading branch information
iamsaywhat committed Jun 25, 2020
1 parent aa3d6c0 commit 142d78c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
12 changes: 6 additions & 6 deletions loger.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ void logger_openNewSession(void)
logger_warning("Load zpz mode.."); // То сообщаем об этом

if(SelfTesting_STATUS(ST_1636PP52Y) == ST_FAULT) // Пишем только жесткие неисправности
logger_error("flash 1636pp52y: fault");
logger_error("1636pp52y: fault");
if(SelfTesting_STATUS(ST_25Q64FV) == ST_FAULT)
logger_error("flash 25q64fv: fault");
logger_error("25q64fv: fault");
if(SelfTesting_STATUS(ST_sns) == ST_FAULT)
logger_error("sns: fault");
if(SelfTesting_STATUS(ST_sws) == ST_FAULT)
Expand All @@ -63,11 +63,11 @@ void logger_openNewSession(void)
logger_error("map: not loaded");

// Здесь сообщаем, а каком состоянии сейчас остальное
SelfTesting_STATUS(ST_pin1) == ST_FAULT ? logger_warning("Pin1 is not inserted")
: logger_warning("Pin1 is inserted");
SelfTesting_STATUS(ST_pin1) == ST_FAULT ? logger_warning("pin1: not inserted")
: logger_warning("pin1: inserted");

SelfTesting_STATUS(ST_pin2) == ST_FAULT ? logger_warning("Pin2 is not inserted")
: logger_warning("Pin2 is inserted");
SelfTesting_STATUS(ST_pin2) == ST_FAULT ? logger_warning("pin2: not inserted")
: logger_warning("pin2: inserted");

SelfTesting_STATUS(ST_MapAvailability) == ST_FAULT ? logger_warning("map: not available")
: logger_warning("map: available");
Expand Down
30 changes: 15 additions & 15 deletions selftesting.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,13 @@ SelfTesting_STATUS_TYPE SelfTesting_LEFT_BIM(void)
if(SelfTesting_STATUS(ST_Left_BIM) == ST_OK)
{
#ifdef LOGS_ENABLE
logger_warning("left bim: ready");
logger_warning("left-bim: ready");
#endif
}
else
{
#ifdef LOGS_ENABLE
logger_error("left bim: fault");
logger_error("left-bim: fault");
#endif
}
}
Expand Down Expand Up @@ -478,13 +478,13 @@ SelfTesting_STATUS_TYPE SelfTesting_RIGHT_BIM(void)
if(SelfTesting_STATUS(ST_Right_BIM) == ST_OK)
{
#ifdef LOGS_ENABLE
logger_warning("right bim: ready");
logger_warning("right-bim: ready");
#endif
}
else
{
#ifdef LOGS_ENABLE
logger_error("right bim: fault");
logger_error("right-bim: fault");
#endif
}
}
Expand Down Expand Up @@ -528,7 +528,7 @@ void SelfTesting_BIMS_TRY_CONNECT(void)
setTimeout(&timeout, 10000); // Взводим новый таймаут
needToReset = 1; // Взводим флаг необходимости перезауска
#ifdef LOGS_ENABLE
logger_error("bim is faulty! trying to restart power");
logger_error("bims is faulty! trying to restart power");
#endif
}
}
Expand Down Expand Up @@ -556,13 +556,13 @@ SelfTesting_STATUS_TYPE SelfTesting_PIN1(void)
if(SelfTesting_STATUS(ST_pin1) == ST_OK)
{
#ifdef LOGS_ENABLE
logger_warning("pin1 has been inserted");
logger_warning("pin1: has been inserted");
#endif
}
else
{
#ifdef LOGS_ENABLE
logger_warning("pin1 has been removed");
logger_warning("pin1: has been removed");
#endif
}
}
Expand Down Expand Up @@ -591,13 +591,13 @@ SelfTesting_STATUS_TYPE SelfTesting_PIN2(void)
if(SelfTesting_STATUS(ST_pin2) == ST_OK)
{
#ifdef LOGS_ENABLE
logger_warning("pin1 has been inserted!");
logger_warning("pin1: has been inserted!");
#endif
}
else
{
#ifdef LOGS_ENABLE
logger_warning("pin2 has been removed!");
logger_warning("pin2: has been removed!");
#endif
}
}
Expand Down Expand Up @@ -626,13 +626,13 @@ SelfTesting_STATUS_TYPE SelfTesting_PYRO(void)
if(SelfTesting_STATUS(ST_pyro) == ST_OK)
{
#ifdef LOGS_ENABLE
logger_warning("pyro has been enabled!");
logger_warning("pyro: has been enabled!");
#endif
}
else
{
#ifdef LOGS_ENABLE
logger_warning("pyro has been disabled!");
logger_warning("pyro: has been disabled!");
#endif
}
}
Expand Down Expand Up @@ -661,13 +661,13 @@ SelfTesting_STATUS_TYPE SelfTesting_BLIND(void)
if(SelfTesting_STATUS(ST_blind) == ST_OK)
{
#ifdef LOGS_ENABLE
logger_warning("blind has been enabled");
logger_warning("blind: has been enabled");
#endif
}
else
{
#ifdef LOGS_ENABLE
logger_warning("blind has been disabled");
logger_warning("blind: has been disabled");
#endif
}
}
Expand Down Expand Up @@ -767,13 +767,13 @@ SelfTesting_STATUS_TYPE SelfTesting_POW_BIM (void)
if(SelfTesting_SET_OK(ST_POW_BIM) == ST_ENABLE)
{
#ifdef LOGS_ENABLE
logger_warning("bims's relay has been enabled!");
logger_warning("bims-relay: has been enabled!");
#endif
}
else
{
#ifdef LOGS_ENABLE
logger_warning("bims's relay has been disabled!");
logger_warning("bims-relay: has been disabled!");
#endif
}
}
Expand Down

0 comments on commit 142d78c

Please sign in to comment.