From a4179952fdea9e0a294a775952c889afbd09bbad Mon Sep 17 00:00:00 2001 From: cfif Date: Thu, 26 Feb 2026 17:42:46 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LinSensorTasks.c | 111 ++++++++++++++++++++++++----------------------- 1 file changed, 57 insertions(+), 54 deletions(-) diff --git a/LinSensorTasks.c b/LinSensorTasks.c index acd14d4..6eb7a6b 100644 --- a/LinSensorTasks.c +++ b/LinSensorTasks.c @@ -76,60 +76,6 @@ static lin_event_id_t Get_AirQS_Stat(tLinIO *linIo, tLinData *linData, tAirQS_St } -static lin_event_id_t Set_CCU_DRS_Req(tLinIO *linIo, tLinData *linData, tCCU_DRS_Req *p_CCU_DRS_Req) { - lin_event_id_t res; - - linData->direction = LIN_DIRECTION_SET; - - linData->g_aTxBufferLen = sizeof(tCCU_DRS_Req); - linData->g_aRxBufferLen = 0; - - memcpy(linData->g_aTxBuffer, p_CCU_DRS_Req, sizeof(tCCU_DRS_Req)); - - uint8_t retry = 1; - - while (retry) { - - res = SEND_SENSOR_COM_x(linIo, CCU_DRS_Req); - - SystemDelayMs(50); - - if (res == LIN_TX_COMPLETED) { - break; - } - - --retry; - } - - return res; -} - -static lin_event_id_t Get_DRS_DL_Stat(tLinIO *linIo, tLinData *linData, tDRS_DL_Stat *p_tDRS_DL_Stat) { - lin_event_id_t res; - - tDRS_DL_Stat *tDRS_DL_Stat_ = (tDRS_DL_Stat *) linData->g_aRxBuffer; - - uint8_t retry = 3; - - while (retry) { - - linData->direction = LIN_DIRECTION_GET; - - linData->g_aTxBufferLen = 0; - linData->g_aRxBufferLen = sizeof(tDRS_DL_Stat); - - res = SEND_SENSOR_COM_x(linIo, DRS_DL_Stat); - - if (res == LIN_RX_COMPLETED) { - memcpy(p_tDRS_DL_Stat, tDRS_DL_Stat_, sizeof(tDRS_DL_Stat)); - break; - } - - --retry; - } - - return res; -} //начало----------------------------------------- LIN 4 ---------------------------------------------------------------- //начало----------------------------------------- LIN 4 ---------------------------------------------------------------- @@ -220,6 +166,63 @@ void Lin4_StartThread(tLin4TaskSensor *env) { //начало----------------------------------------- LIN 5 ---------------------------------------------------------------- //начало----------------------------------------- LIN 5 --------------------------------------------------------------- +static lin_event_id_t Set_CCU_DRS_Req(tLinIO *linIo, tLinData *linData, tCCU_DRS_Req *p_CCU_DRS_Req) { + lin_event_id_t res; + + linData->direction = LIN_DIRECTION_SET; + + linData->g_aTxBufferLen = sizeof(tCCU_DRS_Req); + linData->g_aRxBufferLen = 0; + + memcpy(linData->g_aTxBuffer, p_CCU_DRS_Req, sizeof(tCCU_DRS_Req)); + + uint8_t retry = 1; + + while (retry) { + + res = SEND_SENSOR_COM_x(linIo, CCU_DRS_Req); + + SystemDelayMs(50); + + if (res == LIN_TX_COMPLETED) { + break; + } + + --retry; + } + + return res; +} + +static lin_event_id_t Get_DRS_DL_Stat(tLinIO *linIo, tLinData *linData, tDRS_DL_Stat *p_tDRS_DL_Stat) { + lin_event_id_t res; + + tDRS_DL_Stat *tDRS_DL_Stat_ = (tDRS_DL_Stat *) linData->g_aRxBuffer; + + uint8_t retry = 3; + + while (retry) { + + linData->direction = LIN_DIRECTION_GET; + + linData->g_aTxBufferLen = 0; + linData->g_aRxBufferLen = sizeof(tDRS_DL_Stat); + + res = SEND_SENSOR_COM_x(linIo, DRS_DL_Stat); + + if (res == LIN_RX_COMPLETED) { + memcpy(p_tDRS_DL_Stat, tDRS_DL_Stat_, sizeof(tDRS_DL_Stat)); + break; + } + + --retry; + } + + return res; +} + + + uint8_t led = 0; static lin_event_id_t Lin5_Scheduler(tLin5TaskSensor *env) {