Small speed optimizations

This commit is contained in:
fvanroie 2020-02-03 01:02:29 +01:00
parent d5f6140736
commit 30299e879a
3 changed files with 12 additions and 12 deletions

View File

@ -204,7 +204,7 @@ static const uint8_t * lv_font_get_bitmap_fmt_zifont(const lv_font_t * font, uin
/* Bitmap still in buffer */
if(charInBuffer == unicode_letter && charBitmap_p) {
// Serial.printf("CacheLetter %c\n", (char)(uint8_t)unicode_letter);
Serial.printf("#%c", (char)(uint8_t)unicode_letter);
// Serial.printf("#%c", (char)(uint8_t)unicode_letter);
return charBitmap_p;
}
@ -230,7 +230,7 @@ static const uint8_t * lv_font_get_bitmap_fmt_zifont(const lv_font_t * font, uin
lv_zifont_char_t * charInfo;
/* Check Last Glyph in chache is valid and Matches currentGlyphID */
if(fdsc->last_glyph_id == glyphID && fdsc->last_glyph_dsc && fdsc->last_glyph_dsc->width > 0) {
Serial.print("@");
// Serial.print("@");
charInfo = fdsc->last_glyph_dsc;
} else {
Serial.print("-");

View File

@ -14,7 +14,7 @@ void dispatchLoop()
{}
// objectattribute=value
void dispatchAttribute(String & strTopic, String & strPayload)
void IRAM_ATTR dispatchAttribute(String & strTopic, String & strPayload)
{
if(strTopic.startsWith("p[")) {
String strPageId = strTopic.substring(2, strTopic.indexOf("]"));
@ -36,7 +36,7 @@ void dispatchAttribute(String & strTopic, String & strPayload)
}
}
void dispatchPage(String & strPageid)
void IRAM_ATTR dispatchPage(String & strPageid)
{
debugPrintln("PAGE:" + strPageid);
@ -48,7 +48,7 @@ void dispatchPage(String & strPageid)
}
}
void dispatchCommand(String cmnd)
void IRAM_ATTR dispatchCommand(String cmnd)
{
debugPrintln("CMND: " + cmnd);
@ -81,7 +81,7 @@ void dispatchCommand(String cmnd)
}
}
void dispatchJson(String & strPayload)
void IRAM_ATTR dispatchJson(String & strPayload)
{ // Parse an incoming JSON array into individual commands
if(strPayload.endsWith(",]")) {
// Trailing null array elements are an artifact of older Home Assistant automations
@ -110,7 +110,7 @@ void dispatchJson(String & strPayload)
}
}
void dispatchIdle(const __FlashStringHelper * state)
void IRAM_ATTR dispatchIdle(const __FlashStringHelper * state)
{
mqttSendState(String(F("idle")).c_str(), String(state).c_str());
}

View File

@ -79,7 +79,7 @@ PubSubClient mqttClient(wifiClient);
////////////////////////////////////////////////////////////////////////////////////////////////////
// Send changed values OUT
void mqttSendState(const char * subtopic, const char * payload)
void IRAM_ATTR mqttSendState(const char * subtopic, const char * payload)
{
// page = 0
// p[0].b[0].attr = abc
@ -101,26 +101,26 @@ void mqttSendState(const char * subtopic, const char * payload)
debugPrintln(String(F("MQTT OUT: ")) + String(topic) + " = " + String(value));
}
void mqttSendNewValue(uint8_t pageid, uint8_t btnid, const char * attribute, String txt)
void IRAM_ATTR mqttSendNewValue(uint8_t pageid, uint8_t btnid, const char * attribute, String txt)
{
char subtopic[32];
sprintf_P(subtopic, PSTR("p[%u].b[%u].%s"), pageid, btnid, attribute);
mqttSendState(subtopic, txt.c_str());
}
void mqttSendNewValue(uint8_t pageid, uint8_t btnid, int32_t val)
void IRAM_ATTR mqttSendNewValue(uint8_t pageid, uint8_t btnid, int32_t val)
{
char value[16];
itoa(val, value, 10);
mqttSendNewValue(pageid, btnid, "val", value);
}
void mqttSendNewValue(uint8_t pageid, uint8_t btnid, String txt)
void IRAM_ATTR mqttSendNewValue(uint8_t pageid, uint8_t btnid, String txt)
{
mqttSendNewValue(pageid, btnid, "txt", txt);
}
void mqttSendNewEvent(uint8_t pageid, uint8_t btnid, int32_t val)
void IRAM_ATTR mqttSendNewEvent(uint8_t pageid, uint8_t btnid, int32_t val)
{
char value[16];
itoa(val, value, 10);