Улучшения
- улушчено отображение на OLED - убраны настройки шага частоты и количества повторов - сделан перебор только реализуемых частот - увеличена точность, на 1МГц 1.25%, в остальных до 1% - точное измерение TOTAL TIME
This commit is contained in:
@@ -9,6 +9,7 @@ Display::Display() : oled_(128, 32, &Wire, -1) {}
|
||||
|
||||
bool Display::begin() {
|
||||
Wire.begin(GPIO_SDA, GPIO_SCL);
|
||||
Wire.setClock(400000); // keeps a full 128x32 framebuffer update near 15 ms
|
||||
// An absent optional OLED produces a large burst of ESP-IDF NACK messages.
|
||||
// Probe it once and keep the I2C driver quiet when no display is connected.
|
||||
esp_log_level_set("i2c.master", ESP_LOG_NONE);
|
||||
@@ -81,7 +82,8 @@ void Display::formatTestFrequency(uint32_t hz, char *out, size_t n) {
|
||||
}
|
||||
|
||||
void Display::formatDuration(uint64_t us, char *out, size_t n) {
|
||||
const uint64_t minutes = us / 60000000ULL;
|
||||
if (minutes < 60) snprintf(out, n, "%02llu:%02llu", minutes, (us / 1000000ULL) % 60ULL);
|
||||
const uint64_t totalSeconds = (us + 999999ULL) / 1000000ULL;
|
||||
const uint64_t minutes = totalSeconds / 60ULL;
|
||||
if (minutes < 60) snprintf(out, n, "%02llu:%02llu", minutes, totalSeconds % 60ULL);
|
||||
else snprintf(out, n, "%llu:%02llu", minutes / 60ULL, minutes % 60ULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user