optimisation: remove duplicate code
Sound_MakeCustom should play the sound if critical = true OR the sound is not Silent Change in memory: Flash: -16 bytes SRAM: 0 bytes
This commit is contained in:
parent
c826ae989f
commit
7799853a05
|
|
@ -65,27 +65,12 @@ Sound_SaveMode();
|
|||
//if critical is true then silend and once mode is ignored
|
||||
void Sound_MakeCustom(uint16_t ms,uint16_t tone_,bool critical){
|
||||
backlight_wake();
|
||||
if (!critical){
|
||||
if (eSoundMode != e_SOUND_MODE_SILENT){
|
||||
if(!tone_){
|
||||
WRITE(BEEPER, HIGH);
|
||||
_delay(ms);
|
||||
WRITE(BEEPER, LOW);
|
||||
}
|
||||
else{
|
||||
_tone(BEEPER, tone_);
|
||||
_delay(ms);
|
||||
_noTone(BEEPER);
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(!tone_){
|
||||
if (critical || eSoundMode != e_SOUND_MODE_SILENT) {
|
||||
if(!tone_) {
|
||||
WRITE(BEEPER, HIGH);
|
||||
_delay(ms);
|
||||
WRITE(BEEPER, LOW);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
_tone(BEEPER, tone_);
|
||||
_delay(ms);
|
||||
_noTone(BEEPER);
|
||||
|
|
|
|||
Loading…
Reference in New Issue