From 2999fbcbcc3957ae6f7f17f590556c554b841b06 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Wed, 1 Apr 2020 03:54:01 +0200 Subject: [PATCH] Fix global flash strings to compile to one instance instead of one per function --- fantemp/flash | 2 +- fantemp/terminal.hpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/fantemp/flash b/fantemp/flash index 9245b49..6edb2e5 160000 --- a/fantemp/flash +++ b/fantemp/flash @@ -1 +1 @@ -Subproject commit 9245b49e4c981098ca966343f396f5064f762fb5 +Subproject commit 6edb2e5a21e0ce58ff2df936caee8b84e240a46b diff --git a/fantemp/terminal.hpp b/fantemp/terminal.hpp index 33208f1..467d947 100644 --- a/fantemp/terminal.hpp +++ b/fantemp/terminal.hpp @@ -10,9 +10,9 @@ #include "controller.hpp" -#define ENDL F("\r\n") -#define HELP_CMD F("help") -#define SHOW_CMD F("show") +GF(ENDL, "\r\n"); +GF(HELP_CMD, "help"); +GF(SHOW_CMD, "show"); template class Terminal { @@ -35,7 +35,7 @@ class Terminal { // Handle Ctrl + C if (inputByte == 0x03) { - m_serial << F("^C"); + m_serial << F("^C") << ENDL; handleInput = true; break; } @@ -105,12 +105,12 @@ class Terminal { char floatBuffer[16]; sprintf(floatBuffer, "%.2f", Controller::m_adcSample); - m_serial << F("Read ADC: ") << floatBuffer << F("\r\n"); + m_serial << F("Read ADC ....: ") << floatBuffer << ENDL; sprintf(floatBuffer, "%.2f", Controller::m_resistance); - m_serial << F("Resistance: ") << floatBuffer << F("\r\n"); + m_serial << F("Resistance ..: ") << floatBuffer << ENDL; sprintf(floatBuffer, "%.2f", Controller::m_temperature); - m_serial << F("Temperature: ") << floatBuffer << F(" C \r\n"); - m_serial << F("Fan speed: ") << Controller::m_fanSpeed << F("%\r\n"); + m_serial << F("Temperature .: ") << floatBuffer << F(" C") << ENDL; + m_serial << F("Fan speed ...: ") << Controller::m_fanSpeed << F("%") << ENDL; } };