fixing ui stuff
This commit is contained in:
@@ -131,6 +131,24 @@ void BoomState::incrementTodayEvents() {
|
||||
preferences_.putInt("today", value);
|
||||
}
|
||||
|
||||
void BoomState::discardTodayEvents(int count) {
|
||||
if (count <= 0) return;
|
||||
rollDayIfNeeded();
|
||||
int value;
|
||||
xSemaphoreTake(mutex_, portMAX_DELAY);
|
||||
state_.todayEvents = max(0, state_.todayEvents - count);
|
||||
value = state_.todayEvents;
|
||||
xSemaphoreGive(mutex_);
|
||||
preferences_.putInt("today", value);
|
||||
}
|
||||
|
||||
void BoomState::resetTodayEvents() {
|
||||
xSemaphoreTake(mutex_, portMAX_DELAY);
|
||||
state_.todayEvents = 0;
|
||||
xSemaphoreGive(mutex_);
|
||||
preferences_.putInt("today", 0);
|
||||
}
|
||||
|
||||
void BoomState::requestSync(const String& filename) {
|
||||
xSemaphoreTake(mutex_, portMAX_DELAY);
|
||||
syncRequested_ = true;
|
||||
|
||||
Reference in New Issue
Block a user