Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r1145e9197855b4f2cb79eb407d3899059b0ca410 -r9a7aa0eb2e11048600d3a189859217a82a854ebc --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 1145e9197855b4f2cb79eb407d3899059b0ca410) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 9a7aa0eb2e11048600d3a189859217a82a854ebc) @@ -297,8 +297,7 @@ // FPGA data static FPGA_HEADER_T fpgaHeader; ///< Record of last received FPGA header data. static FPGA_SENSORS_T fpgaSensorReadings; ///< Record of last received FPGA priority sensor data. -static FPGA_ACTUATORS_T fpgaActuatorSetPoints; ///< Record of next transmitted FPGA priority actuator data. -static U08 fpgaReadByteSize; ///< FPGA read byte size. +static FPGA_ACTUATORS_T fpgaActuatorSetPoints; ///< Record of next transmitted FPGA priority actuator data.static U32 fpgaReadByteSize; ///< FPGA read byte size. // ********** private function prototypes ********** @@ -518,7 +517,6 @@ *************************************************************************/ void execFPGAIn( void ) { - fpgaReadByteSize = sizeof( FPGA_SENSORS_T ); // Check if FE or OE error has occurred checkFPGAFEOEFailure(); @@ -570,11 +568,7 @@ *************************************************************************/ void execFPGAOut( void ) { - fpgaReadByteSize = sizeof( FPGA_SENSORS_T ); - // Check if FE or OE error has occurred - checkFPGAFEOEFailure(); - // FPGA outgoing state machine switch ( fpgaState ) { @@ -790,15 +784,15 @@ // did FPGA ACK the read command? if ( fpgaReadResponseBuffer[ 0 ] == FPGA_READ_CMD_ACK ) { - U32 rspSize = FPGA_READ_RSP_HDR_LEN + fpgaReadByteSize; + U32 rspSize = FPGA_READ_RSP_HDR_LEN + sizeof( FPGA_SENSORS_T ); U32 crcPos = rspSize; U16 crc = MAKE_WORD_OF_BYTES( fpgaReadResponseBuffer[ crcPos ], fpgaReadResponseBuffer[ crcPos + 1 ] ); // does the FPGA response CRC check out? if ( crc == crc16( fpgaReadResponseBuffer, rspSize ) ) { // capture the read values - memcpy( &fpgaSensorReadings, &fpgaReadResponseBuffer[ FPGA_READ_RSP_HDR_LEN ], fpgaReadByteSize ); + memcpy( &fpgaSensorReadings, &fpgaReadResponseBuffer[ FPGA_READ_RSP_HDR_LEN ], sizeof( FPGA_SENSORS_T ) ); result = FPGA_STATE_WRITE_ALL_ACTUATORS; } else // bad CRC @@ -881,7 +875,7 @@ U32 const diffFPGATimerCount = (U32)u16DiffWithWrap( currentFPGATimerCount_ms, newFPGATimerCount_ms ); U32 const diffTimerCount = u32DiffWithWrap( currentTimerCount_ms, newTimerCount_ms ); - if ( getCurrentOperationMode() != DG_MODE_INIT ) + if ( getCurrentOperationMode() != MODE_INIT ) { if ( abs( diffFPGATimerCount - diffTimerCount ) > PROCESSOR_FPGA_CLOCK_DIFF_TOLERANCE ) { @@ -2357,7 +2351,6 @@ } return status; - } /*********************************************************************//** @@ -2388,7 +2381,6 @@ } return status; - } /**@}*/