Index: firmware/App/Services/FPGA.c =================================================================== diff -u -ref6283257df7c1f993d58fb934da57ea3e0a7067 -r54ef95cc10bd42a8c8804e7af9c5d38bff84198d --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision ef6283257df7c1f993d58fb934da57ea3e0a7067) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 54ef95cc10bd42a8c8804e7af9c5d38bff84198d) @@ -115,6 +115,7 @@ #define PUMP_TRACK_SWITCH_MASK 0x0020 ///< Pump track switch bit mask. Bit 5 of the GPIO register. #define PROCESSOR_FPGA_CLOCK_DIFF_TOLERANCE 1 ///< Tolerance for processor clock speed check against FPGA clock. +#define FPGA_VALVES_MIN_PWM_MODE_COUNT 2500 ///< FPGA valves minimum PWM in PWM mode in counts. // FPGA Sensors Record #pragma pack(push,1) @@ -138,7 +139,7 @@ { U08 errorCountProcessor; ///< Reg 256. TBD. U08 errorCountPC; ///< Reg 257. TBD. - U08 reserved1; ///< Reg 258. Reserved. + U08 fpgaHWConfigReg; ///< Reg 258. Hardware configuration register (i.e. BETA or DVT) U08 reserved2; ///< Reg 259. Reserved. F32 reserved3; ///< Reg 260. Reserved. U08 reserved4; ///< Reg 264. Reserved. @@ -374,8 +375,15 @@ memset( &fpgaHeader, 0, sizeof(FPGA_HEADER_T) ); memset( &fpgaSensorReadings, 0, sizeof(FPGA_SENSORS_T) ); memset( &fpgaActuatorSetPoints, 0, sizeof(FPGA_ACTUATORS_T) ); - fpgaActuatorSetPoints.alarmControl = (U08)MIN_ALARM_VOLUME_ATTENUATION << 2; // Start alarm audio volume at maximum + fpgaActuatorSetPoints.alarmControl = (U08)MIN_ALARM_VOLUME_ATTENUATION << 2; // Start alarm audio volume at maximum + // Set the HD valves fixed PWM mode to 2500, so if it was commanded to be in PWM mode rather than PID control + // the valves will not move to 0 position + fpgaActuatorSetPoints.VDiPWMFixed = FPGA_VALVES_MIN_PWM_MODE_COUNT; + fpgaActuatorSetPoints.VDoPWMFixed = FPGA_VALVES_MIN_PWM_MODE_COUNT; + fpgaActuatorSetPoints.VBAPWMFixed = FPGA_VALVES_MIN_PWM_MODE_COUNT; + fpgaActuatorSetPoints.VBVPWMFixed = FPGA_VALVES_MIN_PWM_MODE_COUNT; + // Initialize fpga comm buffers memset( &fpgaWriteCmdBuffer, 0, FPGA_WRITE_CMD_BUFFER_LEN ); memset( &fpgaReadCmdBuffer, 0, FPGA_READ_CMD_BUFFER_LEN ); @@ -2333,6 +2341,23 @@ return ( fpgaSensorReadings.fpgaGPIO & PUMP_TRACK_SWITCH_MASK ); } +#ifndef _RELEASE_ +/*********************************************************************//** + * @brief + * The getHardwareConfigStatus function returns the status of the hardware + * configuration. + * @details Inputs: fpgaSensorReadings + * @details Outputs: none + * @return status of the hardware configuration + *************************************************************************/ +HARDWARE_CONFIG_T getHardwareConfigStatus( void ) +{ + HARDWARE_CONFIG_T configValue = (HARDWARE_CONFIG_T)fpgaSensorReadings.fpgaHWConfigReg; + + return configValue; +} +#endif + #ifdef DEBUG_ENABLED /*********************************************************************//** * @brief @@ -2360,5 +2385,5 @@ return fpgaSensorReadings.VBAPWMTarget; } #endif - + /**@}*/