Fix global flash strings to compile to one instance instead of one per function

This commit is contained in:
BlackMark 2020-04-01 03:54:01 +02:00
parent 226d1ba6c9
commit 2999fbcbcc
2 changed files with 9 additions and 9 deletions

@ -1 +1 @@
Subproject commit 9245b49e4c981098ca966343f396f5064f762fb5 Subproject commit 6edb2e5a21e0ce58ff2df936caee8b84e240a46b

View File

@ -10,9 +10,9 @@
#include "controller.hpp" #include "controller.hpp"
#define ENDL F("\r\n") GF(ENDL, "\r\n");
#define HELP_CMD F("help") GF(HELP_CMD, "help");
#define SHOW_CMD F("show") GF(SHOW_CMD, "show");
template <class Uart> template <class Uart>
class Terminal { class Terminal {
@ -35,7 +35,7 @@ class Terminal {
// Handle Ctrl + C // Handle Ctrl + C
if (inputByte == 0x03) { if (inputByte == 0x03) {
m_serial << F("^C"); m_serial << F("^C") << ENDL;
handleInput = true; handleInput = true;
break; break;
} }
@ -105,12 +105,12 @@ class Terminal {
char floatBuffer[16]; char floatBuffer[16];
sprintf(floatBuffer, "%.2f", Controller::m_adcSample); 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); 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); sprintf(floatBuffer, "%.2f", Controller::m_temperature);
m_serial << F("Temperature: ") << floatBuffer << F(" C \r\n"); m_serial << F("Temperature .: ") << floatBuffer << F(" C") << ENDL;
m_serial << F("Fan speed: ") << Controller::m_fanSpeed << F("%\r\n"); m_serial << F("Fan speed ...: ") << Controller::m_fanSpeed << F("%") << ENDL;
} }
}; };