You've already forked TEF6686_ESP32
Modulation meter more smooth
This commit is contained in:
@@ -227,6 +227,7 @@ int BWAutoColorSmooth;
|
|||||||
int BWOld;
|
int BWOld;
|
||||||
int bwupdatetimer;
|
int bwupdatetimer;
|
||||||
int DeEmphasis;
|
int DeEmphasis;
|
||||||
|
int DisplayedSegments;
|
||||||
int ForceMono;
|
int ForceMono;
|
||||||
int FrameColor;
|
int FrameColor;
|
||||||
int FreqColor;
|
int FreqColor;
|
||||||
@@ -374,6 +375,8 @@ unsigned long eonticker;
|
|||||||
unsigned long eontickerhold;
|
unsigned long eontickerhold;
|
||||||
unsigned long flashingtimer;
|
unsigned long flashingtimer;
|
||||||
unsigned long lowsignaltimer;
|
unsigned long lowsignaltimer;
|
||||||
|
unsigned long ModulationpreviousMillis;
|
||||||
|
unsigned long ModulationpeakPreviousMillis;
|
||||||
unsigned long peakholdmillis;
|
unsigned long peakholdmillis;
|
||||||
unsigned long pslongticker;
|
unsigned long pslongticker;
|
||||||
unsigned long pslongtickerhold;
|
unsigned long pslongtickerhold;
|
||||||
@@ -1112,7 +1115,7 @@ void loop() {
|
|||||||
WakeToSleep(REVERSE);
|
WakeToSleep(REVERSE);
|
||||||
while (digitalRead(BWBUTTON) == LOW);
|
while (digitalRead(BWBUTTON) == LOW);
|
||||||
} else {
|
} else {
|
||||||
if (!screenmute && !afscreen) BWButtonPress();
|
if (!screenmute && !afscreen) BWButtonPress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3246,24 +3249,38 @@ void ShowModLevel() {
|
|||||||
MStatus = 0;
|
MStatus = 0;
|
||||||
MStatusold = 1;
|
MStatusold = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
segments = map(MStatus, 0, 120, 0, 94);
|
segments = map(MStatus, 0, 120, 0, 94);
|
||||||
|
|
||||||
if (segments > peakholdold) {
|
if (segments < DisplayedSegments && (millis() - ModulationpreviousMillis >= 20)) {
|
||||||
peakholdold = segments;
|
DisplayedSegments = max(DisplayedSegments - 3, segments);
|
||||||
|
ModulationpreviousMillis = millis();
|
||||||
|
} else if (segments > DisplayedSegments) {
|
||||||
|
DisplayedSegments = segments;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DisplayedSegments > peakholdold) {
|
||||||
|
peakholdold = DisplayedSegments;
|
||||||
peakholdmillis = millis();
|
peakholdmillis = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
tft.fillRect(16, 133, 2 * constrain(segments, 0, 54), 6, ModBarInsignificantColor);
|
if (millis() - peakholdmillis >= 1000) {
|
||||||
tft.fillRect(16 + 2 * 54, 133, 2 * (constrain(segments, 54, 94) - 54), 6, ModBarSignificantColor);
|
if (millis() - ModulationpeakPreviousMillis >= 20) {
|
||||||
tft.fillRect(16 + 2 * constrain(segments, 0, 94), 133, 2 * (94 - constrain(segments, 0, 94)), 6, GreyoutColor);
|
peakholdold = max(peakholdold - 3, DisplayedSegments);
|
||||||
|
ModulationpeakPreviousMillis = millis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tft.fillRect(16, 133, 2 * 94, 6, GreyoutColor);
|
||||||
|
tft.fillRect(16, 133, 2 * constrain(DisplayedSegments, 0, 54), 6, ModBarInsignificantColor);
|
||||||
|
tft.fillRect(16 + 2 * 54, 133, 2 * (constrain(DisplayedSegments, 54, 94) - 54), 6, ModBarSignificantColor);
|
||||||
|
tft.fillRect(16 + 2 * constrain(DisplayedSegments, 0, 94), 133, 2 * (94 - constrain(DisplayedSegments, 0, 94)), 6, GreyoutColor);
|
||||||
|
|
||||||
int peakHoldPosition = 16 + 2 * constrain(peakholdold, 0, 94);
|
int peakHoldPosition = 16 + 2 * constrain(peakholdold, 0, 94);
|
||||||
tft.fillRect(peakHoldPosition, 133, 2, 6, (MStatus > 80) ? ModBarSignificantColor : PrimaryColor);
|
tft.fillRect(peakHoldPosition, 133, 2, 6, (MStatus > 80) ? ModBarSignificantColor : PrimaryColor);
|
||||||
|
|
||||||
if (millis() - peakholdmillis >= 1000) {
|
if (millis() - peakholdmillis >= 1000 && peakholdold == DisplayedSegments) {
|
||||||
tft.fillRect(peakHoldPosition, 133, 2, 6, GreyoutColor);
|
tft.fillRect(peakHoldPosition, 133, 2, 6, GreyoutColor);
|
||||||
peakholdold = segments;
|
|
||||||
peakholdmillis = millis();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user