Обновление
This commit is contained in:
parent
3ea004eeec
commit
a4179952fd
111
LinSensorTasks.c
111
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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue