diff --git a/LIN_Stack/bsp/SCI/lin_lld_sci.c b/LIN_Stack/bsp/SCI/lin_lld_sci.c index d245109..3056c08 100644 --- a/LIN_Stack/bsp/SCI/lin_lld_sci.c +++ b/LIN_Stack/bsp/SCI/lin_lld_sci.c @@ -1598,9 +1598,10 @@ void lin_lld_sci_isr () /* trigger callback */ CALLBACK_HANDLER((l_ifc_handle)ifc, LIN_LLD_CHECKSUM_ERR, current_id); lin_goto_idle_state(); - + lin_pFrameBuf[7] |= 0x80; } - lin_pFrameBuf[6] = l_status.byte; + //lin_pFrameBuf[5] = tmp_byte; + //lin_pFrameBuf[6] = l_status.byte; } cnt_byte++; break; @@ -1619,6 +1620,20 @@ void lin_lld_sci_isr () } l_u8_wr_LI0_MFL_Zaehler(MFS_RollingCounter); } + + if (cnt_byte==6) + { + if (lin_error_in_response == 1) + { + response_buffer[8] |= 0x80; + } + else + { + response_buffer[8] &= 0x7f; + } + response_buffer[9] = lin_checksum(response_buffer, lin_process_parity(current_id,MAKE_PARITY)); + } + } if (0 == (sci_flag_sr1&SCISR1_TC_MASK )) @@ -1662,6 +1677,8 @@ void lin_lld_sci_isr () /* Trigger callback */ CALLBACK_HANDLER((l_ifc_handle)ifc, LIN_LLD_TX_COMPLETED, current_id); lin_goto_idle_state(); + lin_error_in_response = 0; + lin_pFrameBuf[7] &= 0x7f; break; /****************************** *** 4.8 SLAVE: Low power mode diff --git a/LIN_Stack/coreapi/lin_common_proto.c b/LIN_Stack/coreapi/lin_common_proto.c index f7ae8ed..3baf885 100644 --- a/LIN_Stack/coreapi/lin_common_proto.c +++ b/LIN_Stack/coreapi/lin_common_proto.c @@ -537,10 +537,11 @@ void lin_process_uncd_frame if (MAKE_UNCONDITIONAL_FRAME == type) { /* get data from lin frame buffer */ - flag = lin_frame_updating_flag_tbl[frame_index]; + flag = lin_frame_updating_flag_tbl[frame_index];//TODO:有溢出? for (i = 1; i < lin_lld_response_buffer[0]+1; i++, frame_byte_offset++) { + /* if(flag & (1<<(i-1))) { lin_lld_response_buffer[i] = buffer_backup_data[i-1]; @@ -548,7 +549,8 @@ void lin_process_uncd_frame else { lin_lld_response_buffer[i] = lin_pFrameBuf[frame_byte_offset]; - } + }*/ + lin_lld_response_buffer[i] = lin_pFrameBuf[frame_byte_offset]; } } else diff --git a/Sources/diagnostic/diagnostic_DID.c b/Sources/diagnostic/diagnostic_DID.c index e16c87a..04e72c3 100644 --- a/Sources/diagnostic/diagnostic_DID.c +++ b/Sources/diagnostic/diagnostic_DID.c @@ -40,7 +40,7 @@ const TYPE_DIDSRVARR DID_CheckArr[DEF_DID_NUM]={ }; //const char DIDList_SWVersion[8]@0xff7000="SW0102"; -const char DIDList_SWVersion[4]="0308"; +const char DIDList_SWVersion[4]="0309"; const char DIDList_HWVersion[3]="H04"; const unsigned char DIDList_PartNumber[8]={0x11,0x22,0x33,0x44}; const unsigned char DIDList_ManufacturingData[8]={0x20,0x20,0x07,0x22}; diff --git a/lin_cfg/lin_cfg.h b/lin_cfg/lin_cfg.h index e728f51..85c81ff 100644 --- a/lin_cfg/lin_cfg.h +++ b/lin_cfg/lin_cfg.h @@ -86,7 +86,7 @@ #define _TL_FRAME_SUPPORT_ _TL_MULTI_FRAME_ /* frame buffer size */ -#define LIN_FRAME_BUF_SIZE 12 +#define LIN_FRAME_BUF_SIZE 30 #define LIN_FLAG_BUF_SIZE 6 /**********************************************************************/