Enable buttons and the display.

Kind-of-sort-of usable-ish.
This commit is contained in:
2019-06-06 22:30:27 -07:00
parent 1cc2f7adf4
commit 125ddfb687
19 changed files with 937 additions and 196 deletions

View File

@@ -48,12 +48,25 @@ public:
}
}
void add_task(Task &task, NextTime &time) override
void add_task(Task &task, const NextTime &time) override
{
if (m_task_count == MAX_TASKS || time.get_type() == ScheduleType::NEVER) {
return;
}
// If the task is already in the task list, don't add, but update
for (size_t i = 0; i < m_task_count; i++) {
TaskEvent &event = m_tasks[i];
if (event.m_task == &task) {
// Task is already in the list
if (time < event.m_time) {
// Provided time is sooner than the existing time. Update.
event.m_time = time;
}
return;
}
}
m_tasks[m_task_count++] = TaskEvent(task, time);
}
@@ -116,10 +129,10 @@ private:
}
if (!execed && (next_time - time > Time::millis(2))) {
Common::ReturnCode rc = BSP::RtcDriver::set_wakeup_in(next_time - time);
if (rc == Common::ReturnCode::OK) {
BSP::LowPower::stop();
}
// Common::ReturnCode rc = BSP::RtcDriver::set_wakeup_in(next_time - time);
// if (rc == Common::ReturnCode::OK) {
// BSP::LowPower::stop();
// }
}
m_cycle_count++;