/trunk/canbus.c |
---|
207,14 → 207,13 |
void ProcessCanBus(void) |
{ |
u32 errorcnt = 0; |
CanSend(); |
CanReceive(); |
errorcnt = CAN_GetTransmitErrorCounter(); |
//DebugOut.Analog[18] = errorcnt; |
//if(errorcnt > 200) CanbusInit(); |
//DebugOut.Analog[16] = CAN->SR ; |
if(CanbusTimeOut < 3) |
{ |
if(CanbusTimeOut == 1) Partner.ErrorCode = 39; // ERR: Canbus |
224,13 → 223,19 |
Partner.NC_To_FC_Flags = 0; |
Partner.MagnetField = 0; |
Partner.GyroCompassCorrected = -1; |
sprintf(PartnerErrorMSG," --- \0"); |
} |
if(CanRxMessage[CAN_ID_VERSION].D.Byte[6] == 13) // dann ist der Testdummy angeschlossen -> nur zum Testen von EXT2 |
{ |
if((PartnerErrorMSG[17] + PartnerErrorMSG[18]) & 1) EXT2_ON; |
else EXT2_OFF; |
} |
if(AllMsgsReceived) |
{ |
u32 i; |
AllMsgsReceived = 0; |
// DebugOut.Analog[16]++; |
CanbusTimeOut = 1000; |
for(i=0; i<8;i++) |
{ |
252,11 → 257,8 |
{ |
GPS_FailsafePosition.Longitude = CanRxMessage[CAN_ID_FS_LON].D.sLong; |
GPS_FailsafePosition.Latitude = CanRxMessage[CAN_ID_FS_LAT].D.sLong; |
//DebugOut.Analog[17] = CanRxMessage[CAN_ID_FS_LON].D.sLong / 100000; |
//DebugOut.Analog[18] = CanRxMessage[CAN_ID_FS_LAT].D.sLong / 100000; |
} |
} |
} |
/trunk/led.c |
---|
5,6 → 5,19 |
u8 Led_Grn_Inv = 0; |
u8 Led_Red_Inv = 0; |
void EXT2_Init(void) // digital Trigger Output |
{ |
GPIO_InitTypeDef GPIO_InitStructure; |
// set port pin 6.2 to output |
GPIO_StructInit(&GPIO_InitStructure); |
GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; |
GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt1; |
GPIO_Init(GPIO6, &GPIO_InitStructure); |
} |
void Led_Init(void) |
{ |
u8 p5; |
68,14 → 81,5 |
GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
GPIO_InitStructure.GPIO_Alternate = GPIO_InputAlt1; |
GPIO_Init(GPIO6, &GPIO_InitStructure); |
// set port pin 6.2 to output |
GPIO_StructInit(&GPIO_InitStructure); |
GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; |
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2; |
GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull; |
GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt1; |
GPIO_Init(GPIO6, &GPIO_InitStructure); |
GPIO_WriteBit(GPIO6, GPIO_Pin_2, Bit_SET); |
*/ |
} |
/trunk/led.h |
---|
8,6 → 8,8 |
#define LED_GRN_OFF {if(Led_Grn_Inv) GPIO_WriteBit(GPIO5, GPIO_Pin_6, Bit_SET); else GPIO_WriteBit(GPIO5, GPIO_Pin_6, Bit_RESET);} |
#define LED_GRN_TOGGLE if (GPIO_ReadBit(GPIO5, GPIO_Pin_6)) GPIO_WriteBit(GPIO5, GPIO_Pin_6, Bit_RESET); else GPIO_WriteBit(GPIO5, GPIO_Pin_6, Bit_SET); |
#define EXT2_ON GPIO_WriteBit(GPIO6, GPIO_Pin_2, Bit_SET) |
#define EXT2_OFF GPIO_WriteBit(GPIO6, GPIO_Pin_2, Bit_RESET) |
#define LED_RED_ON_T // {if(Led_Red_Inv) GPIO_WriteBit(GPIO5, GPIO_Pin_7, Bit_RESET); else GPIO_WriteBit(GPIO5, GPIO_Pin_7, Bit_SET);} |
#define LED_RED_OFF_T // {if(Led_Red_Inv) GPIO_WriteBit(GPIO5, GPIO_Pin_7, Bit_SET); else GPIO_WriteBit(GPIO5, GPIO_Pin_7, Bit_RESET);} |
18,5 → 20,6 |
extern u8 Version_HW; |
void Led_Init(void); |
void EXT2_Init(void); |
#endif //_LED_H |