diff --git a/Universal_Serial_Adapter/Project.h b/Universal_Serial_Adapter/Project.h index 5212e80..d4fb82f 100644 --- a/Universal_Serial_Adapter/Project.h +++ b/Universal_Serial_Adapter/Project.h @@ -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; }; diff --git a/Universal_Serial_Adapter/Universal_Serial_Adapter.ino b/Universal_Serial_Adapter/Universal_Serial_Adapter.ino index d307326..4ab9641 100644 --- a/Universal_Serial_Adapter/Universal_Serial_Adapter.ino +++ b/Universal_Serial_Adapter/Universal_Serial_Adapter.ino @@ -90,9 +90,14 @@ void setDefaults() { } void setLineSpeed(linespeed aLineSpeed) { - currentLineSpeed = 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) {