DateTimeController : remove unused methods and variables.

This commit is contained in:
Jean-François Milants 2021-10-10 16:08:19 +02:00
parent cf9e149b33
commit 7cbd56896a
2 changed files with 9 additions and 81 deletions

View file

@ -5,6 +5,12 @@
using namespace Pinetime::Controllers;
namespace {
char const* DaysStringShort[] = {"--", "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};
char const* MonthsString[] = {"--", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
char const* MonthsStringLow[] = {"--", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
}
void DateTime::SetCurrentTime(std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> t) {
this->currentDateTime = t;
UpdateTime(previousSystickCounter); // Update internal state without updating the time
@ -80,76 +86,18 @@ void DateTime::UpdateTime(uint32_t systickCounter) {
}
const char* DateTime::MonthShortToString() {
return DateTime::MonthsString[static_cast<uint8_t>(month)];
}
const char* DateTime::MonthShortToStringLow() {
return DateTime::MonthsStringLow[static_cast<uint8_t>(month)];
}
const char* DateTime::MonthsToStringLow() {
return DateTime::MonthsLow[static_cast<uint8_t>(month)];
}
const char* DateTime::DayOfWeekToString() {
return DateTime::DaysString[static_cast<uint8_t>(dayOfWeek)];
return MonthsString[static_cast<uint8_t>(month)];
}
const char* DateTime::DayOfWeekShortToString() {
return DateTime::DaysStringShort[static_cast<uint8_t>(dayOfWeek)];
}
const char* DateTime::DayOfWeekToStringLow() {
return DateTime::DaysStringLow[static_cast<uint8_t>(dayOfWeek)];
}
const char* DateTime::DayOfWeekShortToStringLow() {
return DateTime::DaysStringShortLow[static_cast<uint8_t>(dayOfWeek)];
}
const char* DateTime::MonthShortToString(Months month) {
return DateTime::MonthsString[static_cast<uint8_t>(month)];
return DaysStringShort[static_cast<uint8_t>(dayOfWeek)];
}
const char* DateTime::MonthShortToStringLow(Months month) {
return DateTime::MonthsStringLow[static_cast<uint8_t>(month)];
}
const char* DateTime::MonthsToStringLow(Months month) {
return DateTime::MonthsLow[static_cast<uint8_t>(month)];
}
const char* DateTime::DayOfWeekToString(Days dayOfWeek) {
return DateTime::DaysString[static_cast<uint8_t>(dayOfWeek)];
}
const char* DateTime::DayOfWeekShortToString(Days dayOfWeek) {
return DateTime::DaysStringShort[static_cast<uint8_t>(dayOfWeek)];
}
const char* DateTime::DayOfWeekToStringLow(Days dayOfWeek) {
return DateTime::DaysStringLow[static_cast<uint8_t>(dayOfWeek)];
}
const char* DateTime::DayOfWeekShortToStringLow(Days dayOfWeek) {
return DateTime::DaysStringShortLow[static_cast<uint8_t>(dayOfWeek)];
return MonthsStringLow[static_cast<uint8_t>(month)];
}
void DateTime::Register(Pinetime::System::SystemTask* systemTask) {
this->systemTask = systemTask;
}
char const* DateTime::DaysStringLow[] = {"--", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
char const* DateTime::DaysStringShortLow[] = {"--", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
char const* DateTime::DaysStringShort[] = {"--", "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};
char const* DateTime::DaysString[] = {"--", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"};
char const* DateTime::MonthsString[] = {"--", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
char const* DateTime::MonthsStringLow[] = {"--", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
char const* DateTime::MonthsLow[] = {
"--", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};

View file

@ -59,20 +59,8 @@ namespace Pinetime {
}
const char* MonthShortToString();
const char* MonthShortToStringLow();
const char* MonthsToStringLow();
const char* DayOfWeekToString();
const char* DayOfWeekShortToString();
const char* DayOfWeekToStringLow();
const char* DayOfWeekShortToStringLow();
static const char* MonthShortToString(Months month);
static const char* MonthShortToStringLow(Months month);
static const char* MonthsToStringLow(Months month);
static const char* DayOfWeekToString(Days dayOfWeek);
static const char* DayOfWeekShortToString(Days dayOfWeek);
static const char* DayOfWeekToStringLow(Days dayOfWeek);
static const char* DayOfWeekShortToStringLow(Days dayOfWeek);
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> CurrentDateTime() const {
return currentDateTime;
@ -99,14 +87,6 @@ namespace Pinetime {
bool isMidnightAlreadyNotified = false;
System::SystemTask* systemTask = nullptr;
static char const* DaysString[];
static char const* DaysStringShort[];
static char const* DaysStringLow[];
static char const* DaysStringShortLow[];
static char const* MonthsString[];
static char const* MonthsStringLow[];
static char const* MonthsLow[];
};
}
}