Commit a07d8777 authored by hu's avatar hu

解决冲突

parents ed6d38c2 09c8f60b
......@@ -29,7 +29,7 @@ typedef struct
*********************************************************************
*/
unsigned char Kwp2000_ComState_Flag;
unsigned long Kwp2000_ComState_Flag;
/*
*********************************************************************
......@@ -71,7 +71,7 @@ void Kwp2000_CallService(unsigned char Sid_u8)
serviceFound = 0;
Kwp2000_Negative.ResponseCode = 0;
#if 0
for (index = 0; index < kwp2000_CalcSeriveTabSize(); index++)
{
if (Kwp2000_ServiceTab[index].sId == Sid_u8)
......@@ -83,6 +83,63 @@ void Kwp2000_CallService(unsigned char Sid_u8)
break;
}
}
#endif
for (index = 0; index < 12; index++)
{
switch (Sid_u8)
{
case KWP2000_ECURESET_REQUEST:
Kwp2000_ComState.Tx_len = kwp_EcuReset((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_TESTERPRESENT_REQUEST:
Kwp2000_ComState.Tx_len = kwp_TesterPresent((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_STARTCOMMUNICATION_REQUEST:
Kwp2000_ComState.Tx_len = kwp_StartCommunication((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_STOPCOMMUNICATION_REQUEST:
Kwp2000_ComState.Tx_len = kwp_StopCommunication((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READECUIDENTIFICATION_REQUEST:
Kwp2000_ComState.Tx_len = kwp_readEcuIdentification((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_WRITEDATABYLOCALIDENTIFIER_REQUEST:
Kwp2000_ComState.Tx_len = kwp_writeDataByLocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READDATABYLOCALIDENTIFIER_REQUEST:
Kwp2000_ComState.Tx_len = kwp_readDataByLocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READDATABYCOMMONIDENTIFIER_REQUEST:
Kwp2000_ComState.Tx_len = kwp_readDataByCommonIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_READDIAGNOSTICTROUBLECODESBYSTATUS_REQUEST:
Kwp2000_ComState.Tx_len = kwp_readDataStatusofDTC((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_CLEARDIAGNOSTICINFORMATION_REQUEST:
Kwp2000_ComState.Tx_len = kwp_ClearDiagnosticInformation((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_SECURITYACCESS_REQUEST:
Kwp2000_ComState.Tx_len = kwp_readDataAccessMode((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
case KWP2000_STARTROUTINEBYLOCALIDENTIFIER_REQUEST:
Kwp2000_ComState.Tx_len = kwp_StartroutInebykocalIdentifier((unsigned char *)&Kwp2000_ComState.TxBuffer[4],
(unsigned char *)&Kwp2000_ComState.Request_Datas[1]);
break;
default:
break;
}
}
if (serviceFound == 0)
{
......@@ -186,22 +243,8 @@ void Kwp2000_Handle(void)
Kwp2000_ComState_Flag++;
if (Kwp2000_ComState_Flag > 7)
{
#if 0
if ()
{
SeedKey = (unsigned long)RealTimeClock.RollingCounter;
SeedKey = SeedKey << 16;
SeedKey |= (unsigned long)(~RealTimeClock.RollingCounter);
Seed1 = (unsigned char)(SeedKey >> 24);
Seed2 = (unsigned char)(SeedKey >> 16);
Seed3 = (unsigned char)(SeedKey >> 8);
Seed4 = (unsigned char)(SeedKey);
App_Uds_Calc_Key(); /*计算密钥等待应答*/
}
#endif
Kwp2000_ComState_Flag = 0;
Kwp2000_CallService(Kwp2000_ComState.SId);
//Kwp2000_CallService(Kwp2000_ComState.SId);
}
if (Kwp2000_ComState.Tx_len != 0)
......@@ -280,5 +323,5 @@ void Kwp2000_Handle(void)
--------------------------------------------------------------------------*/
unsigned char kwp2000_CalcSeriveTabSize(void)
{
return (unsigned char)(sizeof(Kwp2000_ServiceTab) / sizeof(Kwp2000_ServiceTab_Entry_t));
//return (unsigned char)(sizeof(Kwp2000_ServiceTab) / sizeof(Kwp2000_ServiceTab_Entry_t));
}
......@@ -41,7 +41,7 @@ unsigned char DTCstatusCHGFFK_Line = 0u;
unsigned char AccessMode2701KeyTimeFlag;
unsigned char AccessMode2701KeyTime;
unsigned long EOLSeedRandomNumber = 0x6879716169716872ul;
unsigned long EOLSeedRandomNumber = 0x727u;
_ECUStatus ECUStatusONE;
_EOL_K_LINE_SET K_Line_Set;
......@@ -1118,7 +1118,7 @@ unsigned char kwp_readDataByCommonIdentifier(unsigned char *TxData, unsigned cha
--------------------------------------------------------------------------*/
unsigned char kwp_readDataAccessMode(unsigned char *TxData, unsigned char *RequestData)
{
unsigned long SeedKey = 0;
static unsigned long SeedKey = 0;
unsigned char Tx_Len = 0;
switch (RequestData[0]) /* subFunction */
......@@ -1127,10 +1127,10 @@ unsigned char kwp_readDataAccessMode(unsigned char *TxData, unsigned char *Reque
if (K_Line_Set.KLINE == 1)/*是否锁定标记*/
{
/*密钥随机数生成*/
EOLSeedRandomNumber = EOLSeedRandomNumber * 1024 + 520;
SeedKey = (unsigned long)EOLSeedRandomNumber;
SeedKey = SeedKey << 16;
SeedKey |= (unsigned long)(~EOLSeedRandomNumber);
SeedKey = EOLSeedRandomNumber * 1103515245ul + 12345u;
//SeedKey = (unsigned long)EOLSeedRandomNumber;
//SeedKey = SeedKey << 16;
//SeedKey |= (unsigned long)(~EOLSeedRandomNumber);
Seed1 = (unsigned char)(SeedKey >> 24);
Seed2 = (unsigned char)(SeedKey >> 16);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/***********************************************************************************************
PROJECT : simple_draw
FILE : $Id: main.h 13335 2017-04-24 07:17:12Z shinya.tomari $
============================================================================
DESCRIPTION
header for simple_draw
============================================================================
C O P Y R I G H T
============================================================================
Copyright (c) 2013 - 2014
by
Renesas Electronics (Europe) GmbH.
Arcadiastrasse 10
D-40472 Duesseldorf
Germany
All rights reserved.
============================================================================
Purpose: only for testing, not for mass production
DISCLAIMER
LICENSEE has read, understood and accepted the terms and conditions defined in
the license agreement, especially the usage rights. In any case, it is
LICENSEE's responsibility to make sure that any user of the software complies
with the terms and conditions of the signed license agreement.
SAMPLE CODE is not part of the licensed software, as such it must not be used in
mass-production applications. It can only be used for evaluation and
demonstration purposes at customer's premises listed in the signed license
agreement.
****************************************************************************
*/
#ifndef MAIN_H_
#define MAIN_H_
#ifdef __cplusplus
extern "C" {
#endif
#define LOC_JCUA_UNIT (0u)
#define LOC_SFMA_UNIT (0u)
#define LOC_VDCE_UNIT (0u)
#if LOC_RING_BUFFER_MODE == 0
#define LOC_VOWE_DL_ADDR_LENGTH_1 (VOWE_DL_FanWise_Warping80_240_320_LENGTH)
#define LOC_VOWE_DL_ADDR_LENGTH_2 (VOWE_DL_FanWise_Warping10_240_320_LENGTH)
#define LOC_VOWE_DL_ADDR_1 (VOWE_DL_FanWise_Warping80_240_320)
#define LOC_VOWE_DL_ADDR_2 (VOWE_DL_FanWise_Warping10_240_320)
#define LOC_VOWE_LSPR (VOWE_LSPR_FanWise_Warping80_240_320)
#define LOC_VOWE_WORK_BUFF_MODE (R_VOWE_FRAME_BUFFER_MODE)
#define LOC_VOWE_WORK_BUFF_SIZE (LOC_VOWE_FRAME_BUF_SIZE)
#else
#define LOC_VOWE_DL_ADDR_LENGTH_1 (VOWE_DL_FanWise_Warping80_240_320_RingBuffer_LENGTH)
#define LOC_VOWE_DL_ADDR_LENGTH_2 (VOWE_DL_FanWise_Warping10_240_320_RingBuffer_LENGTH)
#define LOC_VOWE_DL_ADDR_1 (VOWE_DL_FanWise_Warping80_240_320_RingBuffer)
#define LOC_VOWE_DL_ADDR_2 (VOWE_DL_FanWise_Warping10_240_320_RingBuffer)
#define LOC_VOWE_LSPR (VOWE_LSPR_FanWise_Warping80_240_320_RingBuffer)
#define LOC_VOWE_WORK_BUFF_MODE (R_VOWE_RING_BUFFER_MODE)
#define LOC_VOWE_WORK_BUFF_SIZE (LOC_VOWE_RING_BUF_SIZE)
#endif
/*******************************************************************************
Section: Local Functions
*/
void loc_Error(int32_t Err);
void* loc_StartSFMA(void);
void loc_StopSFMA(void);
void* loc_StartOCTA(void);
void loc_StopOCTA(void);
void* loc_StartHYPB(void);
void loc_StopHYPB(void);
void loc_VoweStart(void);
void loc_VoweStop(void);
void loc_Vowe_DLChange(int32_t dl_cnt);
void loc_JcuaRun(void);
#ifdef __cplusplus
}
#endif
#endif /* MAIN_H */
......@@ -54,23 +54,31 @@ CONSTANTS
}
MEMORY
{
iROM_0 : ORIGIN = 0x00000000, LENGTH = 2048k
/*iROM_0 : ORIGIN = 0x00200400, LENGTH = 2048k*/
{
//#if (WITHOUT_BOOT)
iROM_0 : ORIGIN = 0x00000000, LENGTH = 5120k
//#else
//iROM_0 : ORIGIN = 0x00200400, LENGTH = 2048k
//#endif
iRAM_0 : ORIGIN = 0xFEB80000, LENGTH = 512k /* RAM addres space seen by external bus masters */
iRAM_1 : ORIGIN = 0xFED80000, LENGTH = 512k /* local RAM address space */
iRAM_R0 : ORIGIN = 0x3FCE4000, LENGTH = 1k
iRAM_R : ORIGIN = 0x3FCE4400, LENGTH = 15k
}
}
SECTIONS
{
{
/* Start of internal ROM area (iROM_0) */
.intvect :>iROM_0 /* start of interrupt vector */
.intvect_end 0x00000600 :>. /* end of interrupt vector */
/*.intvect_end 0x00200A00 :>. */ /* end of interrupt vector */
//#if (WITHOUT_BOOT)
.intvect_end 0x000600 :>. /* end of interrupt vector */
//#else
//.intvect_end 0x200a00 :>. /* end of interrupt vector */
//#endif
.text align(4) :>. /* program code area */
.rozdata :>. /* constant datas in ZDA area */
......@@ -110,6 +118,7 @@ SECTIONS
.ramfunc align(4) :>. /* program code in RAM area */
.stack align(4) pad(0x4000) :>. /* definition of stack size */
/* Renesas FDL data sections */
.R_FDL_Data :>. /* FDL data */
.heapbase align(4) :>.
......
......@@ -65,6 +65,7 @@
------------- User modifiable section
-------------------------------------------------------------------------------
.weak ___lowinit
.set EBV, 0x8000
.text
_RESET:
-- Initialisation of the global pointer
......@@ -80,9 +81,20 @@ _RESET:
and r1,sp
-- Initialization of the interrupt base pointer
mov IRQ_TABLE_START,r1
mov __ex_entry + IRQ_TABLE_START,r1
ldsr r1,intbp,1
mov __ex_entry, r10
ldsr r10, EBASE, 1
stsr PSW, r10, 0
mov EBV, r11
or r11, r10
ldsr r10, PSW, 0
-- Jump to the HW Initialisation function
jarl ___lowinit, lp
-- Either disable ECC ...
-- mov 0xFFC65400, r6
-- mov 0x4001, r7
......@@ -91,7 +103,10 @@ _RESET:
-- ... or Clear all SelfRAM
mov ___ghs_ramstart, r6 -- start of lram
mov ___ghs_ramend, r7 -- end of lram
mov r0, r1
cmp r7, r6 -- is only retention RAM available?
be 5f -- skip initialization of RAM
1:
st.dw r0, 0[r6]
addi 8, r6, r6
......@@ -118,8 +133,7 @@ _RESET:
#endif
-- Jump to the HW Initialisation function
jarl ___lowinit, lp
5:
-- Jump to the Initialisation functions of the library,
-- from there to main()
jr __start
......@@ -147,6 +161,7 @@ __unused_isr:
.global _RESET
.offset 0x0000
__ex_entry:
#if (RESET_ENABLE > 0x00000000)
.extern _RESET
jr _RESET
......
......@@ -57,6 +57,15 @@
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
void DelayUs(uint32_t time)
{
uint32_t i;
for (i = 0; i < (time * 2); i++)
{
R_DEV_Nop();
WDT_Clear();
}
}
/**************************************************************************//**
* \brief Initializations during work state switching
* \attention
......@@ -103,9 +112,6 @@ extern uint32_t TestBackupRam;
void Sys_Startup_Init(void)
{
Clock_Init();
/* Enable interrupts globally */
enable_interrupt();
......@@ -126,6 +132,8 @@ void Sys_Startup_Init(void)
RTE_ADC_Init();
DelayUs(50000);
DelayUs(50001);
Int_Flash_Init();
......
......@@ -93,7 +93,7 @@
#include "UART.h"
static uint8_t u08_1ms_count;
static uint32_t K_Line1ms_count;
/*******************************************************************************
* *
......@@ -304,10 +304,10 @@ void Sys_Exact_50us_Tasks(void)
Buzzer_Play_ISR();
/*----K_Line----*/
u08_1ms_count ++;
if (u08_1ms_count >= 20)
K_Line1ms_count ++;
if (K_Line1ms_count >= 20)
{
u08_1ms_count = 0;
K_Line1ms_count = 0;
Kwp2000_ComInit_Handle();
Kwp2000_Handle(); /* qitiancun */
Kwp2000_Timeout();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment