|
|
|
@ -18,8 +18,6 @@
|
|
|
|
|
#include "BootErrors.h"
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
|
|
using namespace Pinetime::System;
|
|
|
|
|
|
|
|
|
@ -408,16 +406,6 @@ void SystemTask::Work() {
|
|
|
|
|
case Messages::BatteryPercentageUpdated:
|
|
|
|
|
nimbleController.NotifyBatteryLevel(batteryController.PercentRemaining());
|
|
|
|
|
break;
|
|
|
|
|
case Messages::LowBattery: {
|
|
|
|
|
Pinetime::Controllers::NotificationManager::Notification notif;
|
|
|
|
|
constexpr char message[] = "Low Battery\0Charge your watch to prevent data loss.\0";
|
|
|
|
|
constexpr size_t messageSize = std::min(sizeof(message), Pinetime::Controllers::NotificationManager::MaximumMessageSize());
|
|
|
|
|
std::memcpy(notif.message.data(), message, messageSize);
|
|
|
|
|
notif.size = messageSize;
|
|
|
|
|
notif.category = Pinetime::Controllers::NotificationManager::Categories::SimpleAlert;
|
|
|
|
|
notificationManager.Push(std::move(notif));
|
|
|
|
|
PushMessage(Messages::OnNewNotification);
|
|
|
|
|
} break;
|
|
|
|
|
case Messages::OnPairing:
|
|
|
|
|
if (state == SystemTaskState::Sleeping) {
|
|
|
|
|
GoToRunning();
|
|
|
|
|