1
0
Fork 0

Infineat : Add support for external resources, and read the images and fonts from the ilesystem

This commit is contained in:
Jean-François Milants 2022-09-11 16:22:28 +02:00
parent ada2c09581
commit 4cf73fc169
13 changed files with 92 additions and 1445 deletions

View file

@ -425,7 +425,6 @@ list(APPEND SOURCE_FILES
## Watch faces
displayapp/icons/bg_clock.c
displayapp/icons/logo_pine.c
displayapp/screens/WatchFaceAnalog.cpp
displayapp/screens/WatchFaceDigital.cpp
displayapp/screens/WatchFaceInfineat.cpp

View file

@ -75,7 +75,8 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
Pinetime::Controllers::TimerController& timerController,
Pinetime::Controllers::AlarmController& alarmController,
Pinetime::Controllers::BrightnessController& brightnessController,
Pinetime::Controllers::TouchHandler& touchHandler)
Pinetime::Controllers::TouchHandler& touchHandler,
Pinetime::Controllers::FS& filesystem)
: lcd {lcd},
lvgl {lvgl},
touchPanel {touchPanel},
@ -91,7 +92,8 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
timerController {timerController},
alarmController {alarmController},
brightnessController {brightnessController},
touchHandler {touchHandler} {
touchHandler {touchHandler},
filesystem{filesystem} {
}
void DisplayApp::Start(System::BootErrors error) {
@ -324,7 +326,8 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction)
notificationManager,
settingsController,
heartRateController,
motionController);
motionController,
filesystem);
break;
case Apps::Error:

View file

@ -62,7 +62,8 @@ namespace Pinetime {
Pinetime::Controllers::TimerController& timerController,
Pinetime::Controllers::AlarmController& alarmController,
Pinetime::Controllers::BrightnessController& brightnessController,
Pinetime::Controllers::TouchHandler& touchHandler);
Pinetime::Controllers::TouchHandler& touchHandler,
Pinetime::Controllers::FS& filesystem);
void Start(System::BootErrors error);
void PushMessage(Display::Messages msg);
@ -90,6 +91,7 @@ namespace Pinetime {
Pinetime::Controllers::AlarmController& alarmController;
Pinetime::Controllers::BrightnessController& brightnessController;
Pinetime::Controllers::TouchHandler& touchHandler;
Pinetime::Controllers::FS& filesystem;
Pinetime::Controllers::FirmwareValidator validator;

File diff suppressed because it is too large Load diff

View file

@ -1,59 +0,0 @@
#if defined(LV_LVGL_H_INCLUDE_SIMPLE)
#include "lvgl.h"
#else
#include "lvgl/lvgl.h"
#endif
#ifndef LV_ATTRIBUTE_MEM_ALIGN
#define LV_ATTRIBUTE_MEM_ALIGN
#endif
#ifndef LV_ATTRIBUTE_IMG_LOGO_PINE
#define LV_ATTRIBUTE_IMG_LOGO_PINE
#endif
const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMG_LOGO_PINE uint8_t logo_pine_map[] = {
/*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit BUT the 2 color bytes are swapped*/
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xe4, 0x1a, 0x41, 0xe8, 0x9c, 0x5a, 0xab, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x14, 0x10, 0x82, 0xd5, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xd9, 0x63, 0x2c, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xa2, 0x0e, 0x10, 0x82, 0xcb, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xd0, 0x5a, 0xeb, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x0b, 0x10, 0x82, 0x4b, 0x00, 0x00, 0x01, 0x20, 0xe4, 0x09, 0x10, 0xa2, 0x60, 0x10, 0x82, 0xc9, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xc9, 0x5a, 0xeb, 0x60, 0x5a, 0xab, 0x09, 0x00, 0x00, 0x01, 0x5a, 0xcb, 0x4b, 0x73, 0xae, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x82, 0x5a, 0x10, 0x82, 0xff, 0x10, 0x82, 0xd5, 0x10, 0xa2, 0x62, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x39, 0xc7, 0x17, 0x00, 0x00, 0x00, 0x73, 0x6e, 0x07, 0x5a, 0xcb, 0x62, 0x5a, 0xcb, 0xd5, 0x5a, 0xcb, 0xff, 0x5a, 0xeb, 0x5a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x82, 0xb2, 0x10, 0x82, 0xff, 0x10, 0x82, 0xd7, 0x10, 0x82, 0x65, 0x00, 0x00, 0x07, 0x20, 0xe4, 0x09, 0x39, 0xc7, 0x45, 0x5a, 0xab, 0x09, 0x73, 0x6e, 0x07, 0x5a, 0xcb, 0x65, 0x5a, 0xcb, 0xd7, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xb2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x82, 0x11, 0x10, 0x82, 0xbd, 0x10, 0x82, 0x55, 0x00, 0x00, 0x03, 0x08, 0x61, 0x17, 0x10, 0x82, 0x80, 0x10, 0x82, 0xeb, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xf0, 0x5a, 0xcb, 0x91, 0x5a, 0xeb, 0x1c, 0x00, 0x00, 0x01, 0x5a, 0xcb, 0x44, 0x5a, 0xcb, 0xad, 0x62, 0xec, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x18, 0xa3, 0x30, 0x10, 0x82, 0xa0, 0x10, 0x82, 0xf9, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xf9, 0x5a, 0xcb, 0xa0, 0x5a, 0xab, 0x30, 0x00, 0x00, 0x00, 0x5a, 0xab, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x82, 0x22, 0x10, 0x82, 0xbd, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xbd, 0x5a, 0xeb, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x82, 0x4e, 0x10, 0x82, 0xc4, 0x10, 0x82, 0x55, 0x00, 0x00, 0x04, 0x10, 0x82, 0x2f, 0x10, 0x82, 0x99, 0x10, 0x82, 0xf6, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xf9, 0x5a, 0xcb, 0xaa, 0x5a, 0xab, 0x36, 0xff, 0xff, 0x02, 0x5a, 0xcb, 0x44, 0x5a, 0xcb, 0xb3, 0x5a, 0xcb, 0x4c, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x82, 0x4e, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xde, 0x10, 0x82, 0x74, 0x10, 0x82, 0x12, 0x18, 0xa3, 0x18, 0x10, 0x82, 0x83, 0x10, 0x82, 0xeb, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xeb, 0x5a, 0xcb, 0x83, 0x5a, 0xab, 0x18, 0x5a, 0xab, 0x12, 0x5a, 0xeb, 0x74, 0x5a, 0xcb, 0xde, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0x4e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x82, 0x4e, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xf5, 0x10, 0x82, 0x9b, 0x10, 0x82, 0x2f, 0x20, 0xe4, 0x09, 0x10, 0x82, 0x65, 0x41, 0xe8, 0x98, 0x5a, 0xcb, 0x65, 0x5a, 0xab, 0x09, 0x62, 0xec, 0x2f, 0x5a, 0xcb, 0x9b, 0x5a, 0xcb, 0xf5, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0x4e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x82, 0x4e, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xca, 0x18, 0xc3, 0x2e, 0x00, 0x00, 0x00, 0x31, 0xa6, 0x0a, 0x00, 0x00, 0x00, 0x63, 0x0c, 0x2e, 0x5a, 0xcb, 0xca, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0x4e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x82, 0x4e, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xf9, 0x10, 0x82, 0xaa, 0x10, 0x82, 0x44, 0x00, 0x00, 0x00, 0x10, 0x82, 0x33, 0x10, 0x82, 0xa2, 0x42, 0x08, 0xbd, 0x5a, 0xcb, 0xb3, 0x5a, 0xcb, 0x3b, 0x00, 0x00, 0x00, 0x5a, 0xab, 0x33, 0x5a, 0xcb, 0x99, 0x5a, 0xcb, 0xf6, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0x4e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x82, 0x4e, 0x10, 0x82, 0xff, 0x10, 0x82, 0xe4, 0x10, 0x82, 0x7c, 0x18, 0xc3, 0x16, 0x00, 0x00, 0x02, 0x10, 0xa2, 0x51, 0x10, 0x82, 0xc4, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xc4, 0x5a, 0xcb, 0x51, 0xff, 0xff, 0x02, 0x6b, 0x4d, 0x16, 0x5a, 0xcb, 0x7c, 0x5a, 0xcb, 0xe4, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0x4e, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x18, 0xa3, 0x30, 0x10, 0x82, 0x55, 0x00, 0x00, 0x04, 0x31, 0xa6, 0x0a, 0x10, 0x82, 0x69, 0x10, 0x82, 0xda, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xda, 0x5a, 0xcb, 0x69, 0x6b, 0x4d, 0x0a, 0x84, 0x10, 0x04, 0x5a, 0xcb, 0x55, 0x5a, 0xab, 0x30, 0x00, 0x00, 0x00,
0x18, 0xc3, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x14, 0x10, 0x82, 0xc8, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xc8, 0x5a, 0xcb, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x63, 0x0c, 0x2e,
0x10, 0x82, 0x96, 0x10, 0x82, 0xcd, 0x10, 0x82, 0x66, 0x18, 0xc3, 0x0b, 0x00, 0x00, 0x02, 0x10, 0xa2, 0x4d, 0x10, 0x82, 0xc4, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xcc, 0x5a, 0xcb, 0x5e, 0x84, 0x10, 0x04, 0x73, 0x6e, 0x07, 0x5a, 0xcb, 0x55, 0x5a, 0xcb, 0xc5, 0x5a, 0xcb, 0x95,
0x10, 0x62, 0x27, 0x10, 0x82, 0xfd, 0x10, 0x82, 0xff, 0x10, 0x82, 0xee, 0x10, 0x82, 0x8d, 0x10, 0x82, 0x24, 0x00, 0x00, 0x00, 0x10, 0x82, 0x3b, 0x10, 0x82, 0xae, 0x10, 0x82, 0xfd, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xfd, 0x5a, 0xcb, 0xae, 0x5a, 0xcb, 0x3b, 0x00, 0x00, 0x00, 0x5a, 0xab, 0x24, 0x5a, 0xcb, 0x8d, 0x5a, 0xcb, 0xee, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xfd, 0x5a, 0xab, 0x27,
0x00, 0x00, 0x00, 0x10, 0x82, 0xb3, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xfe, 0x10, 0x82, 0xbb, 0x10, 0x82, 0x55, 0x00, 0x00, 0x04, 0x10, 0x82, 0x22, 0x10, 0x82, 0x91, 0x42, 0x08, 0xb6, 0x5a, 0xcb, 0xa2, 0x5a, 0xcb, 0x29, 0xff, 0xff, 0x02, 0x5a, 0xcb, 0x44, 0x5a, 0xcb, 0xaa, 0x5a, 0xcb, 0xfc, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xb2, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x10, 0x82, 0x42, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xcc, 0x20, 0xe4, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0xcb, 0x1a, 0x5a, 0xcb, 0xcc, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x62, 0xec, 0x42, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x82, 0xd0, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xdd, 0x10, 0x82, 0x6c, 0x18, 0xc3, 0x0b, 0x10, 0xa2, 0x0e, 0x10, 0x82, 0x76, 0x41, 0xe8, 0xa6, 0x5a, 0xcb, 0x76, 0x5a, 0xeb, 0x0e, 0x73, 0xae, 0x0b, 0x5a, 0xcb, 0x6c, 0x5a, 0xcb, 0xdd, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x82, 0x5f, 0x10, 0x82, 0xff, 0x10, 0x82, 0xc8, 0x10, 0x82, 0x55, 0x00, 0x00, 0x03, 0x08, 0x61, 0x17, 0x10, 0x82, 0x86, 0x10, 0x82, 0xef, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xef, 0x5a, 0xcb, 0x86, 0x63, 0x2c, 0x17, 0x5a, 0xab, 0x03, 0x5a, 0xcb, 0x55, 0x5a, 0xcb, 0xc8, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x10, 0x82, 0x3c, 0x00, 0x00, 0x00, 0x10, 0x82, 0x22, 0x10, 0x82, 0x96, 0x10, 0x82, 0xf7, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xf7, 0x5a, 0xcb, 0x96, 0x5a, 0xeb, 0x22, 0x00, 0x00, 0x00, 0x5a, 0xab, 0x3c, 0x73, 0x6e, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xe4, 0x1a, 0x10, 0x82, 0xc4, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xc4, 0x5a, 0xcb, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xa2, 0x40, 0x10, 0x82, 0xb7, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x10, 0x82, 0xff, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xff, 0x5a, 0xcb, 0xb7, 0x5a, 0xeb, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0xc3, 0x2e, 0x10, 0x82, 0xa2, 0x10, 0x82, 0xfb, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0xfd, 0x5a, 0xcb, 0xb3, 0x5a, 0xeb, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x82, 0x5d, 0x42, 0x08, 0xc0, 0x5a, 0xeb, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xa2, 0x52, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xa2, 0x52, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xa2, 0x52, 0x42, 0x08, 0xc0, 0x5a, 0xcb, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
const lv_img_dsc_t logo_pine = {
.header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA,
.header.always_zero = 0,
.header.reserved = 0,
.header.w = 23,
.header.h = 31,
.data_size = 713 * LV_IMG_PX_SIZE_ALPHA_BYTE,
.data = logo_pine_map,
};

View file

@ -23,7 +23,8 @@ Clock::Clock(DisplayApp* app,
Controllers::NotificationManager& notificatioManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,
Controllers::MotionController& motionController)
Controllers::MotionController& motionController,
Controllers::FS& fs)
: Screen(app),
dateTimeController {dateTimeController},
batteryController {batteryController},
@ -32,6 +33,7 @@ Clock::Clock(DisplayApp* app,
settingsController {settingsController},
heartRateController {heartRateController},
motionController {motionController},
fs{fs},
screen {[this, &settingsController]() {
switch (settingsController.GetClockFace()) {
case 0:
@ -115,5 +117,6 @@ std::unique_ptr<Screen> Clock::WatchFaceInfineatScreen() {
bleController,
notificatioManager,
settingsController,
motionController);
motionController,
fs);
}

View file

@ -28,7 +28,8 @@ namespace Pinetime {
Controllers::NotificationManager& notificatioManager,
Controllers::Settings& settingsController,
Controllers::HeartRateController& heartRateController,
Controllers::MotionController& motionController);
Controllers::MotionController& motionController,
Controllers::FS& fs);
~Clock() override;
bool OnTouchEvent(TouchEvents event) override;
@ -42,6 +43,7 @@ namespace Pinetime {
Controllers::Settings& settingsController;
Controllers::HeartRateController& heartRateController;
Controllers::MotionController& motionController;
Controllers::FS& fs;
std::unique_ptr<Screen> screen;
std::unique_ptr<Screen> WatchFaceDigitalScreen();

View file

@ -38,7 +38,6 @@ namespace Pinetime {
static constexpr const char* eye = "\xEF\x81\xAE";
static constexpr const char* home = "\xEF\x80\x95";
static constexpr const char* sleep = "\xEE\xBD\x84";
static constexpr const char* circle = "\xEF\x84\x91";
// lv_font_sys_48.c
static constexpr const char* settings = "\xEE\xA2\xB8";

View file

@ -20,15 +20,14 @@ namespace {
}
}
LV_IMG_DECLARE(logo_pine);
WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app,
Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController,
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::MotionController& motionController)
Controllers::MotionController& motionController,
Controllers::FS& fs)
: Screen(app),
currentDateTime {{}},
dateTimeController {dateTimeController},
@ -37,6 +36,14 @@ WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app,
notificationManager {notificationManager},
settingsController {settingsController},
motionController {motionController} {
lfs_file f = {};
if(fs.FileOpen(&f, "/fonts/teko.bin", LFS_O_RDONLY) >= 0) {
font_teko = lv_font_load("F:/fonts/teko.bin");
}
if(fs.FileOpen(&f, "/fonts/bebas.bin", LFS_O_RDONLY) >= 0) {
font_bebas = lv_font_load("F:/fonts/bebas.bin");
}
// Black background covering the whole screen
background = lv_obj_create(lv_scr_act(), nullptr);
@ -138,7 +145,7 @@ WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app,
lv_line_set_points(line8, line8Points, 2);
logoPine = lv_img_create(lv_scr_act(), nullptr);
lv_img_set_src(logoPine, &logo_pine);
lv_img_set_src(logoPine, "F:/images/pine_small.bin");
lv_obj_set_pos(logoPine, 15, 106);
lv_style_init(&lineBatteryStyle);
@ -174,49 +181,76 @@ WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app,
timeContainer = lv_obj_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_bg_opa(timeContainer, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP);
if(font_bebas != nullptr) {
lv_obj_set_size(timeContainer, 185, 185);
lv_obj_align(timeContainer, lv_scr_act(), LV_ALIGN_CENTER, 0, -10);
} else {
lv_obj_set_size(timeContainer, 110, 145);
lv_obj_align(timeContainer, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
}
labelHour = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_font(labelHour, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_extrabold_compressed);
lv_label_set_text(labelHour, "01");
if(font_bebas != nullptr) {
lv_obj_set_style_local_text_font(labelHour, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_bebas);
lv_obj_align(labelHour, timeContainer, LV_ALIGN_IN_TOP_MID, 0, 0);
}
else {
lv_obj_set_style_local_text_font(labelHour, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_extrabold_compressed);
lv_obj_align(labelHour, timeContainer, LV_ALIGN_IN_TOP_MID, 0, 5);
}
labelMinutes = lv_label_create(lv_scr_act(), nullptr);
if(font_bebas != nullptr) {
lv_obj_set_style_local_text_font(labelMinutes, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_bebas);
}
else {
lv_obj_set_style_local_text_font(labelMinutes, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_extrabold_compressed);
}
lv_label_set_text(labelMinutes, "00");
lv_obj_align(labelMinutes, timeContainer, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
labelTimeAmPm = lv_label_create(lv_scr_act(), nullptr);
if(font_teko != nullptr) {
lv_obj_set_style_local_text_font(labelTimeAmPm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_teko);
}
else {
lv_obj_set_style_local_text_font(labelTimeAmPm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
}
lv_label_set_text(labelTimeAmPm, "");
lv_obj_align(labelTimeAmPm, timeContainer, LV_ALIGN_OUT_RIGHT_TOP, 0, 15);
dateContainer = lv_obj_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_bg_opa(dateContainer, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP);
lv_obj_set_size(dateContainer, 40, 50);
lv_obj_set_size(dateContainer, 60, 30);
lv_obj_align(dateContainer, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 5);
labelDateDay = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(labelDateDay, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
lv_obj_set_style_local_text_font(labelDateDay, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
lv_obj_align(labelDateDay, dateContainer, LV_ALIGN_IN_TOP_MID, 0, 0);
lv_label_set_text(labelDateDay, "Mon");
labelDateNum = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(labelDateNum, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
lv_obj_set_style_local_text_font(labelDateNum, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
lv_obj_align(labelDateNum, dateContainer, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
lv_label_set_text(labelDateNum, "01");
labelDate = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(labelDate, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
if(font_teko != nullptr) {
lv_obj_set_style_local_text_font(labelDate, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_teko);
}
else {
lv_obj_set_style_local_text_font(labelDate, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
}
lv_obj_align(labelDate, dateContainer, LV_ALIGN_IN_TOP_MID, 0, 0);
lv_label_set_text(labelDate, "Mon 01");
bleIcon = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(bleIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
lv_label_set_text(bleIcon, Symbols::bluetooth);
lv_obj_align(bleIcon, dateContainer, LV_ALIGN_OUT_BOTTOM_MID, 0, 7);
lv_obj_align(bleIcon, dateContainer, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
stepValue = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
if(font_teko != nullptr) {
lv_obj_set_style_local_text_font(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_teko);
}
else {
lv_obj_set_style_local_text_font(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
}
lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, 10, 0);
lv_label_set_text(stepValue, "0");
@ -294,6 +328,13 @@ WatchFaceInfineat::~WatchFaceInfineat() {
lv_style_reset(&line8Style);
lv_style_reset(&lineBatteryStyle);
if (font_bebas != nullptr) {
lv_font_free(font_bebas);
}
if(font_teko != nullptr) {
lv_font_free(font_teko);
}
lv_obj_clean(lv_scr_act());
}
@ -459,10 +500,8 @@ void WatchFaceInfineat::Refresh() {
}
if ((year != currentYear) || (month != currentMonth) || (dayOfWeek != currentDayOfWeek) || (day != currentDay)) {
lv_label_set_text_fmt(labelDateDay, "%s", dateTimeController.DayOfWeekShortToStringLow());
lv_label_set_text_fmt(labelDateNum, "%02d", day);
lv_obj_align(labelDateDay, dateContainer, LV_ALIGN_IN_TOP_MID, 0, 0);
lv_obj_align(labelDateNum, dateContainer, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
lv_label_set_text_fmt(labelDate, "%s %02d", dateTimeController.DayOfWeekShortToStringLow(), day);
lv_obj_realign(labelDate);
currentYear = year;
currentMonth = month;

View file

@ -27,7 +27,8 @@ namespace Pinetime {
Controllers::Ble& bleController,
Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController,
Controllers::MotionController& motionController);
Controllers::MotionController& motionController,
Controllers::FS& fs);
~WatchFaceInfineat() override;
@ -101,8 +102,7 @@ namespace Pinetime {
lv_obj_t* labelMinutes;
lv_obj_t* labelTimeAmPm;
lv_obj_t* dateContainer;
lv_obj_t* labelDateDay;
lv_obj_t* labelDateNum;
lv_obj_t* labelDate;
lv_obj_t* bleIcon;
lv_obj_t* stepIcon;
lv_obj_t* stepValue;
@ -137,6 +137,8 @@ namespace Pinetime {
void ToggleBatteryIndicatorColor(bool showSideCover);
lv_task_t* taskRefresh;
lv_font_t* font_teko = nullptr;
lv_font_t* font_bebas = nullptr;
};
}
}

View file

@ -131,7 +131,8 @@ Pinetime::Applications::DisplayApp displayApp(lcd,
timerController,
alarmController,
brightnessController,
touchHandler);
touchHandler,
fs);
Pinetime::System::SystemTask systemTask(spi,
lcd,

View file

@ -3,7 +3,7 @@
"sources": [
{
"file": "fonts/Teko-Light.ttf",
"symbols": "0123456789:/amp"
"symbols": "0123456789:/ampMonTueWdhFriSt "
}
],
"bpp": 1,

View file

@ -1,7 +1,7 @@
{
"pine_small" : {
"sources": "images/pine_logo.png",
"color_format": "CF_TRUE_COLOR",
"color_format": "CF_TRUE_COLOR_ALPHA",
"output_format": "bin",
"binary_format": "ARGB8565_RBSWAP",
"target_path": "/images/"