Add support for pages 10+ using the legacy `P` command. Fixes #228

This commit is contained in:
Josh Stewart 2019-05-16 16:08:36 +10:00
parent 686802b673
commit 887817f89f
1 changed files with 13 additions and 1 deletions

View File

@ -181,7 +181,19 @@ void command()
{
currentPage = Serial.read();
//This converts the ascii number char into binary. Note that this will break everyything if there are ever more than 48 pages (48 = asci code for '0')
if (currentPage >= '0') { currentPage -= '0'; }
if ((currentPage >= '0') && (currentPage <= '9')) // 0 - 9
{
currentPage -= 48;
}
else if ((currentPage >= 'a') && (currentPage <= 'f')) // 10 - 15
{
currentPage -= 87;
}
else if ((currentPage >= 'A') && (currentPage <= 'F'))
{
currentPage -= 55;
}
// Detecting if the current page is a table/map
if ( (currentPage == veMapPage) || (currentPage == ignMapPage) || (currentPage == afrMapPage) ) { isMap = true; }
else { isMap = false; }