Skip to content

Commit 052771b

Browse files
authored
Merge branch 'main' into firmware_validation_redesign
2 parents b9e969d + 9afc23c commit 052771b

35 files changed

+579
-40
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@
1414
*.bin binary
1515
*.jpg binary
1616
*.jpeg binary
17+
18+
# Declare (Unix-style) files that will always have LF line endings on checkout.
19+
*.sh text eol=lf

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,8 @@ src/arm-none-eabi
5050

5151
# clangd
5252
.cache/
53+
54+
# npm files
55+
node_modules
56+
package.json
57+
package-lock.json

src/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ list(APPEND SOURCE_FILES
427427
displayapp/screens/WatchFaceTerminal.cpp
428428
displayapp/screens/WatchFacePineTimeStyle.cpp
429429
displayapp/screens/WatchFaceCasioStyleG7710.cpp
430+
displayapp/screens/WatchFacePrideFlag.cpp
430431

431432
##
432433

src/FreeRTOSConfig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
#define configUSE_QUEUE_SETS 0
7474
#define configUSE_TIME_SLICING 0
7575
#define configUSE_NEWLIB_REENTRANT 0
76-
#define configENABLE_BACKWARD_COMPATIBILITY 1
76+
#define configENABLE_BACKWARD_COMPATIBILITY 0
7777
#define configUSE_TASK_NOTIFICATIONS 0
7878

7979
/* Hook function related definitions. */

src/components/ble/MusicService.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ namespace Pinetime {
7171

7272
uint16_t eventHandle {};
7373

74-
std::string artistName {"Waiting for"};
75-
std::string albumName {};
76-
std::string trackName {"track information.."};
74+
std::string trackName;
75+
std::string albumName;
76+
std::string artistName {"Not Playing"};
7777

7878
bool playing {false};
7979

src/components/datetime/DateTimeController.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ using namespace Pinetime::Controllers;
99
namespace {
1010
constexpr const char* const DaysStringShort[] = {"--", "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};
1111
constexpr const char* const DaysStringShortLow[] = {"--", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
12+
constexpr const char* const DaysString[] = {"--", "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"};
13+
constexpr const char* const DaysStringLow[] = {"--", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
1214
constexpr const char* const MonthsString[] = {"--", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"};
1315
constexpr const char* const MonthsStringLow[] =
1416
{"--", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
@@ -144,6 +146,10 @@ const char* DateTime::DayOfWeekShortToString() const {
144146
return DaysStringShort[static_cast<uint8_t>(DayOfWeek())];
145147
}
146148

149+
const char* DateTime::DayOfWeekToString() const {
150+
return DaysString[static_cast<uint8_t>(DayOfWeek())];
151+
}
152+
147153
const char* DateTime::MonthShortToStringLow(Months month) {
148154
return MonthsStringLow[static_cast<uint8_t>(month)];
149155
}
@@ -152,6 +158,10 @@ const char* DateTime::DayOfWeekShortToStringLow(Days day) {
152158
return DaysStringShortLow[static_cast<uint8_t>(day)];
153159
}
154160

161+
const char* DateTime::DayOfWeekToStringLow(Days day) {
162+
return DaysStringLow[static_cast<uint8_t>(day)];
163+
}
164+
155165
void DateTime::Register(Pinetime::System::SystemTask* systemTask) {
156166
this->systemTask = systemTask;
157167
}

src/components/datetime/DateTimeController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ namespace Pinetime {
121121

122122
const char* MonthShortToString() const;
123123
const char* DayOfWeekShortToString() const;
124+
const char* DayOfWeekToString() const;
124125
static const char* MonthShortToStringLow(Months month);
125126
static const char* DayOfWeekShortToStringLow(Days day);
127+
static const char* DayOfWeekToStringLow(Days day);
126128

127129
std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> CurrentDateTime();
128130

src/components/settings/Settings.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ namespace Pinetime {
3636
};
3737
enum class PTSGaugeStyle : uint8_t { Full, Half, Numeric };
3838
enum class PTSWeather : uint8_t { On, Off };
39+
enum class PrideFlag : uint8_t { Gay, Trans, Bi, Lesbian };
3940

4041
struct PineTimeStyle {
4142
Colors ColorTime = Colors::Teal;
@@ -154,6 +155,16 @@ namespace Pinetime {
154155
return settings.PTS.weatherEnable;
155156
};
156157

158+
void SetPrideFlag(PrideFlag prideFlag) {
159+
if (prideFlag != settings.prideFlag)
160+
settingsChanged = true;
161+
settings.prideFlag = prideFlag;
162+
};
163+
164+
PrideFlag GetPrideFlag() const {
165+
return settings.prideFlag;
166+
};
167+
157168
void SetAppMenu(uint8_t menu) {
158169
appMenu = menu;
159170
};
@@ -301,7 +312,7 @@ namespace Pinetime {
301312
private:
302313
Pinetime::Controllers::FS& fs;
303314

304-
static constexpr uint32_t settingsVersion = 0x0008;
315+
static constexpr uint32_t settingsVersion = 0x0009;
305316

306317
struct SettingsData {
307318
uint32_t version = settingsVersion;
@@ -319,6 +330,8 @@ namespace Pinetime {
319330

320331
PineTimeStyle PTS;
321332

333+
PrideFlag prideFlag = PrideFlag::Gay;
334+
322335
WatchFaceInfineat watchFaceInfineat;
323336

324337
std::bitset<5> wakeUpMode {0};

src/displayapp/DisplayApp.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,6 @@ void DisplayApp::Start(System::BootErrors error) {
129129

130130
bootError = error;
131131

132-
lvgl.Init();
133-
motorController.Init();
134-
135-
if (error == System::BootErrors::TouchController) {
136-
LoadNewScreen(Apps::Error, DisplayApp::FullRefreshDirections::None);
137-
} else {
138-
LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None);
139-
}
140-
141132
if (pdPASS != xTaskCreate(DisplayApp::Process, "displayapp", 800, this, 0, &taskHandle)) {
142133
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
143134
}
@@ -146,17 +137,25 @@ void DisplayApp::Start(System::BootErrors error) {
146137
void DisplayApp::Process(void* instance) {
147138
auto* app = static_cast<DisplayApp*>(instance);
148139
NRF_LOG_INFO("displayapp task started!");
149-
app->InitHw();
140+
app->Init();
141+
142+
if (app->bootError == System::BootErrors::TouchController) {
143+
app->LoadNewScreen(Apps::Error, DisplayApp::FullRefreshDirections::None);
144+
} else {
145+
app->LoadNewScreen(Apps::Clock, DisplayApp::FullRefreshDirections::None);
146+
}
150147

151148
while (true) {
152149
app->Refresh();
153150
}
154151
}
155152

156-
void DisplayApp::InitHw() {
153+
void DisplayApp::Init() {
154+
lcd.Init();
155+
motorController.Init();
157156
brightnessController.Init();
158157
ApplyBrightness();
159-
lcd.Init();
158+
lvgl.Init();
160159
}
161160

162161
TickType_t DisplayApp::CalculateSleepTime() {
@@ -518,8 +517,8 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
518517
switch (app) {
519518
case Apps::Launcher: {
520519
std::array<Screens::Tile::Applications, UserAppTypes::Count> apps;
521-
std::ranges::transform(userApps, apps.begin(), [](const auto& userApp) {
522-
return Screens::Tile::Applications {userApp.icon, userApp.app, true};
520+
std::ranges::transform(userApps, apps.begin(), [this](const auto& userApp) {
521+
return Screens::Tile::Applications {userApp.icon, userApp.app, userApp.isAvailable(controllers.filesystem)};
523522
});
524523
currentScreen = std::make_unique<Screens::ApplicationList>(this,
525524
settingsController,

src/displayapp/DisplayApp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ namespace Pinetime {
121121

122122
TouchEvents GetGesture();
123123
static void Process(void* instance);
124-
void InitHw();
124+
void Init();
125125
void Refresh();
126126
void LoadNewScreen(Apps app, DisplayApp::FullRefreshDirections direction);
127127
void LoadScreen(Apps app, DisplayApp::FullRefreshDirections direction);

0 commit comments

Comments
 (0)