Fix frequency formatting

This commit is contained in:
fvanroie 2020-03-29 03:06:44 +02:00
parent 00bd0707ed
commit 33b62e3583
2 changed files with 6 additions and 7 deletions

View File

@ -10,7 +10,7 @@ ADC_MODE(ADC_VCC); // tftShowConfig measures the voltage on the pin
int8_t getPinName(int8_t pin); int8_t getPinName(int8_t pin);
void tftSetup(TFT_eSPI & tft, JsonObject settings) void tftSetup(TFT_eSPI & tft, const JsonObject & settings)
{ {
tftShowConfig(tft); tftShowConfig(tft);
} }
@ -67,17 +67,16 @@ void tftOffsetInfo(uint8_t pin, uint8_t x_offset, uint8_t y_offset)
} }
} }
void tftPinInfo(String pinfunction, int8_t pin) void tftPinInfo(const __FlashStringHelper * pinfunction, int8_t pin)
{ {
if(pin != -1) { if(pin != -1) {
Log.verbose(F("TFT: %s = D%i (GPIO %i)"), pinfunction.c_str(), getPinName(pin), pin); Log.verbose(F("TFT: %s = D%i (GPIO %i)"), pinfunction, getPinName(pin), pin);
} }
} }
void tftShowConfig(TFT_eSPI & tft) void tftShowConfig(TFT_eSPI & tft)
{ {
setup_t tftSetup; setup_t tftSetup;
// char buffer[128];
tft.getSetup(tftSetup); tft.getSetup(tftSetup);
Log.verbose(F("TFT: TFT_eSPI ver = %s"), tftSetup.version.c_str()); Log.verbose(F("TFT: TFT_eSPI ver = %s"), tftSetup.version.c_str());
@ -164,10 +163,10 @@ void tftShowConfig(TFT_eSPI & tft)
*/ */
if(tftSetup.serial == 1) { if(tftSetup.serial == 1) {
Log.verbose(F("TFT: Display SPI frequency = %2.1f MHz"), tftSetup.tft_spi_freq / 10.0); Log.verbose(F("TFT: Display SPI frequency = %4.1f MHz"), (float)tftSetup.tft_spi_freq / 10.0f);
} }
if(tftSetup.pin_tch_cs != -1) { if(tftSetup.pin_tch_cs != -1) {
Log.verbose(F("TFT: Touch SPI frequency = %2.1f MHz"), tftSetup.tch_spi_freq / 10.0); Log.verbose(F("TFT: Touch SPI frequency = %4.1f MHz"), (float)tftSetup.tch_spi_freq / 10.0f);
} }
} }

View File

@ -4,7 +4,7 @@
#include "TFT_eSPI.h" #include "TFT_eSPI.h"
#include "ArduinoJson.h" #include "ArduinoJson.h"
void tftSetup(TFT_eSPI & screen, JsonObject settings); void tftSetup(TFT_eSPI & screen, const JsonObject & settings);
void tftLoop(void); void tftLoop(void);
void tftStop(void); void tftStop(void);