Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -rac05209d7b6c65b22359754eced5ad2672d3092a -rab529a77ce03051a5940ee59b7542837778f8788 --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision ac05209d7b6c65b22359754eced5ad2672d3092a) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision ab529a77ce03051a5940ee59b7542837778f8788) @@ -83,7 +83,7 @@ /// alarm user recovery actions enabled flags. static BOOL alarmUserRecoveryActionEnabled[ NUMBER_OF_ALARM_USER_ACTIONS ]; -static U32 alarmAudioVolumeLevel = 2; //MAX_ALARM_VOLUME_LEVEL; ///< Set alarm audio volume level (0..7). +static U32 alarmAudioVolumeLevel = 3; //MIN_ALARM_VOLUME_ATTENUATION; ///< Set alarm audio volume attenuation level (0..4 - lower level = higher gain). // ********** private function prototypes ********** @@ -560,14 +560,14 @@ * The setAlarmAudioVolume function sets the current alarm audio volume level. * @details Inputs: none * @details Outputs: alarmAudioVolumeLevel -* @param volumeLevel level of volume requested (0..7) +* @param volumeLevel level of volume requested (1..5) * @return none *************************************************************************/ void setAlarmAudioVolume( U32 volumeLevel ) { - if ( volumeLevel <= MAX_ALARM_VOLUME_LEVEL ) - { - alarmAudioVolumeLevel = volumeLevel; + if ( ( volumeLevel > 0 ) && ( volumeLevel <= MAX_ALARM_VOLUME_LEVEL ) ) + { // convert volume level to attenuation level + alarmAudioVolumeLevel = MAX_ALARM_VOLUME_LEVEL - volumeLevel; } } Index: firmware/App/Services/AlarmMgmt.h =================================================================== diff -u -rdf41331377d5da437e853327019c17c58e3af775 -rab529a77ce03051a5940ee59b7542837778f8788 --- firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision df41331377d5da437e853327019c17c58e3af775) +++ firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision ab529a77ce03051a5940ee59b7542837778f8788) @@ -37,7 +37,9 @@ /// Interval (in ms) at which alarm lamp and audio control will be executed. #define ALARM_LAMP_AND_AUDIO_CONTROL_INTERVAL_MS 250 -#define MAX_ALARM_VOLUME_LEVEL 7 +#define MAX_ALARM_VOLUME_LEVEL 5 +#define MAX_ALARM_VOLUME_ATTENUATION 4 +#define MIN_ALARM_VOLUME_ATTENUATION 0 /// Enumeration of alarm actions. typedef enum Alarm_Actions Index: firmware/App/Services/FPGA.c =================================================================== diff -u -rac05209d7b6c65b22359754eced5ad2672d3092a -rab529a77ce03051a5940ee59b7542837778f8788 --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision ac05209d7b6c65b22359754eced5ad2672d3092a) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision ab529a77ce03051a5940ee59b7542837778f8788) @@ -299,7 +299,7 @@ memset( &fpgaHeader, 0, sizeof(FPGA_HEADER_T) ); memset( &fpgaSensorReadings, 0, sizeof(FPGA_SENSORS_T) ); memset( &fpgaActuatorSetPoints, 0, sizeof(FPGA_ACTUATORS_T) ); - fpgaActuatorSetPoints.AlarmControl = (U08)MAX_ALARM_VOLUME_LEVEL << 2; // start alarm audio volume at maximum + fpgaActuatorSetPoints.AlarmControl = (U08)MIN_ALARM_VOLUME_ATTENUATION << 2; // start alarm audio volume at maximum // initialize fpga comm buffers memset( &fpgaWriteCmdBuffer, 0, FPGA_WRITE_CMD_BUFFER_LEN ); @@ -1053,14 +1053,23 @@ * The setAlarmAudioState function sets the fpga audio control to the given * state and volume. * @details Inputs: none - * @details Outputs: alarm audio state and amplification gain set - * @param state the state of alarm audio to command - * @param volumeLevel the amount of amplification gain to command + * @details Outputs: alarm audio state and attenuation set + * @param state the state of alarm audio to command: + * 0 - No alarm tone + * 1 - Low priority alarm tone (c e) + * 2 - Medium priority alarm tone (c f# c) + * 3 - High priority alarm tone (c f# c - c f#) + * @param volumeLevel the level of attenuation to command (0..4) + * 4 - 3 dB gain + * 3 - 6 dB gain + * 2 - 9 dB gain + * 1 - 12 dB gain + * 0 - 15 dB gain * @return none *************************************************************************/ void setAlarmAudioState( ALARM_PRIORITY_T state, U32 volumeLevel ) { - if ( state < NUM_OF_ALARM_PRIORITIES && volumeLevel <= MAX_ALARM_VOLUME_LEVEL ) + if ( state < NUM_OF_ALARM_PRIORITIES && volumeLevel <= MAX_ALARM_VOLUME_ATTENUATION ) { U08 audioCmd = (U08)state; @@ -1072,7 +1081,7 @@ U08 audioCmd = (U08)ALARM_PRIORITY_HIGH; // set alarm audio to high priority, max volume for safety since s/w seems to be having trouble setting audio correctly - audioCmd |= ( (U08)MAX_ALARM_VOLUME_LEVEL << 2 ); + audioCmd |= ( (U08)MIN_ALARM_VOLUME_ATTENUATION << 2 ); fpgaActuatorSetPoints.AlarmControl = audioCmd; // s/w fault to indicate issue w/ s/w SET_ALARM_WITH_2_U32_DATA( ALARM_ID_HD_SOFTWARE_FAULT, SW_FAULT_ID_FPGA_INVALID_ALARM_AUDIO_PARAM, volumeLevel )