Add logging, mutex + Fixes - works well with MIN-On/Off time now

This commit is contained in:
jonny_l480
2024-09-06 15:27:09 +02:00
parent 89cab00acc
commit c48b162d1f
4 changed files with 86 additions and 40 deletions

View File

@@ -228,7 +228,7 @@ void buttonCommands::startHandleLoop()
// ignore first clicks
if (rotateCount++ < IGNORE_ROTATE_COUNT)
{
buzzer->beep(1, 60, 0);
buzzer->beep(1, 20, 0);
break;
}
timestampLastRotate = esp_log_timestamp();
@@ -253,15 +253,15 @@ void buttonCommands::startHandleLoop()
{
// increment target position each click
if (event.diff > 0)
legRest->setTargetPercent(legRest->getTargetPercent() - 5);
legRest->setTargetPercent(legRest->getTargetPercent() - 10);
else
legRest->setTargetPercent(legRest->getTargetPercent() + 5);
legRest->setTargetPercent(legRest->getTargetPercent() + 10);
// show temporary notification on display
char buf[8];
snprintf(buf, 8, "%.0f%%", legRest->getTargetPercent());
display_showNotification(2500, "moving Rest:", "LEG", buf);
}
buzzer->beep(1, 90, 0);
buzzer->beep(1, 40, 0);
break;
case RE_ET_BTN_LONG_PRESSED:
case RE_ET_BTN_CLICKED:

View File

@@ -607,7 +607,7 @@ void display_showNotification(uint32_t showDurationMs, const char *line1, const
displayTextLineCentered(&dev, 1, true, false, "%s", line2Large);
displayTextLineCentered(&dev, 4, true, false, "%s", line3Large);
displayTextLine(&dev, 7, false, false, " ");
ESP_LOGW(TAG, "start showing notification '%s' '%s' for %d ms", line1, line2Large, showDurationMs);
ESP_LOGI(TAG, "start showing notification '%s' '%s' for %d ms", line1, line2Large, showDurationMs);
}