diff options
-rw-r--r-- | src/app/posix-argv-to-ssd1306/Kconfig | 2 | ||||
-rw-r--r-- | src/app/posix-argv-to-ssd1306/main.cc | 13 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/app/posix-argv-to-ssd1306/Kconfig b/src/app/posix-argv-to-ssd1306/Kconfig index a877b2c..5cb949e 100644 --- a/src/app/posix-argv-to-ssd1306/Kconfig +++ b/src/app/posix-argv-to-ssd1306/Kconfig @@ -2,5 +2,5 @@ # # SPDX-License-Identifier: CC0-1.0 -prompt "POSIX Dust Monitor" +prompt "POSIX argv to SSD1306" depends on arch_posix && driver_ssd1306 && !loop && !wakeup diff --git a/src/app/posix-argv-to-ssd1306/main.cc b/src/app/posix-argv-to-ssd1306/main.cc index 408cd3f..267b3e1 100644 --- a/src/app/posix-argv-to-ssd1306/main.cc +++ b/src/app/posix-argv-to-ssd1306/main.cc @@ -13,6 +13,7 @@ #include "driver/ssd1306.h" #include "object/framebuffer.h" #include "lib/pixelfont/pixeloperator_mirrored.h" +#include "lib/pixelfont/terminus16.h" #include <stdlib.h> int main(int argc, char **argv) @@ -23,14 +24,20 @@ int main(int argc, char **argv) fb.clear(); fb.setFont(pixeloperator_mirrored); - if (argc > 2) { - fb.drawBattery(114, 0, atoi(argv[1]), atoi(argv[2])); - for (unsigned char i = 3; i < argc; i++) { + if (argc > 1) { + for (unsigned char i = 1; i < argc && i < 13; i++) { + if (i == 9) { + fb.setFont(terminus16, 2); + fb.setPos(0, 0); + } fb << argv[i] << endl; } } else { ssd1306.init(); } + if (argc > 14) { + fb.drawBattery(114, 0, atoi(argv[13]), atoi(argv[14])); + } ssd1306.showImage(fb.data, fb.width * fb.height / 8); return 0; |