From 16bc6d50cc4c982ac4eb2406256e032ea5e1bce7 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Tue, 3 Jan 2023 13:21:28 +0100 Subject: [PATCH] code cleanup --- src/abfall.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/abfall.cpp b/src/abfall.cpp index d0c97ef..b343eae 100644 --- a/src/abfall.cpp +++ b/src/abfall.cpp @@ -58,8 +58,6 @@ int main() { return 1; } - char datetime_buf[256]; - char *datetime_str = &datetime_buf[0]; datetime_t dt; auto dates = parseCsv(csv); @@ -71,9 +69,6 @@ int main() { rtc_get_datetime(&dt); - // datetime_to_str(datetime_str, sizeof(datetime_buf), &dt); - // printf("DateTime: %s\n", datetime_str); - chrono::year_month_day tomorrowYMD(chrono::year{dt.year}, chrono::month{static_cast(dt.month)}, chrono::day{static_cast(dt.day + 1)}); @@ -81,8 +76,7 @@ int main() { return date.date == tomorrowYMD; }); - if (it != dates.end()) { - printf("\n+++ FOUND +++\n"); + if (it != dates.end() && dt.hour >= 18) { auto wasteDate = *it; size_t count{0}; auto currentTime = time_us_64(); @@ -108,13 +102,10 @@ int main() { } auto timeLeft = timestamp - currentTime; - // std::cout << "Info: " << timeLeft << std::endl; if (timeLeft > 3000000) { sleep_us(3000000); } else { - // std::cout << "Switching LED off." << std::endl; - // led.switchColor(Color::OFF); sleep_us(timeLeft); }