write button mode change to log

This commit is contained in:
interfisch 2021-05-29 11:59:43 +02:00
parent d2c3ac00cc
commit 7797090f30
1 changed files with 12 additions and 2 deletions

View File

@ -418,9 +418,19 @@ void readADC() {
if (digitalRead(PIN_MODE_SWITCH)) { //pushed in, also high if cable got disconnected
speedmode=SPEEDMODE_SLOW;
if (speedmode!=SPEEDMODE_SLOW) {
speedmode=SPEEDMODE_SLOW;
if (loopmillis>WRITE_HEADER_TIME) {
writeLogComment(Serial1,loopmillis, "Mode switched to SPEEDMODE_SLOW");
}
}
}else{ //button not pushed in
speedmode=SPEEDMODE_NORMAL;
if (speedmode!=SPEEDMODE_NORMAL) {
speedmode=SPEEDMODE_NORMAL;
if (loopmillis>WRITE_HEADER_TIME) {
writeLogComment(Serial1,loopmillis, "Mode switched to SPEEDMODE_NORMAL");
}
}
}