Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r24e6e4df038de04e13363d1eb929b4fd693046ff -r61e5717c3410c16144d49351e727fae0992e45d2 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 24e6e4df038de04e13363d1eb929b4fd693046ff) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 61e5717c3410c16144d49351e727fae0992e45d2) @@ -87,8 +87,8 @@ #define DIALYSATE_CAP_SWITCH_MASK 0x20 ///< Dialysate cap switch bit mask.. #define FPGA_POWER_OUT_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< FPGA power out timeout in milliseconds. #define FPGA_GPIO_POWER_STATUS_PIN 7 ///< FPGA GPIO power status pin. -#define FPGA_READ_V3_START_BYTE_NUM 156 ///< FPGA V3 read sensors start byte number. -#define FPGA_READ_V3_END_BYTE_NUM 410 ///< FPGA V3 read sensors end byte number. +#define FPGA_READ_V3_START_BYTE_NUM 256 ///< FPGA V3 read sensors start byte number. +#define FPGA_READ_V3_END_BYTE_NUM 412 ///< FPGA V3 read sensors end byte number. /// FPGA size of V3 read bytes. #define FPGA_SIZE_OF_V3_READ_BYTES ( FPGA_READ_V3_END_BYTE_NUM - FPGA_READ_V3_START_BYTE_NUM ) @@ -549,14 +549,10 @@ fpgaReadByteSize = sizeof( DG_FPGA_SENSORS_T ); /*#ifndef _RELEASE_ - if( ( SW_CONFIG_ENABLE_VALUE != getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) + if( ( SW_CONFIG_ENABLE_VALUE == getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) { - fpgaReadByteSize = + fpgaReadByteSize = FPGA_SIZE_OF_V3_READ_BYTES; } - else - { - - } #endif*/ // FPGA incoming state machine @@ -619,6 +615,15 @@ *************************************************************************/ void execFPGAOut( void ) { + fpgaReadByteSize = FPGA_SIZE_OF_V3_READ_BYTES; + +#ifndef _RELEASE_ + if( ( SW_CONFIG_ENABLE_VALUE != getSoftwareConfigStatus( SW_CONFIG_ENABLE_V3_SYSTEM ) ) && ( getCurrentOperationMode() != DG_MODE_INIT ) ) + { + fpgaReadByteSize = sizeof( DG_FPGA_SENSORS_T ); + } +#endif + // FPGA outgoing state machine switch ( fpgaState ) { @@ -758,7 +763,7 @@ fpgaReadCmdBuffer[ 0 ] = FPGA_READ_CMD_CODE; fpgaReadCmdBuffer[ 1 ] = GET_LSB_OF_WORD( FPGA_BULK_READ_START_ADDR ); fpgaReadCmdBuffer[ 2 ] = GET_MSB_OF_WORD( FPGA_BULK_READ_START_ADDR ); - fpgaReadCmdBuffer[ 3 ] = sizeof( DG_FPGA_SENSORS_T ); + fpgaReadCmdBuffer[ 3 ] = fpgaReadByteSize; //sizeof( DG_FPGA_SENSORS_T ); crc = crc16( fpgaReadCmdBuffer, FPGA_READ_CMD_HDR_LEN ); fpgaReadCmdBuffer[ 4 ] = GET_MSB_OF_WORD( crc ); fpgaReadCmdBuffer[ 5 ] = GET_LSB_OF_WORD( crc ); @@ -769,7 +774,7 @@ // prep DMA for sending the bulk read cmd and receiving its response setupDMAForReadCmd( FPGA_READ_CMD_HDR_LEN + FPGA_CRC_LEN ); - setupDMAForReadResp( FPGA_READ_RSP_HDR_LEN + sizeof( DG_FPGA_SENSORS_T ) + FPGA_CRC_LEN ); + setupDMAForReadResp( FPGA_READ_RSP_HDR_LEN + fpgaReadByteSize /*sizeof( DG_FPGA_SENSORS_T )*/ + FPGA_CRC_LEN ); // set fpga comm flags for bulk write cmd and follow-up bulk read command fpgaWriteCommandInProgress = TRUE; @@ -805,7 +810,7 @@ // did FPGA Ack the read command? if ( fpgaReadResponseBuffer[ 0 ] == FPGA_READ_CMD_ACK ) { - U32 rspSize = FPGA_READ_RSP_HDR_LEN + sizeof(DG_FPGA_SENSORS_T); + U32 rspSize = FPGA_READ_RSP_HDR_LEN + fpgaReadByteSize; //sizeof( DG_FPGA_SENSORS_T ); U32 crcPos = rspSize; U16 crc = MAKE_WORD_OF_BYTES( fpgaReadResponseBuffer[ crcPos ], fpgaReadResponseBuffer[ crcPos + 1 ] ); @@ -814,7 +819,7 @@ { fpgaCommRetryCount = 0; // capture the read values - memcpy( &fpgaSensorReadings, &fpgaReadResponseBuffer[ FPGA_READ_RSP_HDR_LEN ], sizeof( DG_FPGA_SENSORS_T ) ); + memcpy( &fpgaSensorReadings, &fpgaReadResponseBuffer[ FPGA_READ_RSP_HDR_LEN ], fpgaReadByteSize /*sizeof( DG_FPGA_SENSORS_T )*/ ); result = FPGA_STATE_WRITE_ALL_ACTUATORS; } else // bad CRC