Added ability to change line speeds
This commit is contained in:
parent
c807b2f384
commit
68f5b7b101
|
@ -67,12 +67,13 @@ enum linespeed {
|
|||
thirtyeightFourK,
|
||||
fiftysevenFiveK,
|
||||
oneNineteenTwoK,
|
||||
maxlinespeed,
|
||||
zero=-1
|
||||
};
|
||||
|
||||
// Description / speed scruct to use in lookup table
|
||||
struct linespeedinfo {
|
||||
char description[8];
|
||||
char* description;
|
||||
int linespeed;
|
||||
};
|
||||
|
||||
|
|
|
@ -90,9 +90,14 @@ void setDefaults() {
|
|||
}
|
||||
|
||||
void setLineSpeed(linespeed aLineSpeed) {
|
||||
if (aLineSpeed >= maxlinespeed) {
|
||||
currentLineSpeed = (linespeed)0;
|
||||
}
|
||||
else {
|
||||
currentLineSpeed = aLineSpeed;
|
||||
}
|
||||
bool sel = selectedMode == modelinespeed ? true : false;
|
||||
printLineSpeed(aLineSpeed, sel);
|
||||
printLineSpeed(currentLineSpeed, sel);
|
||||
}
|
||||
|
||||
void setMode(serialmode aMode) {
|
||||
|
@ -103,6 +108,9 @@ void setMode(serialmode aMode) {
|
|||
lcd.setStr(" ", xLoc(previousMode), yLoc(0), TEXT, BACKGROUND);
|
||||
lcd.setStr("*", xLoc(currentMode), yLoc(0), TEXT, BACKGROUND);
|
||||
}
|
||||
else {
|
||||
setLineSpeed((linespeed)(currentLineSpeed + 1));
|
||||
}
|
||||
}
|
||||
|
||||
void setSelection(serialmode aMode) {
|
||||
|
|
Reference in a new issue