From 17507b5ae26cafec72b2a013a94f4e5331b6db9c Mon Sep 17 00:00:00 2001 From: Juan Rial Date: Tue, 27 Aug 2019 21:38:20 +0200 Subject: [PATCH 1/3] Deleted developer-specific VS Code settings --- .vscode/settings.json | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 701e1dd..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "terminal.integrated.env.windows": { - "PATH": "C:\\Users\\10049636\\.platformio\\penv\\Scripts;C:\\Users\\10049636\\.platformio\\penv;C:\\ProgramData\\DockerDesktop\\version-bin;C:\\Program Files\\Docker\\Docker\\Resources\\bin;C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\CLI2\\wbin;c:\\program files (x86)\\common files\\oracle\\java\\javapath;c:\\program files (x86)\\iis express\\php\\v7.0;c:\\python27\\;c:\\python27\\scripts;c:\\programdata\\oracle\\java\\javapath;c:\\perl64\\site\\bin;c:\\perl64\\bin;c:\\windows\\system32;c:\\windows;c:\\windows\\system32\\wbem;c:\\windows\\system32\\windowspowershell\\v1.0\\;c:\\program files\\perforce;c:\\program files\\openvpn\\bin;c:\\program files\\dotnet\\;c:\\users\\1;c:\\program files\\sourcegear\\common\\diffmerge\\;c:\\program files (x86)\\windows kits\\10\\windows performance toolkit\\;c:\\programdata\\composersetup\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\system32\\wbem;C:\\WINDOWS\\system32\\windowspowershell\\v1.0\\;c:\\program files\\putty\\;c:\\program files\\gource\\cmd;c:\\programdata\\chocolatey\\bin;c:\\program files\\git\\cmd;c:\\program files\\git\\mingw64\\bin;c:\\program files\\git\\usr\\bin;k:\\appl\\nttools\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\nodejs\\;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git\\mingw64\\bin;C:\\Program Files\\Git\\usr\\bin;C:\\Program Files\\Git LFS;C:\\tools\\;C:\\Program Files\\Microsoft\\Web Platform Installer\\;C:\\Program Files\\Microsoft Service Fabric\\bin\\Fabric\\Fabric.Code;C:\\Program Files\\Microsoft SDKs\\Service Fabric\\Tools\\ServiceFabricLocalClusterManager;C:\\Program Files (x86)\\Yarn\\bin\\;C:\\Program Files (x86)\\GitExtensions\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\opscode\\chef-workstation\\bin\\;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\;C:\\Program Files\\PowerShell\\6\\;C:\\Users\\10049636\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Users\\10049636\\AppData\\Roaming\\Composer\\vendor\\bin;C:\\Users\\10049636\\AppData\\Local\\GitHubDesktop\\bin;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\Users\\10049636\\AppData\\Roaming\\npm;C:\\Users\\10049636\\.dotnet\\tools;C:\\Users\\10049636\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\10049636\\AppData\\Local\\Programs\\Fiddler;C:\\Users\\10049636\\.azure-kubectl;C:\\Users\\10049636\\AppData\\Local\\Yarn\\bin;C:\\Program Files (x86)\\Rico Suter\\NSwagStudio\\;C:\\Users\\10049636\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\ProgramData\\DockerDesktop\\version-bin;C:\\Program Files\\Docker\\Docker\\Resources\\bin;C:\\Program Files (x86)\\Microsoft SDKs\\Azure\\CLI2\\wbin;c:\\program files (x86)\\common files\\oracle\\java\\javapath;c:\\program files (x86)\\iis express\\php\\v7.0;c:\\python27\\;c:\\python27\\scripts;c:\\programdata\\oracle\\java\\javapath;c:\\perl64\\site\\bin;c:\\perl64\\bin;c:\\windows\\system32;c:\\windows;c:\\windows\\system32\\wbem;c:\\windows\\system32\\windowspowershell\\v1.0\\;c:\\program files\\perforce;c:\\program files\\openvpn\\bin;c:\\program files\\dotnet\\;c:\\users\\1;c:\\program files\\sourcegear\\common\\diffmerge\\;c:\\program files (x86)\\windows kits\\10\\windows performance toolkit\\;c:\\programdata\\composersetup\\bin;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\system32\\wbem;C:\\WINDOWS\\system32\\windowspowershell\\v1.0\\;c:\\program files\\putty\\;c:\\program files\\gource\\cmd;c:\\programdata\\chocolatey\\bin;c:\\program files\\git\\cmd;c:\\program files\\git\\mingw64\\bin;c:\\program files\\git\\usr\\bin;k:\\appl\\nttools\\;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\Program Files\\nodejs\\;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git\\mingw64\\bin;C:\\Program Files\\Git\\usr\\bin;C:\\Program Files\\Git LFS;C:\\tools\\;C:\\Program Files\\Microsoft\\Web Platform Installer\\;C:\\Program Files\\Microsoft Service Fabric\\bin\\Fabric\\Fabric.Code;C:\\Program Files\\Microsoft SDKs\\Service Fabric\\Tools\\ServiceFabricLocalClusterManager;C:\\Program Files (x86)\\Yarn\\bin\\;C:\\Program Files (x86)\\GitExtensions\\;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\opscode\\chef-workstation\\bin\\;C:\\Program Files\\Microsoft SQL Server\\Client SDK\\ODBC\\170\\Tools\\Binn\\;C:\\Program Files\\PowerShell\\6\\;C:\\Users\\10049636\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Program Files\\Microsoft VS Code\\bin;C:\\Users\\10049636\\AppData\\Roaming\\Composer\\vendor\\bin;C:\\Users\\10049636\\AppData\\Local\\GitHubDesktop\\bin;C:\\Program Files\\Intel\\WiFi\\bin\\;C:\\Program Files\\Common Files\\Intel\\WirelessCommon\\;C:\\Users\\10049636\\AppData\\Roaming\\npm;C:\\Users\\10049636\\.dotnet\\tools;C:\\Users\\10049636\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\10049636\\AppData\\Local\\Programs\\Fiddler;C:\\Users\\10049636\\.azure-kubectl;C:\\Users\\10049636\\AppData\\Local\\Yarn\\bin;C:\\Program Files (x86)\\Rico Suter\\NSwagStudio\\;C:\\Users\\10049636\\AppData\\Local\\Programs\\Microsoft VS Code\\bin", - "PLATFORMIO_CALLER": "vscode" - } -} \ No newline at end of file From 4fabf9876c3c0cd06e894910f16e4823b7aaaaa9 Mon Sep 17 00:00:00 2001 From: Juan Rial Date: Tue, 27 Aug 2019 21:38:44 +0200 Subject: [PATCH 2/3] Add C++, fix Platformio's retarded VS Code defaults --- .gitignore | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 55429ef..92f06eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,40 @@ -# Created by https://www.gitignore.io/api/platformio,visualstudiocode -# Edit at https://www.gitignore.io/?templates=platformio,visualstudiocode +# Created by https://www.gitignore.io/api/platformio,visualstudiocode,c++ +# Edit at https://www.gitignore.io/?templates=platformio,visualstudiocode,c++ + +### C++ ### +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app ### PlatformIO ### .pioenvs @@ -10,7 +44,7 @@ ### VisualStudioCode ### .vscode/* -!.vscode/settings.json +#!.vscode/settings.json !.vscode/tasks.json !.vscode/launch.json !.vscode/extensions.json @@ -19,4 +53,5 @@ # Ignore all local history of files .history -# End of https://www.gitignore.io/api/platformio,visualstudiocode +# End of https://www.gitignore.io/api/platformio,visualstudiocode,c++ + From d18b0f1e2272344bdc972d278f965a48dcab149b Mon Sep 17 00:00:00 2001 From: Juan Rial Date: Tue, 27 Aug 2019 22:39:47 +0200 Subject: [PATCH 3/3] Fix readability: scroll on both ends With this patch, the string is always padded on both the left and right hand side with LED_MATRIX_WIDTH spaces, so the text scrolls in from the right, and out of view on the left again. --- src/LedMatrixHandler.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/LedMatrixHandler.cpp b/src/LedMatrixHandler.cpp index 76e82ec..16236b3 100644 --- a/src/LedMatrixHandler.cpp +++ b/src/LedMatrixHandler.cpp @@ -17,7 +17,6 @@ const uint8_t *iaActiveFont = ActiveFontInfo->Bitmap; const FONT_CHAR_INFO *ActiveFontCharInfo = ActiveFontInfo->Descriptors; String strCurMsg = ""; -bool bMsgScrolling = false; unsigned long ulLastScrollStep = 0; unsigned long ulScrollStepInterval = 800; uint iScrollCurrentFirstChar = 0; @@ -40,7 +39,7 @@ void MatrixDisplayLoop() void HandleScrollingText() { - if (!bMsgScrolling || millis() - ulLastScrollStep < ulScrollStepInterval) + if (millis() - ulLastScrollStep < ulScrollStepInterval) { return; } @@ -161,13 +160,9 @@ void UpdateMessage(String strMsg) { matrix.clear(); ESP_LOGD(TAG, "Updating display: %s", strMsg.c_str()); + strCurMsg = PadMessageString(strMsg); String strTempMsg = TruncateStringForDisplay(strMsg); - strCurMsg = strMsg; DrawASCII(strTempMsg); - if (strCurMsg.length() != strTempMsg.length()) - { - bMsgScrolling = true; - } } String TruncateStringForDisplay(String strInput) @@ -201,6 +196,21 @@ String TruncateStringForDisplay(String strInput) return strOutput; } +String PadMessageString(String input) +{ + String strOutput = ""; + for (int i = 0; i < LED_MATRIX_WIDTH - iDigitPos; i++) + { + strOutput += " "; + } + strOutput += input; + for (int i = 0; i < LED_MATRIX_WIDTH - iDigitPos; i++) + { + strOutput += " "; + } + return strOutput; +} + void SetScrollInterval(unsigned long interval) { ulScrollStepInterval = interval;