From c63b97c65e27110b3e9f0e83b714f49854e9a495 Mon Sep 17 00:00:00 2001 From: incyi Date: Tue, 28 Jul 2020 22:51:14 +0200 Subject: Update README.md add ci badge. diff --git a/README.md b/README.md index fec2fb9..14f3328 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # PineTime + +![CI](https://github.com/JF002/Pinetime/workflows/CI/badge.svg) + > The PineTime is a free and open source smartwatch capable of running custom-built open operating systems. Some of the notable features include a heart rate monitor, a week-long battery as well as a capacitive touch IPS display that is legible in direct sunlight. It is a fully community driven side-project, which means that it will ultimately be up to the developers and end-users to determine when they deem the PineTime ready to ship. > We envision the PineTime as a companion for not only your PinePhone but also for your favorite devices — any phone, tablet, or even PC. -- cgit v0.10.2 From 58c0f3ba253d3f9848e5d09b679f7f334e442d5a Mon Sep 17 00:00:00 2001 From: incyi Date: Wed, 7 Oct 2020 18:01:01 +0200 Subject: Update README.md diff --git a/README.md b/README.md index 14f3328..6eebbac 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PineTime -![CI](https://github.com/JF002/Pinetime/workflows/CI/badge.svg) +![Build PineTime Firmware](https://github.com/JF002/Pinetime/workflows/Build%20PineTime%20Firmware/badge.svg) > The PineTime is a free and open source smartwatch capable of running custom-built open operating systems. Some of the notable features include a heart rate monitor, a week-long battery as well as a capacitive touch IPS display that is legible in direct sunlight. It is a fully community driven side-project, which means that it will ultimately be up to the developers and end-users to determine when they deem the PineTime ready to ship. -- cgit v0.10.2 From aa3735f5c8c8dc3f9cdcdd91e084a5e508d24e8a Mon Sep 17 00:00:00 2001 From: incyi Date: Wed, 7 Oct 2020 18:02:09 +0200 Subject: Update README.md Branch set to develop. diff --git a/README.md b/README.md index 6eebbac..9eeee4a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PineTime -![Build PineTime Firmware](https://github.com/JF002/Pinetime/workflows/Build%20PineTime%20Firmware/badge.svg) +![Build PineTime Firmware](https://github.com/JF002/Pinetime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=develop) > The PineTime is a free and open source smartwatch capable of running custom-built open operating systems. Some of the notable features include a heart rate monitor, a week-long battery as well as a capacitive touch IPS display that is legible in direct sunlight. It is a fully community driven side-project, which means that it will ultimately be up to the developers and end-users to determine when they deem the PineTime ready to ship. -- cgit v0.10.2 From 3ccfa1d92422e4020bc1b144690fee540c2e04f2 Mon Sep 17 00:00:00 2001 From: Ryan Hartlage Date: Sun, 1 Nov 2020 15:22:21 -0500 Subject: Fixed typo (Transfert -> Transfer) diff --git a/bootloader/README.md b/bootloader/README.md index 4f08f60..c04e0e3 100644 --- a/bootloader/README.md +++ b/bootloader/README.md @@ -3,7 +3,7 @@ The [bootloader](https://github.com/lupyuen/pinetime-rust-mynewt/tree/master/lib The goal of this project is to provide a common bootloader for multiple (all?) Pinetime projects. It allows to upgrade the current bootloader and even replace the current application by another one that supports the same bootloader. -As we wanted this bootloader to be as universal as possible, we decided that it should **not** integrate a BLE stack and provide OTA capabilities. +As we wanted this bootloader to be as universal as possible, we decided that it should **not** integrate a BLE stack and provide OTA capabilities. Integrating a BLE stack for the OTA functionality would have used to much memory space and/or forced all the firmware developers to use the same BLE stack as the bootloader. @@ -18,7 +18,7 @@ MCUBoot is run at boot time. In normal operation, it just jumps to the reset han But MCUBoot does much more than that : it can upgrade the firmware that is currently running by a new one, and it is also able to revert to the previous version of the firmware in case the new one does not run propertly. -To do this, it uses 2 memory 'slots' : +To do this, it uses 2 memory 'slots' : - **The primary slot** : it contains the current firmware, the one that will be executed by MCUBoot - **The secondary slot** : it is used to store the upgraded version of the firmware, when available. @@ -37,13 +37,13 @@ Note than MCUBoot **does not** provide any means to download and store the new v # Degraded cases This chapter describes degraded cases that are handled by our bootloader and those that are not supported. -Case | Current bootloader | Solution +Case | Current bootloader | Solution -----|--------------------|---------------------------------------------- -Data got corrupted during file transfert | [OK] Application firmware does a CRC check before applying the update, and does not proceed if it fails. | N/A -New firmware does not run at all (bad file) (1) | [NOK] MCU executes unknown instructions and will most likely end up in an infinite loop or freeze in an error handler. The bootloader does not run, it can do nothing, the MCU is stucked until next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset. +Data got corrupted during file transfer | [OK] Application firmware does a CRC check before applying the update, and does not proceed if it fails. | N/A +New firmware does not run at all (bad file) (1) | [NOK] MCU executes unknown instructions and will most likely end up in an infinite loop or freeze in an error handler. The bootloader does not run, it can do nothing, the MCU is stucked until next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset. New firmware runs, does not set the valid bit and does not refresh the watchdog | [NOK] The new firmware runs until the next reset. The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [OK] The bootloader starts the watchdog just before running the new firmware. This way, the watchdog will reset the MCU after ~7s because the firmware does not refresh it. Bootloader reverts to the previous version of the firmware during the reset. New firmware does not run properly, does not set the valid bit but refreshes the watchdog | [NOK] The bootloader will be able to revert to the previous firmware only during the next reset. If the new firmware does not run properly and does not reset, the bootloader can do nothing until the next reset | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged and will be able to rollback to the previous version. -New firmware does not run properly but sets the valid bit and refreshes the watchdog | [NOK] The bootloader won't revert to the previous version because the valid flag is set | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged. Then, the bootloader must provide a way for the user to force the rollback to the previous version +New firmware does not run properly but sets the valid bit and refreshes the watchdog | [NOK] The bootloader won't revert to the previous version because the valid flag is set | [~] Wait for the battery to drain. The CPU will reset the next time the device is charged. Then, the bootloader must provide a way for the user to force the rollback to the previous version *(1) I've observed this when I tried to run a firmware built to run from offset 0 while it was flashed at offset 0x8000 in memory (bad vector table).* @@ -59,7 +59,7 @@ The SPI Flash memory is not accessible via the SWD debugger. Use the firmware 'p $ make pinetime-graphics ``` - - Program (using OpenOCD for example) : + - Program (using OpenOCD for example) : ``` program pinetime-graphics.bin 0 ``` @@ -84,7 +84,7 @@ Build the binary compatible with the booloader: make pinetime-mcuboot-app ` -The binary is located in */src/pinetime-mcuboot-app.bin*. +The binary is located in */src/pinetime-mcuboot-app.bin*. It must me converted into a MCUBoot image using *imgtool.py* from [MCUBoot](https://github.com/JuulLabs-OSS/mcuboot/tree/master/scripts). Simply checkout the project and run the script /scripts/imgtool.py with the following command line: diff --git a/src/components/gfx/Gfx.cpp b/src/components/gfx/Gfx.cpp index 3c5dbfb..bab7c8d 100644 --- a/src/components/gfx/Gfx.cpp +++ b/src/components/gfx/Gfx.cpp @@ -23,7 +23,7 @@ void Gfx::ClearScreen() { lcd.BeginDrawBuffer(0, 0, width, height); lcd.NextDrawBuffer(reinterpret_cast(buffer), width * 2); - WaitTransfertFinished(); + WaitTransferFinished(); } @@ -40,7 +40,7 @@ void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint16_t col lcd.BeginDrawBuffer(x, y, w, h); lcd.NextDrawBuffer(reinterpret_cast(buffer), width * 2); - WaitTransfertFinished(); + WaitTransferFinished(); } void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t* b) { @@ -54,7 +54,7 @@ void Gfx::FillRectangle(uint8_t x, uint8_t y, uint8_t w, uint8_t h, uint8_t* b) lcd.BeginDrawBuffer(x, y, w, h); lcd.NextDrawBuffer(reinterpret_cast(b), width * 2); - WaitTransfertFinished(); + WaitTransferFinished(); } void Gfx::DrawString(uint8_t x, uint8_t y, uint16_t color, const char *text, const FONT_INFO *p_font, bool wrap) { @@ -125,7 +125,7 @@ void Gfx::DrawChar(const FONT_INFO *font, uint8_t c, uint8_t *x, uint8_t y, uint lcd.BeginDrawBuffer(*x, y, bytes_in_line*8, font->height); lcd.NextDrawBuffer(reinterpret_cast(&buffer), bytes_in_line*8*2); - WaitTransfertFinished(); + WaitTransferFinished(); *x += font->charInfo[char_idx].widthBits + font->spacePixels; } @@ -153,7 +153,7 @@ bool Gfx::GetNextBuffer(uint8_t **data, size_t &size) { state.remainingIterations--; if (state.remainingIterations == 0) { state.busy = false; - NotifyEndOfTransfert(state.taskToNotify); + NotifyEndOfTransfer(state.taskToNotify); return false; } @@ -185,7 +185,7 @@ bool Gfx::GetNextBuffer(uint8_t **data, size_t &size) { return true; } -void Gfx::NotifyEndOfTransfert(TaskHandle_t task) { +void Gfx::NotifyEndOfTransfer(TaskHandle_t task) { if(task != nullptr) { BaseType_t xHigherPriorityTaskWoken = pdFALSE; vTaskNotifyGiveFromISR(task, &xHigherPriorityTaskWoken); @@ -193,7 +193,7 @@ void Gfx::NotifyEndOfTransfert(TaskHandle_t task) { } } -void Gfx::WaitTransfertFinished() const { +void Gfx::WaitTransferFinished() const { ulTaskNotifyTake(pdTRUE, 500); } @@ -204,4 +204,3 @@ void Gfx::SetScrollArea(uint16_t topFixedLines, uint16_t scrollLines, uint16_t b void Gfx::SetScrollStartLine(uint16_t line) { lcd.VerticalScrollStartAddress(line); } - diff --git a/src/components/gfx/Gfx.h b/src/components/gfx/Gfx.h index 091f06f..eba6319 100644 --- a/src/components/gfx/Gfx.h +++ b/src/components/gfx/Gfx.h @@ -53,8 +53,8 @@ namespace Pinetime { Drivers::St7789& lcd; void SetBackgroundColor(uint16_t color); - void WaitTransfertFinished() const; - void NotifyEndOfTransfert(TaskHandle_t task); + void WaitTransferFinished() const; + void NotifyEndOfTransfer(TaskHandle_t task); }; } } diff --git a/src/displayapp/LittleVgl.cpp b/src/displayapp/LittleVgl.cpp index 3483f8e..7b6275e 100644 --- a/src/displayapp/LittleVgl.cpp +++ b/src/displayapp/LittleVgl.cpp @@ -76,8 +76,8 @@ void LittleVgl::SetFullRefresh(FullRefreshDirections direction) { void LittleVgl::FlushDisplay(const lv_area_t *area, lv_color_t *color_p) { ulTaskNotifyTake(pdTRUE, 500); - // NOtification is still needed (even if there is a mutex on SPI) because of the DataCommand pin - // which cannot be set/clear during a transfert. + // Notification is still needed (even if there is a mutex on SPI) because of the DataCommand pin + // which cannot be set/clear during a transfer. // TODO refactore and remove duplicated code @@ -831,6 +831,3 @@ void LittleVgl::InitThemeWindow() { // theme.style.win.btn.rel = &lv_style_transp; // theme.style.win.btn.pr = &win_btn_pr; } - - - -- cgit v0.10.2 From 10c52601879d80da55f5479a75ffb7f942ad2b61 Mon Sep 17 00:00:00 2001 From: Samuel Archibald Date: Mon, 2 Nov 2020 21:14:28 -0500 Subject: Fixed displaying last displayed time for ~100ms on wake diff --git a/.gitignore b/.gitignore index e1d954b..8d416f8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ CMakeFiles/ **/CMakeCache.txt cmake_install.cmake Makefile +build/ # Resulting binary files *.a diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index dac4ce2..f82bfc6 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -105,8 +105,12 @@ void SystemTask::Work() { #pragma clang diagnostic push #pragma ide diagnostic ignored "EndlessLoop" while(true) { + uint8_t msg; if (xQueueReceive(systemTasksMsgQueue, &msg, isSleeping ? 2500 : 1000)) { + uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG); + dateTimeController.UpdateTime(systick_counter); + batteryController.Update(); Messages message = static_cast(msg); switch(message) { case Messages::GoToRunning: @@ -190,10 +194,6 @@ void SystemTask::Work() { } } - uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG); - dateTimeController.UpdateTime(systick_counter); - batteryController.Update(); - monitor.Process(); if(!nrf_gpio_pin_read(pinButton)) -- cgit v0.10.2 From 37c27687874bcafe2fcc8ac6fdba0b6d549d6434 Mon Sep 17 00:00:00 2001 From: Samuel Archibald Date: Mon, 2 Nov 2020 23:13:31 -0500 Subject: This is the actual fix, reducing the time between LCD is turned back on and the next task which will display the time is started. diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index f82bfc6..3271edc 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -105,11 +105,8 @@ void SystemTask::Work() { #pragma clang diagnostic push #pragma ide diagnostic ignored "EndlessLoop" while(true) { - uint8_t msg; if (xQueueReceive(systemTasksMsgQueue, &msg, isSleeping ? 2500 : 1000)) { - uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG); - dateTimeController.UpdateTime(systick_counter); batteryController.Update(); Messages message = static_cast(msg); switch(message) { @@ -117,15 +114,15 @@ void SystemTask::Work() { spi.Wakeup(); twiMaster.Wakeup(); + nimbleController.StartAdvertising(); + xTimerStart(idleTimer, 0); spiNorFlash.Wakeup(); - lcd.Wakeup(); touchPanel.Wakeup(); + lcd.Wakeup(); displayApp->PushMessage(Applications::DisplayApp::Messages::GoToRunning); displayApp->PushMessage(Applications::DisplayApp::Messages::UpdateBatteryLevel); - xTimerStart(idleTimer, 0); - nimbleController.StartAdvertising(); isSleeping = false; isWakingUp = false; break; @@ -195,7 +192,7 @@ void SystemTask::Work() { } monitor.Process(); - + dateTimeController.UpdateTime(nrf_rtc_counter_get(portNRF_RTC_REG);); if(!nrf_gpio_pin_read(pinButton)) watchdog.Kick(); } -- cgit v0.10.2 From c816d9b88ee9bcc9c524da3f0c478f93eb965dcb Mon Sep 17 00:00:00 2001 From: Samuel Archibald Date: Mon, 2 Nov 2020 23:29:42 -0500 Subject: Fix to #119 diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp index 867fdae..34359c2 100644 --- a/src/displayapp/screens/SystemInfo.cpp +++ b/src/displayapp/screens/SystemInfo.cpp @@ -43,10 +43,9 @@ bool SystemInfo::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } std::unique_ptr SystemInfo::CreateScreen1() { - auto batteryPercentF = batteryController.PercentRemaining(); - uint16_t batteryPercent = 0; - if(batteryPercentF > 100.0f) batteryPercent = 100; - else if(batteryPercentF < 0.0f) batteryPercent = 0; + auto batteryPercent = batteryController.PercentRemaining(); + if(batteryPercent > 100.0f) batteryPercent = 100; + else if(batteryPercent < 0.0f) batteryPercent = 0; uint8_t brightness = 0; switch(brightnessController.Level()) { @@ -98,7 +97,7 @@ std::unique_ptr SystemInfo::CreateScreen1() { dateTimeController.Day(), static_cast(dateTimeController.Month()), dateTimeController.Year(), dateTimeController.Hours(), dateTimeController.Minutes(), dateTimeController.Seconds(), uptimeDays, uptimeHours, uptimeMinutes, uptimeSeconds, - batteryPercent, brightness, resetReason); + (int) batteryPercent, brightness, resetReason); return std::unique_ptr(new Screens::Label(app, t1)); } -- cgit v0.10.2 From 64408803bea010386a1f30871a32cf5dcd7e4311 Mon Sep 17 00:00:00 2001 From: Ilia Zarubin Date: Sat, 7 Nov 2020 23:41:24 +0300 Subject: fonts: add cyrillic symbols in mono bold font Just converted jetbrains and awesome fonts with additional cyrillic symbols. diff --git a/src/displayapp/fonts/jetbrains_mono_bold_20.c b/src/displayapp/fonts/jetbrains_mono_bold_20.c index 27ad005..183e591 100644 --- a/src/displayapp/fonts/jetbrains_mono_bold_20.c +++ b/src/displayapp/fonts/jetbrains_mono_bold_20.c @@ -22,36 +22,36 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x0, /* U+21 "!" */ - 0xff, 0xff, 0xff, 0xe0, 0xf, 0xc0, + 0xff, 0xff, 0xff, 0xfc, 0xf, 0xc0, /* U+22 "\"" */ 0xef, 0xdf, 0xbf, 0x7e, 0xfd, 0xc0, /* U+23 "#" */ - 0x8, 0xc3, 0x10, 0x62, 0x3f, 0xf7, 0xfe, 0x23, + 0x8, 0xc3, 0x10, 0x66, 0x3f, 0xf7, 0xfe, 0x23, 0x4, 0x61, 0x88, 0x31, 0x1f, 0xfb, 0xff, 0x19, 0x82, 0x30, 0xc4, 0x0, /* U+24 "$" */ - 0x8, 0x2, 0x1, 0xc1, 0xfe, 0xeb, 0xf2, 0x7c, - 0x83, 0xa0, 0x7c, 0xf, 0xc0, 0xf8, 0x27, 0x9, - 0xf2, 0x7f, 0xf9, 0xfc, 0x8, 0x2, 0x0, 0x80, + 0x8, 0x2, 0x1, 0xe1, 0xfe, 0xfb, 0xfa, 0x7e, + 0x83, 0xe0, 0x7e, 0xf, 0xe0, 0xf8, 0x27, 0x9, + 0xfa, 0x7f, 0xf9, 0xfc, 0x8, 0x2, 0x0, 0x80, /* U+25 "%" */ - 0x78, 0x1f, 0x83, 0x30, 0x66, 0x1f, 0xcc, 0xf2, - 0x1, 0x80, 0xde, 0x67, 0xf8, 0xcc, 0x19, 0x83, - 0x30, 0x7e, 0x7, 0x80, + 0x78, 0x3f, 0xc6, 0xcc, 0xcc, 0xcc, 0xfd, 0x87, + 0xb0, 0x6, 0x0, 0x7e, 0xf, 0xf1, 0xb3, 0x33, + 0x33, 0x33, 0x63, 0xfc, 0x1e, /* U+26 "&" */ - 0x1e, 0x7, 0xe1, 0xce, 0x38, 0x7, 0x0, 0x70, - 0x1e, 0x7, 0x66, 0xed, 0xdc, 0xf3, 0x9c, 0x73, + 0x1e, 0xf, 0xe1, 0x8e, 0x30, 0x6, 0x0, 0x60, + 0x1e, 0x7, 0xe6, 0xed, 0xdc, 0xf3, 0x9e, 0x73, 0xcf, 0xfc, 0xf9, 0x80, /* U+27 "'" */ 0xff, 0xff, 0xc0, /* U+28 "(" */ - 0x2, 0x1c, 0xfb, 0xc7, 0x1e, 0x38, 0x70, 0xe1, + 0x2, 0x1c, 0xfb, 0xc7, 0x1c, 0x38, 0x70, 0xe1, 0xc3, 0x87, 0xe, 0x1c, 0x3c, 0x38, 0x38, 0x7c, 0x38, @@ -62,7 +62,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { /* U+2A "*" */ 0xc, 0x3, 0x8, 0xc7, 0xb7, 0x7f, 0x83, 0x1, - 0xe0, 0xcc, 0x73, 0x80, 0x0, + 0xe0, 0xcc, 0x73, 0x88, 0x0, /* U+2B "+" */ 0x1c, 0x7, 0x1, 0xc3, 0xff, 0xff, 0xc7, 0x1, @@ -72,10 +72,10 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x7b, 0x9c, 0xce, 0x60, /* U+2D "-" */ - 0xff, 0xff, + 0xff, 0xff, 0xc0, /* U+2E "." */ - 0x6f, 0xf6, + 0xff, 0xf0, /* U+2F "/" */ 0x1, 0xc0, 0x60, 0x38, 0xe, 0x3, 0x1, 0xc0, @@ -83,58 +83,58 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0xe, 0x3, 0x80, 0xc0, 0x70, 0x18, 0xe, 0x0, /* U+30 "0" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xed, 0xfb, 0x7e, - 0xdf, 0xb7, 0xed, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, - 0x8f, 0x80, + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, + 0xdf, 0xb7, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0x8f, 0xc0, /* U+31 "1" */ - 0x3c, 0x3e, 0x3f, 0x13, 0x81, 0xc0, 0xe0, 0x70, - 0x38, 0x1c, 0xe, 0x7, 0x3, 0x8f, 0xff, 0xfc, + 0x1e, 0x3f, 0x3b, 0x99, 0xc8, 0xe0, 0x70, 0x38, + 0x1c, 0xe, 0x7, 0x3, 0x81, 0xcf, 0xff, 0xfc, /* U+32 "2" */ - 0x1f, 0x1f, 0xef, 0x3f, 0x87, 0x1, 0xc0, 0x70, - 0x38, 0x1e, 0xf, 0x7, 0x87, 0x83, 0xc0, 0xff, - 0xff, 0xf0, + 0x3e, 0x3f, 0xbc, 0xfc, 0x70, 0x38, 0x1c, 0x1c, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0xf, 0xff, 0xfc, /* U+33 "3" */ - 0x7f, 0xdf, 0xf0, 0x3c, 0x1c, 0x1c, 0x7, 0xc1, - 0xf8, 0xf, 0x1, 0xc0, 0x7e, 0x1d, 0x8f, 0x7f, - 0x87, 0xc0, + 0x7f, 0x9f, 0xe0, 0x38, 0x18, 0xc, 0x7, 0xc1, + 0xf8, 0xf, 0x1, 0xc0, 0x7e, 0x1f, 0xcf, 0x7f, + 0x8f, 0xc0, /* U+34 "4" */ 0x7, 0x7, 0x3, 0x83, 0x83, 0x81, 0xc1, 0xcf, 0xe7, 0xe3, 0xff, 0xff, 0xe0, 0x70, 0x38, 0x1c, /* U+35 "5" */ - 0xff, 0x7f, 0xb8, 0x1c, 0xe, 0x7, 0x73, 0xfd, - 0xcf, 0x3, 0x81, 0xc0, 0xfc, 0xff, 0xf1, 0xf0, + 0x7f, 0x9f, 0xe7, 0x1, 0xc0, 0x77, 0x1f, 0xe7, + 0x3c, 0x7, 0x1, 0xc0, 0x77, 0x1d, 0xcf, 0x7f, + 0x87, 0xc0, /* U+36 "6" */ - 0x6, 0x3, 0x1, 0xc0, 0x60, 0x30, 0x1b, 0xc7, + 0x6, 0x3, 0x1, 0xc0, 0x60, 0x38, 0x1d, 0xc7, 0xfb, 0xcf, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, 0x87, 0x80, /* U+37 "7" */ - 0xff, 0xff, 0xfe, 0xb, 0x86, 0x1, 0x80, 0xc0, - 0x30, 0x18, 0x6, 0x3, 0x80, 0xc0, 0x70, 0x18, + 0xff, 0xff, 0xfe, 0x1b, 0x86, 0x3, 0x80, 0xc0, + 0x70, 0x18, 0x6, 0x3, 0x80, 0xc0, 0x70, 0x18, 0xe, 0x0, /* U+38 "8" */ - 0x3e, 0x1f, 0xce, 0x3b, 0x6, 0xe3, 0x9f, 0xc7, - 0xf1, 0x8e, 0xc1, 0xf0, 0x7c, 0x1f, 0x8f, 0x7f, - 0x8f, 0x80, + 0x3f, 0x1f, 0xee, 0x1f, 0x87, 0xe1, 0xcf, 0xc3, + 0xf1, 0xce, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0x8f, 0xc0, /* U+39 "9" */ 0x1e, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7f, - 0x3d, 0xfe, 0x3d, 0x80, 0xc0, 0x60, 0x38, 0xc, + 0x3d, 0xfe, 0x3b, 0x81, 0xc0, 0x60, 0x38, 0xc, 0x6, 0x0, /* U+3A ":" */ - 0xff, 0x80, 0x0, 0xff, 0x80, + 0xff, 0xf0, 0x0, 0x0, 0xff, 0xf0, /* U+3B ";" */ - 0x7b, 0xde, 0x0, 0x0, 0x0, 0x7b, 0x9c, 0xce, - 0x60, + 0x7b, 0xde, 0x0, 0x0, 0x0, 0x3, 0xdc, 0xe6, + 0x73, 0x0, /* U+3C "<" */ 0x0, 0x81, 0xc3, 0xe7, 0xcf, 0x6, 0x3, 0xc0, @@ -144,22 +144,23 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0xff, 0xff, 0xc0, 0x0, 0x0, 0x7, 0xff, 0xfe, /* U+3E ">" */ - 0x0, 0x70, 0x3e, 0x7, 0xc0, 0xf8, 0xc, 0x1e, - 0x7c, 0xf8, 0x70, 0x20, 0x0, + 0x80, 0x70, 0x3e, 0x7, 0xc0, 0xf8, 0xc, 0x1e, + 0x3c, 0xf8, 0x70, 0x20, 0x0, /* U+3F "?" */ 0xfc, 0xfe, 0xf, 0x7, 0x7, 0xf, 0x3e, 0x3c, 0x30, 0x30, 0x0, 0x0, 0x70, 0x70, /* U+40 "@" */ - 0x1f, 0x87, 0xf9, 0xc3, 0xf0, 0x3c, 0x77, 0x9f, - 0xf3, 0x1e, 0x63, 0xcc, 0x79, 0x8f, 0x31, 0xe7, - 0xfc, 0x77, 0xc0, 0x1c, 0x1, 0xf0, 0x1e, 0x0, + 0x1f, 0x7, 0xf9, 0xc3, 0x70, 0x3c, 0x7, 0x8f, + 0xf3, 0xfe, 0x63, 0xcc, 0x79, 0x8f, 0x31, 0xe6, + 0x3c, 0xff, 0x8e, 0xf8, 0x3, 0x80, 0x3e, 0x3, + 0xc0, /* U+41 "A" */ - 0xf, 0x0, 0xf0, 0xf, 0x1, 0xf8, 0x19, 0x81, - 0x98, 0x19, 0x83, 0x9c, 0x3f, 0xc3, 0xfc, 0x70, - 0xe7, 0xe, 0x60, 0x66, 0x6, + 0x1e, 0x7, 0x81, 0xe0, 0xfc, 0x3f, 0xc, 0xc3, + 0x31, 0xce, 0x73, 0x9f, 0xe7, 0xfb, 0x87, 0xe1, + 0xf0, 0x30, /* U+42 "B" */ 0xfe, 0x3f, 0xce, 0x3b, 0x8e, 0xe3, 0xb8, 0xcf, @@ -172,9 +173,8 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x8f, 0xc0, /* U+44 "D" */ - 0xfe, 0x3f, 0xee, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0x8f, 0xff, - 0xbf, 0x80, + 0xfe, 0x7f, 0xb9, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0xff, 0xf7, 0xf0, /* U+45 "E" */ 0xff, 0xff, 0xf8, 0x1c, 0xe, 0x7, 0x3, 0xfd, @@ -187,43 +187,42 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { /* U+47 "G" */ 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe0, 0x38, 0xe, 0x7f, 0x9f, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, - 0x87, 0x80, + 0x8f, 0xc0, /* U+48 "H" */ 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0xff, 0xff, 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1c, /* U+49 "I" */ - 0xff, 0xff, 0xc7, 0x3, 0x81, 0xc0, 0xe0, 0x70, - 0x38, 0x1c, 0xe, 0x7, 0x3, 0x8f, 0xff, 0xfc, + 0xff, 0xff, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, + 0x1c, 0x1c, 0x1c, 0x1c, 0xff, 0xff, /* U+4A "J" */ - 0x3f, 0xcf, 0xf0, 0x1c, 0x7, 0x1, 0xc0, 0x70, - 0x1c, 0x7, 0x1, 0xc0, 0x7e, 0x1f, 0x8f, 0x7f, + 0xf, 0xc3, 0xf0, 0x1c, 0x7, 0x1, 0xc0, 0x70, + 0x1c, 0x7, 0x1, 0xc0, 0x7e, 0x1f, 0xcf, 0x7f, 0x8f, 0xc0, /* U+4B "K" */ - 0xe1, 0xdc, 0x3b, 0x8e, 0x71, 0xce, 0x31, 0xce, - 0x3f, 0x87, 0xf0, 0xe7, 0x1c, 0x63, 0x8e, 0x70, - 0xce, 0x1d, 0xc3, 0x80, + 0xe1, 0xf8, 0x7e, 0x3b, 0x8e, 0xe7, 0x39, 0xcf, + 0xe3, 0xf8, 0xe7, 0x39, 0xce, 0x3b, 0x8e, 0xe1, + 0xf8, 0x70, /* U+4C "L" */ 0xe0, 0x70, 0x38, 0x1c, 0xe, 0x7, 0x3, 0x81, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0xf, 0xff, 0xfc, /* U+4D "M" */ - 0xe1, 0xf8, 0x7f, 0x3f, 0xcf, 0xda, 0xf7, 0xbd, - 0xef, 0x33, 0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, - 0xf0, 0x30, + 0xf3, 0xfc, 0xfd, 0x2f, 0xcf, 0xff, 0xff, 0xfe, + 0xdf, 0xb7, 0xe1, 0xf8, 0x7e, 0x1f, 0x87, 0xe1, + 0xf8, 0x70, /* U+4E "N" */ - 0xe1, 0xf0, 0xfc, 0x7e, 0x3d, 0x9e, 0xcf, 0x67, - 0x9b, 0xcd, 0xe6, 0xf1, 0xf8, 0xfc, 0x3e, 0x1c, + 0xf3, 0xf9, 0xfc, 0xfe, 0x7f, 0xbf, 0xdf, 0xaf, + 0xd7, 0xef, 0xf7, 0xf9, 0xfc, 0xfe, 0x7f, 0x3c, /* U+4F "O" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, - 0x8f, 0x80, + 0x3e, 0x3f, 0xb8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x77, 0xf1, 0xf0, /* U+50 "P" */ 0xff, 0x3f, 0xee, 0x3f, 0x87, 0xe1, 0xf8, 0xff, @@ -233,7 +232,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { /* U+51 "Q" */ 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, - 0x8f, 0x80, 0x70, 0xe, 0x1, 0xc0, + 0x8f, 0x80, 0x70, 0xe, 0x3, 0x80, 0x70, /* U+52 "R" */ 0xff, 0x3f, 0xee, 0x3f, 0x87, 0xe1, 0xf8, 0xff, @@ -241,7 +240,7 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0xb8, 0x70, /* U+53 "S" */ - 0x3f, 0x1f, 0xee, 0x1f, 0x87, 0xe0, 0x3e, 0x7, + 0x3f, 0x1f, 0xee, 0x3f, 0x87, 0xe0, 0x3c, 0x7, 0xf0, 0x7e, 0x3, 0xc0, 0x7e, 0x1f, 0xcf, 0x7f, 0x8f, 0xc0, @@ -255,14 +254,14 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x77, 0xf1, 0xf0, /* U+56 "V" */ - 0x60, 0x66, 0x6, 0x70, 0xe7, 0xe, 0x30, 0xc3, - 0xc, 0x39, 0xc1, 0x98, 0x19, 0x81, 0x98, 0x1f, - 0x80, 0xf0, 0xf, 0x0, 0xf0, + 0xc0, 0xf8, 0x7e, 0x1d, 0x86, 0x61, 0x9c, 0xe7, + 0x38, 0xcc, 0x33, 0xf, 0xc3, 0xf0, 0x78, 0x1e, + 0x7, 0x80, /* U+57 "W" */ - 0xc6, 0x78, 0xcf, 0x39, 0xe7, 0x3e, 0xa6, 0xd6, - 0xda, 0xdb, 0x5b, 0x6b, 0x6d, 0x2d, 0xe7, 0x3c, - 0xe7, 0x9c, 0xe3, 0x80, + 0xce, 0x79, 0xcf, 0x29, 0xe5, 0x3c, 0xa7, 0xd5, + 0xda, 0xb3, 0x56, 0x7b, 0xcf, 0x79, 0xef, 0x38, + 0xe7, 0x1c, 0xe3, 0x80, /* U+58 "X" */ 0xe1, 0xd8, 0x67, 0x38, 0xcc, 0x3f, 0x7, 0x81, @@ -270,12 +269,12 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0xf8, 0x70, /* U+59 "Y" */ - 0xe0, 0xfc, 0x1d, 0xc7, 0x38, 0xe3, 0x98, 0x77, + 0xe0, 0xfc, 0x1d, 0xc7, 0x38, 0xe3, 0xb8, 0x77, 0x6, 0xc0, 0xf8, 0xe, 0x1, 0xc0, 0x38, 0x7, 0x0, 0xe0, 0x1c, 0x0, /* U+5A "Z" */ - 0xff, 0xff, 0xc0, 0xe0, 0xe0, 0x60, 0x70, 0x70, + 0xff, 0xff, 0xc0, 0xe0, 0xe0, 0x70, 0x70, 0x70, 0x38, 0x38, 0x38, 0x1c, 0x1c, 0xf, 0xff, 0xfc, /* U+5B "[" */ @@ -302,136 +301,424 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0x63, 0x8e, /* U+61 "a" */ - 0x3f, 0x1f, 0xee, 0x1c, 0x7, 0x3f, 0xdf, 0xfe, - 0x1f, 0x87, 0xe3, 0xff, 0xf7, 0xdc, + 0x1f, 0x1f, 0xe7, 0x1c, 0x7, 0x3f, 0xdf, 0xfe, + 0x1f, 0x87, 0xe3, 0xff, 0xf3, 0xdc, /* U+62 "b" */ - 0xe0, 0x38, 0xe, 0x3, 0xbc, 0xff, 0xbc, 0xfe, - 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0xff, - 0xbb, 0xc0, + 0xe0, 0x70, 0x38, 0x1d, 0xcf, 0xf7, 0x1f, 0x8f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x7f, 0xf7, 0x70, /* U+63 "c" */ - 0x3f, 0x1f, 0xef, 0x1f, 0x83, 0xe0, 0x38, 0xe, - 0x3, 0x87, 0xf1, 0xdf, 0xe3, 0xe0, + 0x3e, 0x3f, 0xb8, 0xfc, 0x7e, 0x7, 0x3, 0x81, + 0xc7, 0xe3, 0xbf, 0x8f, 0x80, /* U+64 "d" */ - 0x1, 0xc0, 0x70, 0x1c, 0xf7, 0x7f, 0xfc, 0xfe, - 0x1f, 0x87, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, - 0xcf, 0x70, + 0x3, 0x81, 0xc0, 0xe7, 0x77, 0xff, 0x1f, 0x8f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x77, 0xf9, 0xdc, /* U+65 "e" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xff, 0xff, 0xfe, - 0x3, 0x80, 0xf1, 0xdf, 0xe3, 0xf0, + 0x3e, 0x3f, 0xb8, 0xfc, 0x7f, 0xff, 0xff, 0x81, + 0xc0, 0xe3, 0xbf, 0x8f, 0x80, /* U+66 "f" */ - 0xf, 0xc7, 0xf1, 0xc0, 0x70, 0xff, 0xff, 0xf1, + 0xf, 0xc7, 0xf1, 0xc3, 0xff, 0xff, 0xc7, 0x1, 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0x1c, 0x7, 0x0, /* U+67 "g" */ - 0x3d, 0xdf, 0xff, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0xcf, 0x7f, 0xcf, 0x70, 0x1c, 0xf, 0x3f, - 0x8f, 0xc0, + 0x3b, 0xbf, 0xfd, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xf7, 0xbf, 0xce, 0xe0, 0x70, 0x39, 0xf8, + 0xf8, /* U+68 "h" */ - 0xe0, 0x70, 0x38, 0x1d, 0xcf, 0xf7, 0x9f, 0x8f, + 0xe0, 0x70, 0x38, 0x1d, 0xcf, 0xf7, 0x1f, 0x8f, 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1c, /* U+69 "i" */ - 0x1c, 0x7, 0x0, 0x0, 0x0, 0xfc, 0x3f, 0x1, - 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0x1c, + 0x8, 0x7, 0x0, 0x80, 0x0, 0xfe, 0x3f, 0x80, + 0xe0, 0x38, 0xe, 0x3, 0x80, 0xe0, 0x38, 0xe, 0x3f, 0xff, 0xfc, /* U+6A "j" */ - 0x7, 0x7, 0x0, 0x0, 0x7f, 0x7f, 0x7, 0x7, - 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0xf, - 0xfe, 0xfc, + 0x2, 0x7, 0x2, 0x0, 0x7f, 0x7f, 0x7, 0x7, + 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, 0x7, + 0xf, 0xfe, 0xfc, /* U+6B "k" */ - 0xe0, 0x38, 0xe, 0x3, 0x87, 0xe1, 0xb8, 0xee, - 0x33, 0x9c, 0xfe, 0x3f, 0x8e, 0x73, 0x8e, 0xe3, + 0xe0, 0x38, 0xe, 0x3, 0x87, 0xe3, 0xb8, 0xce, + 0x73, 0xf8, 0xfe, 0x39, 0xce, 0x73, 0x8e, 0xe1, 0xb8, 0x70, /* U+6C "l" */ 0xfe, 0x1f, 0xc0, 0x38, 0x7, 0x0, 0xe0, 0x1c, 0x3, 0x80, 0x70, 0xe, 0x1, 0xc0, 0x38, 0x7, - 0x0, 0xfe, 0xf, 0xc0, + 0x0, 0x7e, 0x7, 0xc0, /* U+6D "m" */ 0xd9, 0xbf, 0xfc, 0xcf, 0x33, 0xcc, 0xf3, 0x3c, 0xcf, 0x33, 0xcc, 0xf3, 0x3c, 0xcc, /* U+6E "n" */ - 0xee, 0x7f, 0xbc, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xee, 0x7f, 0xb8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, 0xc7, 0xe3, 0xf1, 0xf8, 0xe0, /* U+6F "o" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0x87, 0xf3, 0xdf, 0xe3, 0xf0, + 0x3e, 0x3f, 0xb8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xbf, 0x8f, 0x80, /* U+70 "p" */ - 0xef, 0x3f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0x87, 0xf3, 0xff, 0xee, 0xf3, 0x80, 0xe0, - 0x38, 0x0, + 0xee, 0x7f, 0xb8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xff, 0xbb, 0x9c, 0xe, 0x7, 0x3, + 0x80, /* U+71 "q" */ - 0x3d, 0xdf, 0xff, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, - 0x1f, 0x87, 0xf3, 0xdf, 0xf3, 0xdc, 0x7, 0x1, - 0xc0, 0x70, + 0x3b, 0xbf, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xbf, 0xce, 0xe0, 0x70, 0x38, 0x1c, + 0xe, /* U+72 "r" */ - 0xef, 0x3f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0xe, - 0x3, 0x80, 0xe0, 0x38, 0xe, 0x0, + 0xee, 0x7f, 0xbc, 0xfc, 0x7e, 0x3f, 0x3, 0x81, + 0xc0, 0xe0, 0x70, 0x38, 0x0, /* U+73 "s" */ - 0x3f, 0x3f, 0xee, 0x1f, 0x80, 0xfc, 0x1f, 0xe0, - 0x3c, 0x7, 0xe1, 0xff, 0xe3, 0xf0, + 0x1f, 0x1f, 0xe7, 0x1d, 0xc0, 0x7c, 0xf, 0xe0, + 0x3c, 0x7, 0x71, 0xdf, 0xe3, 0xf0, /* U+74 "t" */ 0x1c, 0x7, 0x1, 0xc3, 0xff, 0xff, 0xc7, 0x1, - 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0xf, - 0xc1, 0xf0, + 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0x1f, + 0xc3, 0xf0, /* U+75 "u" */ 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, 0xc7, 0xe3, 0xbf, 0x8f, 0x80, /* U+76 "v" */ - 0xc0, 0xf8, 0x76, 0x19, 0x86, 0x73, 0x8c, 0xc3, + 0xe1, 0xf8, 0x76, 0x19, 0x86, 0x73, 0x8c, 0xc3, 0x30, 0xfc, 0x1e, 0x7, 0x81, 0xe0, /* U+77 "w" */ - 0xc6, 0x79, 0xcf, 0x39, 0xb5, 0x36, 0xa6, 0xd6, - 0xda, 0xdb, 0x4e, 0x79, 0xcf, 0x38, 0xc7, 0x0, + 0xe6, 0x36, 0x66, 0x66, 0x66, 0xf6, 0x6f, 0x66, + 0x96, 0x69, 0x62, 0x94, 0x39, 0xc3, 0x9c, 0x39, + 0xc0, /* U+78 "x" */ 0xe1, 0xdc, 0xe3, 0x30, 0xfc, 0x1e, 0x7, 0x81, - 0xe0, 0xfc, 0x73, 0x9c, 0x6e, 0x1c, + 0xe0, 0xfc, 0x73, 0x9c, 0xee, 0x1c, /* U+79 "y" */ - 0xe1, 0xf8, 0x76, 0x19, 0xce, 0x33, 0x8e, 0xc3, - 0xf0, 0x7c, 0x1e, 0x3, 0x80, 0xc0, 0x70, 0x1c, - 0x6, 0x0, + 0xe1, 0xf8, 0x76, 0x19, 0xce, 0x33, 0x8c, 0xc3, + 0xf0, 0x7c, 0x1e, 0x7, 0x80, 0xe0, 0x30, 0x1c, + 0x7, 0x1, 0x80, /* U+7A "z" */ - 0xff, 0xff, 0xc1, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, + 0xff, 0xff, 0xc0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0x7f, 0xff, 0xe0, /* U+7B "{" */ - 0x7, 0x87, 0xc3, 0x81, 0xc0, 0xe0, 0x70, 0x38, + 0x3, 0x87, 0xc3, 0x81, 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0xfc, 0x7e, 0x3, 0x81, 0xc0, 0xe0, 0x70, - 0x38, 0x1c, 0xf, 0x83, 0xc0, + 0x38, 0x1c, 0x7, 0x81, 0xc0, /* U+7C "|" */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, /* U+7D "}" */ - 0xf0, 0x3f, 0x1, 0xc0, 0x70, 0x1c, 0x7, 0x1, + 0xf0, 0x3e, 0x1, 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0xf, 0xc3, 0xf1, 0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0xf8, 0x3c, 0x0, /* U+7E "~" */ - 0x78, 0xff, 0x3c, 0xff, 0x1e, + 0x78, 0xff, 0x3c, 0xcf, 0x3f, 0xc7, 0x80, + + /* U+410 "А" */ + 0x1e, 0x7, 0x81, 0xe0, 0xfc, 0x3f, 0xc, 0xc3, + 0x31, 0xce, 0x73, 0x9f, 0xe7, 0xfb, 0x87, 0xe1, + 0xf0, 0x30, + + /* U+411 "Б" */ + 0xff, 0xbf, 0xee, 0x3, 0x80, 0xe0, 0x3f, 0xcf, + 0xfb, 0x8f, 0xe1, 0xf8, 0x7e, 0x1f, 0x8f, 0xff, + 0xbf, 0x80, + + /* U+412 "В" */ + 0xfe, 0x3f, 0xce, 0x3b, 0x8e, 0xe3, 0xb8, 0xcf, + 0xe3, 0xfc, 0xe3, 0xb8, 0x7e, 0x1f, 0x8f, 0xff, + 0xbf, 0xc0, + + /* U+413 "Г" */ + 0xff, 0xff, 0xf8, 0x1c, 0xe, 0x7, 0x3, 0x81, + 0xc0, 0xe0, 0x70, 0x38, 0x1c, 0xe, 0x7, 0x0, + + /* U+414 "Д" */ + 0x3f, 0xc7, 0xf8, 0xe7, 0x1c, 0xe3, 0x9c, 0x73, + 0x8e, 0x71, 0xce, 0x39, 0xc7, 0x38, 0xe7, 0x38, + 0xef, 0xff, 0xff, 0xf8, 0x3f, 0x7, 0xe0, 0xe0, + + /* U+415 "Е" */ + 0xff, 0xff, 0xf8, 0x1c, 0xe, 0x7, 0x3, 0xfd, + 0xfe, 0xe0, 0x70, 0x38, 0x1c, 0xf, 0xff, 0xfc, + + /* U+416 "Ж" */ + 0xe6, 0x76, 0x66, 0x66, 0x67, 0x66, 0x36, 0xc3, + 0x6c, 0x3f, 0xc3, 0x6c, 0x36, 0xc7, 0x6e, 0x66, + 0x66, 0x66, 0x66, 0x6c, 0x63, + + /* U+417 "З" */ + 0x1f, 0x8f, 0xfd, 0xc7, 0x80, 0x70, 0x1c, 0x3e, + 0x7, 0xf0, 0xf, 0x0, 0xe0, 0x1d, 0x83, 0xb8, + 0xf7, 0xfc, 0x3e, 0x0, + + /* U+418 "И" */ + 0xe7, 0xf3, 0xf9, 0xfc, 0xfe, 0xff, 0x7f, 0xaf, + 0xd7, 0xfb, 0xfd, 0xfc, 0xfe, 0x7f, 0x3f, 0x9c, + + /* U+419 "Й" */ + 0x63, 0x3b, 0x8f, 0x83, 0x80, 0x7, 0x3f, 0x9f, + 0xcf, 0xe7, 0xf7, 0xfb, 0xfd, 0x7e, 0xbf, 0xdf, + 0xef, 0xe7, 0xf3, 0xf9, 0xfc, 0xe0, + + /* U+41A "К" */ + 0xe1, 0xf8, 0x7e, 0x3b, 0x8e, 0xe7, 0x39, 0xcf, + 0xe3, 0xf8, 0xe7, 0x39, 0xce, 0x3b, 0x8e, 0xe1, + 0xf8, 0x70, + + /* U+41B "Л" */ + 0x3f, 0xcf, 0xf3, 0x9c, 0xe7, 0x39, 0xce, 0x73, + 0x9c, 0xe7, 0x39, 0xce, 0x73, 0x9d, 0xe7, 0xf1, + 0xf8, 0x70, + + /* U+41C "М" */ + 0xf3, 0xfc, 0xfd, 0x2f, 0xcf, 0xff, 0xff, 0xfe, + 0xdf, 0xb7, 0xe1, 0xf8, 0x7e, 0x1f, 0x87, 0xe1, + 0xf8, 0x70, + + /* U+41D "Н" */ + 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0xff, + 0xff, 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1c, + + /* U+41E "О" */ + 0x3e, 0x3f, 0xb8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x77, 0xf1, 0xf0, + + /* U+41F "П" */ + 0xff, 0xff, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1c, + + /* U+420 "Р" */ + 0xff, 0x3f, 0xee, 0x3f, 0x87, 0xe1, 0xf8, 0xff, + 0xfb, 0xfc, 0xe0, 0x38, 0xe, 0x3, 0x80, 0xe0, + 0x38, 0x0, + + /* U+421 "С" */ + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe0, 0x38, 0xe, + 0x3, 0x80, 0xe0, 0x38, 0xe, 0x1f, 0xcf, 0x7f, + 0x8f, 0xc0, + + /* U+422 "Т" */ + 0xff, 0xff, 0xf0, 0xe0, 0x38, 0xe, 0x3, 0x80, + 0xe0, 0x38, 0xe, 0x3, 0x80, 0xe0, 0x38, 0xe, + 0x3, 0x80, + + /* U+423 "У" */ + 0xe1, 0xf8, 0x76, 0x19, 0xce, 0x33, 0x8c, 0xc3, + 0xb0, 0x7c, 0x1e, 0x3, 0x80, 0xc0, 0x70, 0x1c, + 0x6, 0x0, + + /* U+424 "Ф" */ + 0xc, 0xf, 0xc7, 0xfb, 0xb7, 0xcc, 0xf3, 0x3c, + 0xcf, 0x33, 0xcc, 0xf3, 0x3c, 0xcf, 0xb7, 0x7f, + 0x8f, 0xc0, 0xc0, 0x30, + + /* U+425 "Х" */ + 0xe1, 0xd8, 0x67, 0x38, 0xcc, 0x3f, 0x7, 0x81, + 0xe0, 0x78, 0x1e, 0xf, 0xc3, 0x31, 0xce, 0xe1, + 0xf8, 0x70, + + /* U+426 "Ц" */ + 0xe3, 0xb8, 0xee, 0x3b, 0x8e, 0xe3, 0xb8, 0xee, + 0x3b, 0x8e, 0xe3, 0xb8, 0xee, 0x3b, 0x8e, 0xff, + 0xff, 0xf0, 0x1c, 0x7, 0x1, 0xc0, + + /* U+427 "Ч" */ + 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0xce, + 0xff, 0x3f, 0x81, 0xc0, 0xe0, 0x70, 0x38, 0x1c, + + /* U+428 "Ш" */ + 0xcc, 0xf3, 0x3c, 0xcf, 0x33, 0xcc, 0xf3, 0x3c, + 0xcf, 0x33, 0xcc, 0xf3, 0x3c, 0xcf, 0x33, 0xff, + 0xff, 0xf0, + + /* U+429 "Щ" */ + 0xcc, 0xd9, 0x9b, 0x33, 0x66, 0x6c, 0xcd, 0x99, + 0xb3, 0x36, 0x66, 0xcc, 0xd9, 0x9b, 0x33, 0x66, + 0x6f, 0xff, 0xff, 0xc0, 0x18, 0x3, + + /* U+42A "Ъ" */ + 0xfc, 0xf, 0xc0, 0x1c, 0x1, 0xc0, 0x1c, 0x1, + 0xfc, 0x1f, 0xe1, 0xcf, 0x1c, 0x71, 0xc7, 0x1c, + 0x71, 0xcf, 0x1f, 0xe1, 0xf8, + + /* U+42B "Ы" */ + 0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xc0, 0xfe, 0x3f, + 0xcf, 0x3b, 0xc6, 0xf1, 0xbc, 0x6f, 0x3b, 0xfc, + 0xfe, 0x30, + + /* U+42C "Ь" */ + 0xe0, 0x38, 0xe, 0x3, 0x80, 0xe0, 0x3f, 0xcf, + 0xfb, 0x8f, 0xe1, 0xf8, 0x7e, 0x1f, 0x8f, 0xff, + 0xbf, 0x80, + + /* U+42D "Э" */ + 0x3e, 0x3f, 0xb8, 0xfc, 0x70, 0x38, 0x1c, 0x7e, + 0x3f, 0x3, 0x81, 0xf8, 0xfc, 0x77, 0xf1, 0xf0, + + /* U+42E "Ю" */ + 0xc7, 0xb3, 0xfc, 0xcf, 0x33, 0xcc, 0xf3, 0x3f, + 0xcf, 0xf3, 0xcc, 0xf3, 0x3c, 0xcf, 0x33, 0xcf, + 0xf1, 0xe0, + + /* U+42F "Я" */ + 0x3f, 0xdf, 0xff, 0x1f, 0x87, 0xe1, 0xfc, 0x77, + 0xfc, 0xff, 0x39, 0xce, 0x77, 0x1d, 0xc7, 0x71, + 0xf8, 0x70, + + /* U+430 "а" */ + 0x1f, 0x1f, 0xe7, 0x1c, 0x7, 0x3f, 0xdf, 0xfe, + 0x1f, 0x87, 0xe3, 0xff, 0xf3, 0xdc, + + /* U+431 "б" */ + 0x1f, 0x3f, 0x9c, 0x1c, 0xe, 0xe7, 0xfb, 0x8f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xfc, 0x77, 0xf1, 0xf0, + + /* U+432 "в" */ + 0xfe, 0x7f, 0xb8, 0xfc, 0x7e, 0x3f, 0xf3, 0xfd, + 0xc7, 0xe3, 0xff, 0xff, 0x80, + + /* U+433 "г" */ + 0xff, 0xff, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, + 0xe0, 0xe0, 0xe0, + + /* U+434 "д" */ + 0x3f, 0xc7, 0xf8, 0xe7, 0x1c, 0xe3, 0x9c, 0x73, + 0x8e, 0x71, 0xce, 0x71, 0xdf, 0xff, 0xff, 0xf0, + 0x7e, 0xf, 0xc1, 0xc0, + + /* U+435 "е" */ + 0x3e, 0x3f, 0xb8, 0xfc, 0x7f, 0xff, 0xff, 0x81, + 0xc0, 0xe3, 0xbf, 0x8f, 0x80, + + /* U+436 "ж" */ + 0xe6, 0x76, 0x66, 0x66, 0x63, 0x6c, 0x36, 0xc3, + 0xfc, 0x36, 0xc3, 0x6c, 0x66, 0x66, 0x66, 0xe6, + 0x70, + + /* U+437 "з" */ + 0x3f, 0x1f, 0xfe, 0x1c, 0x7, 0x1f, 0x7, 0xe0, + 0x1c, 0x7, 0xe1, 0xdf, 0xe3, 0xf0, + + /* U+438 "и" */ + 0xc3, 0xe3, 0xf1, 0xf9, 0xfc, 0xde, 0xef, 0x67, + 0xb3, 0xf1, 0xf8, 0xf8, 0x60, + + /* U+439 "й" */ + 0x63, 0x31, 0x8f, 0x83, 0x80, 0x6, 0x1f, 0x1f, + 0x8f, 0xcf, 0xe6, 0xf7, 0x7b, 0x3f, 0x9f, 0x8f, + 0xc7, 0xc3, + + /* U+43A "к" */ + 0xe1, 0xf8, 0xee, 0x33, 0x9c, 0xfe, 0x3f, 0x8e, + 0x73, 0x9c, 0xe3, 0xb8, 0x6e, 0x1c, + + /* U+43B "л" */ + 0x3f, 0xcf, 0xf3, 0x9c, 0xe7, 0x39, 0xce, 0x73, + 0x9c, 0xe7, 0x39, 0xfc, 0x7e, 0x1c, + + /* U+43C "м" */ + 0xe1, 0xf8, 0x7f, 0x3f, 0xcf, 0xda, 0xf7, 0xbd, + 0xef, 0x33, 0xc0, 0xf0, 0x3c, 0xc, + + /* U+43D "н" */ + 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3f, 0xff, 0xff, + 0xc7, 0xe3, 0xf1, 0xf8, 0xe0, + + /* U+43E "о" */ + 0x3e, 0x3f, 0xb8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xbf, 0x8f, 0x80, + + /* U+43F "п" */ + 0xff, 0xff, 0xf8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xf1, 0xf8, 0xe0, + + /* U+440 "р" */ + 0xee, 0x7f, 0xb8, 0xfc, 0x7e, 0x3f, 0x1f, 0x8f, + 0xc7, 0xe3, 0xff, 0xbb, 0x9c, 0xe, 0x7, 0x3, + 0x80, + + /* U+441 "с" */ + 0x3e, 0x3f, 0xb8, 0xfc, 0x7e, 0x7, 0x3, 0x81, + 0xc7, 0xe3, 0xbf, 0x8f, 0x80, + + /* U+442 "т" */ + 0xff, 0xff, 0xf0, 0xe0, 0x38, 0xe, 0x3, 0x80, + 0xe0, 0x38, 0xe, 0x3, 0x80, 0xe0, + + /* U+443 "у" */ + 0xe1, 0xf8, 0x76, 0x19, 0xce, 0x33, 0x8c, 0xc3, + 0xf0, 0x7c, 0x1e, 0x7, 0x80, 0xe0, 0x30, 0x1c, + 0x7, 0x1, 0x80, + + /* U+444 "ф" */ + 0xc, 0x3, 0x0, 0xc0, 0xfc, 0x7f, 0xbb, 0x7c, + 0xcf, 0x33, 0xcc, 0xf3, 0x3c, 0xcf, 0xb7, 0x7f, + 0x8f, 0xc0, 0xc0, 0x30, 0xc, 0x3, 0x0, + + /* U+445 "х" */ + 0xe1, 0xdc, 0xe3, 0x30, 0xfc, 0x1e, 0x7, 0x81, + 0xe0, 0xfc, 0x73, 0x9c, 0xee, 0x1c, + + /* U+446 "ц" */ + 0xe3, 0xb8, 0xee, 0x3b, 0x8e, 0xe3, 0xb8, 0xee, + 0x3b, 0x8e, 0xe3, 0xbf, 0xff, 0xfc, 0x7, 0x1, + 0xc0, 0x70, + + /* U+447 "ч" */ + 0xe3, 0xf1, 0xf8, 0xfc, 0x7e, 0x3b, 0xfc, 0xfe, + 0x7, 0x3, 0x81, 0xc0, 0xe0, + + /* U+448 "ш" */ + 0xcc, 0xf3, 0x3c, 0xcf, 0x33, 0xcc, 0xf3, 0x3c, + 0xcf, 0x33, 0xcc, 0xff, 0xff, 0xfc, + + /* U+449 "щ" */ + 0xcc, 0xd9, 0x9b, 0x33, 0x66, 0x6c, 0xcd, 0x99, + 0xb3, 0x36, 0x66, 0xcc, 0xdf, 0xff, 0xff, 0x80, + 0x30, 0x6, + + /* U+44A "ъ" */ + 0xfc, 0xf, 0xc0, 0x1c, 0x1, 0xc0, 0x1f, 0xc1, + 0xfe, 0x1c, 0x71, 0xc7, 0x1c, 0x71, 0xfe, 0x1f, + 0xc0, + + /* U+44B "ы" */ + 0xc0, 0xf0, 0x3c, 0xf, 0x3, 0xf8, 0xff, 0x3c, + 0x6f, 0x1b, 0xc6, 0xff, 0x3f, 0x8c, + + /* U+44C "ь" */ + 0xe0, 0x38, 0xe, 0x3, 0x80, 0xff, 0x3f, 0xee, + 0x1f, 0x87, 0xe1, 0xff, 0xef, 0xf0, + + /* U+44D "э" */ + 0x3e, 0x3f, 0xb8, 0xe0, 0x70, 0xf8, 0x7c, 0xf, + 0xc7, 0xe7, 0xbf, 0x8f, 0x80, + + /* U+44E "ю" */ + 0xc7, 0xb3, 0xfc, 0xcf, 0x33, 0xcc, 0xff, 0x3f, + 0xcf, 0x33, 0xcc, 0xf3, 0xfc, 0x78, + + /* U+44F "я" */ + 0x3f, 0xbf, 0xf8, 0xfc, 0x7e, 0x3f, 0xfd, 0xfe, + 0x77, 0x73, 0xb9, 0xf8, 0xe0, /* U+F001 "" */ 0x0, 0x0, 0x70, 0x0, 0x7f, 0x0, 0x3f, 0xf0, @@ -592,122 +879,186 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 7, .adv_w = 192, .box_w = 7, .box_h = 6, .ofs_x = 3, .ofs_y = 8}, {.bitmap_index = 13, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, {.bitmap_index = 33, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 57, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 77, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 97, .adv_w = 192, .box_w = 3, .box_h = 6, .ofs_x = 5, .ofs_y = 8}, - {.bitmap_index = 100, .adv_w = 192, .box_w = 7, .box_h = 19, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 117, .adv_w = 192, .box_w = 7, .box_h = 19, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 134, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = 1}, - {.bitmap_index = 147, .adv_w = 192, .box_w = 10, .box_h = 9, .ofs_x = 1, .ofs_y = 2}, - {.bitmap_index = 159, .adv_w = 192, .box_w = 5, .box_h = 6, .ofs_x = 3, .ofs_y = -3}, - {.bitmap_index = 163, .adv_w = 192, .box_w = 8, .box_h = 2, .ofs_x = 2, .ofs_y = 5}, - {.bitmap_index = 165, .adv_w = 192, .box_w = 4, .box_h = 4, .ofs_x = 4, .ofs_y = 0}, - {.bitmap_index = 167, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 191, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 209, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 225, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 57, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 78, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 98, .adv_w = 192, .box_w = 3, .box_h = 6, .ofs_x = 5, .ofs_y = 8}, + {.bitmap_index = 101, .adv_w = 192, .box_w = 7, .box_h = 19, .ofs_x = 3, .ofs_y = -2}, + {.bitmap_index = 118, .adv_w = 192, .box_w = 7, .box_h = 19, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 135, .adv_w = 192, .box_w = 10, .box_h = 10, .ofs_x = 1, .ofs_y = 1}, + {.bitmap_index = 148, .adv_w = 192, .box_w = 10, .box_h = 9, .ofs_x = 1, .ofs_y = 2}, + {.bitmap_index = 160, .adv_w = 192, .box_w = 5, .box_h = 6, .ofs_x = 3, .ofs_y = -4}, + {.bitmap_index = 164, .adv_w = 192, .box_w = 9, .box_h = 2, .ofs_x = 2, .ofs_y = 5}, + {.bitmap_index = 167, .adv_w = 192, .box_w = 4, .box_h = 3, .ofs_x = 4, .ofs_y = 0}, + {.bitmap_index = 169, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 193, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 211, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 227, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, {.bitmap_index = 243, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, {.bitmap_index = 261, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 277, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 293, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 311, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 329, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 347, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 365, .adv_w = 192, .box_w = 3, .box_h = 11, .ofs_x = 4, .ofs_y = 0}, - {.bitmap_index = 370, .adv_w = 192, .box_w = 5, .box_h = 14, .ofs_x = 3, .ofs_y = -3}, - {.bitmap_index = 379, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 1}, - {.bitmap_index = 392, .adv_w = 192, .box_w = 9, .box_h = 7, .ofs_x = 2, .ofs_y = 3}, - {.bitmap_index = 400, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 1}, - {.bitmap_index = 413, .adv_w = 192, .box_w = 8, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 427, .adv_w = 192, .box_w = 11, .box_h = 17, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 451, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 472, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 490, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 508, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 277, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 295, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 313, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 331, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 349, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 367, .adv_w = 192, .box_w = 4, .box_h = 11, .ofs_x = 4, .ofs_y = 0}, + {.bitmap_index = 373, .adv_w = 192, .box_w = 5, .box_h = 15, .ofs_x = 3, .ofs_y = -4}, + {.bitmap_index = 383, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 1}, + {.bitmap_index = 396, .adv_w = 192, .box_w = 9, .box_h = 7, .ofs_x = 2, .ofs_y = 3}, + {.bitmap_index = 404, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 1}, + {.bitmap_index = 417, .adv_w = 192, .box_w = 8, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 431, .adv_w = 192, .box_w = 11, .box_h = 18, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 456, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 474, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 492, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 510, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, {.bitmap_index = 526, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, {.bitmap_index = 542, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, {.bitmap_index = 558, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 576, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 592, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 608, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 626, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 646, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 662, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 680, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 696, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 714, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 732, .adv_w = 192, .box_w = 10, .box_h = 17, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 754, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 772, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 790, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 808, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 824, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 845, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 865, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 883, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 903, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 919, .adv_w = 192, .box_w = 6, .box_h = 18, .ofs_x = 4, .ofs_y = -2}, - {.bitmap_index = 933, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 957, .adv_w = 192, .box_w = 6, .box_h = 18, .ofs_x = 3, .ofs_y = -2}, - {.bitmap_index = 971, .adv_w = 192, .box_w = 10, .box_h = 8, .ofs_x = 1, .ofs_y = 6}, - {.bitmap_index = 981, .adv_w = 192, .box_w = 10, .box_h = 2, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 984, .adv_w = 192, .box_w = 5, .box_h = 3, .ofs_x = 3, .ofs_y = 13}, - {.bitmap_index = 986, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1000, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1018, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1032, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1050, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1064, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1082, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 1100, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1116, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1135, .adv_w = 192, .box_w = 8, .box_h = 18, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 1153, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1171, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1191, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1205, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1218, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1232, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 1250, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 1268, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1282, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1296, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1314, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1327, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1341, .adv_w = 192, .box_w = 11, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 1357, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, - {.bitmap_index = 1371, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 1389, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, - {.bitmap_index = 1402, .adv_w = 192, .box_w = 9, .box_h = 18, .ofs_x = 2, .ofs_y = -2}, - {.bitmap_index = 1423, .adv_w = 192, .box_w = 3, .box_h = 18, .ofs_x = 5, .ofs_y = -2}, - {.bitmap_index = 1430, .adv_w = 192, .box_w = 10, .box_h = 18, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 1453, .adv_w = 192, .box_w = 10, .box_h = 4, .ofs_x = 1, .ofs_y = 5}, - {.bitmap_index = 1458, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 1508, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 1556, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 1599, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 1647, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1666, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 1716, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1752, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 1800, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 1843, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1881, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1919, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1957, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 1995, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 2033, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 2071, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 2100, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 2149, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 2209, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3} + {.bitmap_index = 576, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 592, .adv_w = 192, .box_w = 8, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 606, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 624, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 642, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 658, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 676, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 692, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 708, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 726, .adv_w = 192, .box_w = 10, .box_h = 18, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 749, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 767, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 785, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 803, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 819, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 837, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 857, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 875, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 895, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 911, .adv_w = 192, .box_w = 6, .box_h = 18, .ofs_x = 4, .ofs_y = -2}, + {.bitmap_index = 925, .adv_w = 192, .box_w = 10, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 949, .adv_w = 192, .box_w = 6, .box_h = 18, .ofs_x = 3, .ofs_y = -2}, + {.bitmap_index = 963, .adv_w = 192, .box_w = 10, .box_h = 8, .ofs_x = 1, .ofs_y = 7}, + {.bitmap_index = 973, .adv_w = 192, .box_w = 10, .box_h = 2, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 976, .adv_w = 192, .box_w = 5, .box_h = 3, .ofs_x = 3, .ofs_y = 13}, + {.bitmap_index = 978, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 992, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1008, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1021, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1037, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1050, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1068, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 1085, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1101, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1120, .adv_w = 192, .box_w = 8, .box_h = 19, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 1139, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1157, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1177, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1191, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1204, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1217, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 2, .ofs_y = -4}, + {.bitmap_index = 1234, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 1251, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1264, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1278, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1296, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1309, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1323, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1340, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1354, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 1373, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1386, .adv_w = 192, .box_w = 9, .box_h = 18, .ofs_x = 2, .ofs_y = -2}, + {.bitmap_index = 1407, .adv_w = 192, .box_w = 3, .box_h = 18, .ofs_x = 5, .ofs_y = -2}, + {.bitmap_index = 1414, .adv_w = 192, .box_w = 10, .box_h = 18, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 1437, .adv_w = 192, .box_w = 10, .box_h = 5, .ofs_x = 1, .ofs_y = 5}, + {.bitmap_index = 1444, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1462, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1480, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1498, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1514, .adv_w = 192, .box_w = 11, .box_h = 17, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 1538, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1554, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1575, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1595, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1611, .adv_w = 192, .box_w = 9, .box_h = 19, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1633, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1651, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1669, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1687, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1703, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1719, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1735, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1753, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1771, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1789, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1807, .adv_w = 192, .box_w = 10, .box_h = 16, .ofs_x = 1, .ofs_y = -1}, + {.bitmap_index = 1827, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1845, .adv_w = 192, .box_w = 10, .box_h = 17, .ofs_x = 2, .ofs_y = -3}, + {.bitmap_index = 1867, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1883, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1901, .adv_w = 192, .box_w = 11, .box_h = 16, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 1923, .adv_w = 192, .box_w = 12, .box_h = 14, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 1944, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1962, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 1980, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 1996, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2014, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2032, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2046, .adv_w = 192, .box_w = 9, .box_h = 14, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2062, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2075, .adv_w = 192, .box_w = 8, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2086, .adv_w = 192, .box_w = 11, .box_h = 14, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 2106, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2119, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2136, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2150, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2163, .adv_w = 192, .box_w = 9, .box_h = 16, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2181, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2195, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2209, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2223, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2236, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2249, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2262, .adv_w = 192, .box_w = 9, .box_h = 15, .ofs_x = 2, .ofs_y = -4}, + {.bitmap_index = 2279, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2292, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2306, .adv_w = 192, .box_w = 10, .box_h = 15, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 2325, .adv_w = 192, .box_w = 10, .box_h = 18, .ofs_x = 1, .ofs_y = -4}, + {.bitmap_index = 2348, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2362, .adv_w = 192, .box_w = 10, .box_h = 14, .ofs_x = 2, .ofs_y = -3}, + {.bitmap_index = 2380, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2393, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2407, .adv_w = 192, .box_w = 11, .box_h = 13, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 2425, .adv_w = 192, .box_w = 12, .box_h = 11, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 2442, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2456, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 2, .ofs_y = 0}, + {.bitmap_index = 2470, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2483, .adv_w = 192, .box_w = 10, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2497, .adv_w = 192, .box_w = 9, .box_h = 11, .ofs_x = 1, .ofs_y = 0}, + {.bitmap_index = 2510, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 2560, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 2608, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2651, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 2699, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 2718, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 2768, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 2804, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 2852, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 2895, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 2933, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 2971, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3009, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3047, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3085, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 3123, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3152, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3201, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3261, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3} }; /*--------------------- * CHARACTER MAPPING *--------------------*/ -static const uint16_t unicode_list_1[] = { +static const uint16_t unicode_list_2[] = { 0x0, 0x16, 0x39, 0x68, 0x128, 0x184, 0x1e5, 0x1fb, 0x21d, 0x23f, 0x240, 0x241, 0x242, 0x243, 0x292, 0x293, 0x3fc, 0x54a, 0x55f @@ -721,8 +1072,12 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY }, { - .range_start = 61441, .range_length = 1376, .glyph_id_start = 96, - .unicode_list = unicode_list_1, .glyph_id_ofs_list = NULL, .list_length = 19, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + .range_start = 1040, .range_length = 64, .glyph_id_start = 96, + .unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY + }, + { + .range_start = 61441, .range_length = 1376, .glyph_id_start = 160, + .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 19, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY } }; @@ -739,7 +1094,7 @@ static lv_font_fmt_txt_dsc_t font_dsc = { .cmaps = cmaps, .kern_dsc = NULL, .kern_scale = 0, - .cmap_num = 2, + .cmap_num = 3, .bpp = 1, .kern_classes = 0, .bitmap_format = 0 @@ -754,13 +1109,19 @@ static lv_font_fmt_txt_dsc_t font_dsc = { lv_font_t jetbrains_mono_bold_20 = { .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ - .line_height = 21, /*The maximum line height required by the font*/ - .base_line = 3, /*Baseline measured from the bottom of the line*/ + .line_height = 23, /*The maximum line height required by the font*/ + .base_line = 4, /*Baseline measured from the bottom of the line*/ #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif +#if LV_VERSION_CHECK(7, 4, 0) + .underline_position = -2, + .underline_thickness = 1, +#endif .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; + + #endif /*#if JETBRAINS_MONO_BOLD_20*/ -- cgit v0.10.2 From c25fd2e37f09ab2b623bae510d6258c9075fe844 Mon Sep 17 00:00:00 2001 From: Ilia Zarubin Date: Sat, 7 Nov 2020 23:42:19 +0300 Subject: fonts: readme: add cyrillic symbols UTF-8 range diff --git a/src/displayapp/fonts/Readme.md b/src/displayapp/fonts/Readme.md index 7ebf2e2..a5eec64 100644 --- a/src/displayapp/fonts/Readme.md +++ b/src/displayapp/fonts/Readme.md @@ -9,7 +9,7 @@ * Size : 20 * Bpp : 1 bit-per-pixel * Do not enable font compression and horizontal subpixel hinting - * Load the file `JetBrainsMono-Bold.woff` and specify the following range : `0x20-0x7f` + * Load the file `JetBrainsMono-Bold.woff` and specify the following range : `0x20-0x7f, 0x410-0x44f` * Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc` * Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts` -- cgit v0.10.2 From 540089954a0d52ea1b9861a77857c13d839f8ffc Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Mon, 9 Nov 2020 20:01:03 +1000 Subject: Fix companion app documentation links broken during #68 diff --git a/README.md b/README.md index a3a589f..1f522b1 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,9 @@ As of now, here is the list of achievements of this project: - [Memory analysis](./doc/MemoryAnalysis.md) ### Using the firmware - - [Integration with Gadgetbridge](doc/CompanionApps/Gadgetbridge.md) - - [Integration with AmazFish](doc/CompanionApps/Amazfish.md) - - [Firmware update, OTA](doc/CompanionApps/NrfconnectOTA.md) + - [Integration with Gadgetbridge](doc/companionapps/Gadgetbridge.md) + - [Integration with AmazFish](doc/companionapps/Amazfish.md) + - [Firmware update, OTA](doc/companionapps/NrfconnectOTA.md) ## TODO - contribute -- cgit v0.10.2 From 3c7258ddb8e22f98f144cfc9683445aca3132ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Ord=C3=B3=C3=B1ez=20Moya?= Date: Sat, 14 Nov 2020 23:10:05 +0100 Subject: Update main.yml When installing Cmake you get Error: The add-path command is deprecated and will be disabled on November 16th... And the file pinetime-mcuboot-app-dfu.zip was being generated as pinetime-mcuboot-app-dfu.zip.zip diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6768146..81926a9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,7 +30,7 @@ jobs: # Download and Cache Dependencies - name: Install cmake - uses: lukka/get-cmake@v3.18.0 + uses: lukka/get-cmake@v3.18.3 - name: Check cache for Embedded Arm Toolchain arm-none-eabi-gcc id: cache-toolchain @@ -142,7 +142,7 @@ jobs: - name: Upload DFU package uses: actions/upload-artifact@v2 with: - name: pinetime-mcuboot-app-dfu.zip + name: pinetime-mcuboot-app-dfu path: build/src/pinetime-mcuboot-app-dfu/* ######################################################################################### @@ -168,4 +168,4 @@ jobs: find . -name "pinetime-mcuboot-app.*" -ls # Embedded Arm Toolchain and nRF5 SDK will only be cached if the build succeeds. -# So make sure that the first build always succeeds, e.g. comment out the "Make" step. \ No newline at end of file +# So make sure that the first build always succeeds, e.g. comment out the "Make" step. -- cgit v0.10.2 From a30282bdd51aace465fa9b5b09759b99dba512d9 Mon Sep 17 00:00:00 2001 From: Ryan Hartlage Date: Sat, 14 Nov 2020 19:23:16 -0500 Subject: Flash the correct file when running FLASH_pinetime-app with JLink diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6c9ce24..254fabc 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -713,7 +713,7 @@ if (USE_JLINK) ) add_custom_target("FLASH_${EXECUTABLE_NAME}" DEPENDS ${EXECUTABLE_NAME} - COMMAND ${NRFJPROG} --program ${EXECUTABLE_NAME}.hex -f ${NRF_TARGET} --sectorerase + COMMAND ${NRFJPROG} --program ${EXECUTABLE_FILE_NAME}.hex -f ${NRF_TARGET} --sectorerase COMMAND sleep 0.5s COMMAND ${NRFJPROG} --reset -f ${NRF_TARGET} COMMENT "flashing ${EXECUTABLE_NAME}.hex" -- cgit v0.10.2 From c3475b92fad2eff4b2a43e5343863d11fe4caca3 Mon Sep 17 00:00:00 2001 From: okaestne Date: Sun, 15 Nov 2020 05:04:22 +0100 Subject: Include cleanup: drivers diff --git a/src/drivers/BufferProvider.h b/src/drivers/BufferProvider.h index 50fa253..1be4317 100644 --- a/src/drivers/BufferProvider.h +++ b/src/drivers/BufferProvider.h @@ -1,5 +1,6 @@ #pragma once #include +#include namespace Pinetime { namespace Drivers { diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index 94db3b3..e703b73 100644 --- a/src/drivers/Cst816s.cpp +++ b/src/drivers/Cst816s.cpp @@ -1,8 +1,9 @@ +#include "Cst816s.h" #include -#include -#include #include -#include "Cst816s.h" +#include +#include + using namespace Pinetime::Drivers; /* References : diff --git a/src/drivers/Cst816s.h b/src/drivers/Cst816s.h index 4569e82..b7876b8 100644 --- a/src/drivers/Cst816s.h +++ b/src/drivers/Cst816s.h @@ -1,6 +1,5 @@ #pragma once -#include #include "TwiMaster.h" namespace Pinetime { diff --git a/src/drivers/DebugPins.cpp b/src/drivers/DebugPins.cpp index 5a12fd8..8457ba5 100644 --- a/src/drivers/DebugPins.cpp +++ b/src/drivers/DebugPins.cpp @@ -1,5 +1,5 @@ -#include #include "DebugPins.h" +#include #ifdef USE_DEBUG_PINS void debugpins_init() { diff --git a/src/drivers/InternalFlash.cpp b/src/drivers/InternalFlash.cpp index db705d7..33c1447 100644 --- a/src/drivers/InternalFlash.cpp +++ b/src/drivers/InternalFlash.cpp @@ -1,5 +1,5 @@ -#include #include "InternalFlash.h" +#include using namespace Pinetime::Drivers; void InternalFlash::ErasePage(uint32_t address) { diff --git a/src/drivers/Spi.cpp b/src/drivers/Spi.cpp index 2d8aa3b..0e7de4d 100644 --- a/src/drivers/Spi.cpp +++ b/src/drivers/Spi.cpp @@ -1,6 +1,6 @@ +#include "Spi.h" #include #include -#include "Spi.h" using namespace Pinetime::Drivers; diff --git a/src/drivers/Spi.h b/src/drivers/Spi.h index 82ba8a6..e3cab45 100644 --- a/src/drivers/Spi.h +++ b/src/drivers/Spi.h @@ -1,12 +1,6 @@ #pragma once -#include #include #include -#include -#include -#include - -#include "BufferProvider.h" #include "SpiMaster.h" namespace Pinetime { diff --git a/src/drivers/SpiMaster.cpp b/src/drivers/SpiMaster.cpp index 2e5852a..5f7c064 100644 --- a/src/drivers/SpiMaster.cpp +++ b/src/drivers/SpiMaster.cpp @@ -1,10 +1,8 @@ -#include +#include "SpiMaster.h" #include #include -#include "SpiMaster.h" -#include -#include #include +#include using namespace Pinetime::Drivers; diff --git a/src/drivers/SpiMaster.h b/src/drivers/SpiMaster.h index cd3193e..cb79d90 100644 --- a/src/drivers/SpiMaster.h +++ b/src/drivers/SpiMaster.h @@ -1,14 +1,10 @@ #pragma once -#include -#include #include -#include -#include -#include -#include +#include -#include "BufferProvider.h" +#include #include +#include namespace Pinetime { namespace Drivers { diff --git a/src/drivers/SpiNorFlash.cpp b/src/drivers/SpiNorFlash.cpp index bd24834..3ea5afe 100644 --- a/src/drivers/SpiNorFlash.cpp +++ b/src/drivers/SpiNorFlash.cpp @@ -1,7 +1,7 @@ +#include "SpiNorFlash.h" #include #include #include -#include "SpiNorFlash.h" #include "Spi.h" using namespace Pinetime::Drivers; diff --git a/src/drivers/SpiNorFlash.h b/src/drivers/SpiNorFlash.h index 10c25a0..7702d43 100644 --- a/src/drivers/SpiNorFlash.h +++ b/src/drivers/SpiNorFlash.h @@ -1,5 +1,6 @@ #pragma once #include +#include namespace Pinetime { namespace Drivers { diff --git a/src/drivers/St7789.cpp b/src/drivers/St7789.cpp index ed28c82..2df2c53 100644 --- a/src/drivers/St7789.cpp +++ b/src/drivers/St7789.cpp @@ -1,7 +1,7 @@ +#include "St7789.h" #include #include #include -#include "St7789.h" #include "Spi.h" using namespace Pinetime::Drivers; diff --git a/src/drivers/St7789.h b/src/drivers/St7789.h index 0b94cf2..053cacc 100644 --- a/src/drivers/St7789.h +++ b/src/drivers/St7789.h @@ -1,5 +1,6 @@ #pragma once #include +#include namespace Pinetime { namespace Drivers { diff --git a/src/drivers/TwiMaster.cpp b/src/drivers/TwiMaster.cpp index 3ff8a95..6a063ec 100644 --- a/src/drivers/TwiMaster.cpp +++ b/src/drivers/TwiMaster.cpp @@ -1,7 +1,7 @@ -#include -#include -#include #include "TwiMaster.h" +#include +#include +#include using namespace Pinetime::Drivers; diff --git a/src/drivers/TwiMaster.h b/src/drivers/TwiMaster.h index 52e3909..cc0b6f0 100644 --- a/src/drivers/TwiMaster.h +++ b/src/drivers/TwiMaster.h @@ -1,8 +1,6 @@ #pragma once #include #include -#include - namespace Pinetime { namespace Drivers { diff --git a/src/drivers/Watchdog.cpp b/src/drivers/Watchdog.cpp index 11da121..d09fbcd 100644 --- a/src/drivers/Watchdog.cpp +++ b/src/drivers/Watchdog.cpp @@ -1,7 +1,5 @@ -#include -#include -#include #include "Watchdog.h" +#include using namespace Pinetime::Drivers; diff --git a/src/drivers/Watchdog.h b/src/drivers/Watchdog.h index 73f99ea..0c816a4 100644 --- a/src/drivers/Watchdog.h +++ b/src/drivers/Watchdog.h @@ -1,4 +1,5 @@ #pragma once +#include namespace Pinetime { namespace Drivers { -- cgit v0.10.2 From 1516573df46239ea76b7a8b142a6b719668cb26d Mon Sep 17 00:00:00 2001 From: okaestne Date: Sun, 15 Nov 2020 15:05:51 +0100 Subject: Include cleanup: components diff --git a/src/components/battery/BatteryController.cpp b/src/components/battery/BatteryController.cpp index 571efae..3e3d65b 100644 --- a/src/components/battery/BatteryController.cpp +++ b/src/components/battery/BatteryController.cpp @@ -1,8 +1,7 @@ -#include +#include "BatteryController.h" #include #include #include -#include "BatteryController.h" using namespace Pinetime::Controllers; diff --git a/src/components/battery/BatteryController.h b/src/components/battery/BatteryController.h index f07648a..7cc964e 100644 --- a/src/components/battery/BatteryController.h +++ b/src/components/battery/BatteryController.h @@ -1,7 +1,7 @@ #pragma once +#include #include - namespace Pinetime { namespace Controllers { class Battery { diff --git a/src/components/ble/AlertNotificationClient.cpp b/src/components/ble/AlertNotificationClient.cpp index abe4109..e7a1862 100644 --- a/src/components/ble/AlertNotificationClient.cpp +++ b/src/components/ble/AlertNotificationClient.cpp @@ -1,7 +1,7 @@ -#include -#include "NotificationManager.h" - #include "AlertNotificationClient.h" +#include +#include "NotificationManager.h" +#include "systemtask/SystemTask.h" using namespace Pinetime::Controllers; constexpr ble_uuid16_t AlertNotificationClient::ansServiceUuid; @@ -159,8 +159,8 @@ void AlertNotificationClient::OnNotification(ble_gap_event *event) { const auto maxBufferSize{maxMessageSize + headerSize}; const auto dbgPacketLen = OS_MBUF_PKTLEN(event->notify_rx.om); - size_t bufferSize = min(dbgPacketLen + stringTerminatorSize, maxBufferSize); - auto messageSize = min(maxMessageSize, (bufferSize - headerSize)); + size_t bufferSize = std::min(dbgPacketLen + stringTerminatorSize, maxBufferSize); + auto messageSize = std::min(maxMessageSize, (bufferSize - headerSize)); NotificationManager::Notification notif; os_mbuf_copydata(event->notify_rx.om, headerSize, messageSize - 1, notif.message.data()); diff --git a/src/components/ble/AlertNotificationClient.h b/src/components/ble/AlertNotificationClient.h index bc0df51..fa10456 100644 --- a/src/components/ble/AlertNotificationClient.h +++ b/src/components/ble/AlertNotificationClient.h @@ -1,13 +1,23 @@ #pragma once #include -#include +#include +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max #include +#undef max +#undef min #include "BleClient.h" - namespace Pinetime { + + namespace System { + class SystemTask; + } + namespace Controllers { + class NotificationManager; + class AlertNotificationClient : public BleClient { public: explicit AlertNotificationClient(Pinetime::System::SystemTask &systemTask, diff --git a/src/components/ble/AlertNotificationService.cpp b/src/components/ble/AlertNotificationService.cpp index 32711b9..3156470 100644 --- a/src/components/ble/AlertNotificationService.cpp +++ b/src/components/ble/AlertNotificationService.cpp @@ -1,10 +1,9 @@ - -#include -#include "NotificationManager.h" -#include - #include "AlertNotificationService.h" +#include #include +#include +#include "NotificationManager.h" +#include "systemtask/SystemTask.h" using namespace Pinetime::Controllers; @@ -60,8 +59,8 @@ int AlertNotificationService::OnAlert(uint16_t conn_handle, uint16_t attr_handle const auto maxBufferSize{maxMessageSize + headerSize}; const auto dbgPacketLen = OS_MBUF_PKTLEN(ctxt->om); - size_t bufferSize = min(dbgPacketLen + stringTerminatorSize, maxBufferSize); - auto messageSize = min(maxMessageSize, (bufferSize-headerSize)); + size_t bufferSize = std::min(dbgPacketLen + stringTerminatorSize, maxBufferSize); + auto messageSize = std::min(maxMessageSize, (bufferSize-headerSize)); NotificationManager::Notification notif; os_mbuf_copydata(ctxt->om, headerSize, messageSize-1, notif.message.data()); diff --git a/src/components/ble/AlertNotificationService.h b/src/components/ble/AlertNotificationService.h index 1b8c498..120312d 100644 --- a/src/components/ble/AlertNotificationService.h +++ b/src/components/ble/AlertNotificationService.h @@ -1,10 +1,20 @@ #pragma once #include #include +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max #include +#undef max +#undef min namespace Pinetime { + + namespace System { + class SystemTask; + } namespace Controllers { + class NotificationManager; + class AlertNotificationService { public: AlertNotificationService(Pinetime::System::SystemTask &systemTask, diff --git a/src/components/ble/BatteryInformationService.h b/src/components/ble/BatteryInformationService.h index 74b2222..b00000a 100644 --- a/src/components/ble/BatteryInformationService.h +++ b/src/components/ble/BatteryInformationService.h @@ -1,5 +1,9 @@ #pragma once +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max #include +#undef max +#undef min namespace Pinetime { namespace System { diff --git a/src/components/ble/BleController.cpp b/src/components/ble/BleController.cpp index 2b396e1..650ec79 100644 --- a/src/components/ble/BleController.cpp +++ b/src/components/ble/BleController.cpp @@ -1,5 +1,3 @@ -#include -#include #include "BleController.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/BleController.h b/src/components/ble/BleController.h index 3f52ea2..0570c8d 100644 --- a/src/components/ble/BleController.h +++ b/src/components/ble/BleController.h @@ -1,8 +1,7 @@ #pragma once -#include -#include #include +#include namespace Pinetime { namespace Controllers { diff --git a/src/components/ble/CurrentTimeClient.cpp b/src/components/ble/CurrentTimeClient.cpp index 92f9374..be50fed 100644 --- a/src/components/ble/CurrentTimeClient.cpp +++ b/src/components/ble/CurrentTimeClient.cpp @@ -1,5 +1,6 @@ -#include #include "CurrentTimeClient.h" +#include +#include "components/datetime/DateTimeController.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/CurrentTimeClient.h b/src/components/ble/CurrentTimeClient.h index 9313939..1b2e018 100644 --- a/src/components/ble/CurrentTimeClient.h +++ b/src/components/ble/CurrentTimeClient.h @@ -1,13 +1,15 @@ #pragma once +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max +#include +#undef max +#undef min #include -#include - -#include "components/datetime/DateTimeController.h" #include "BleClient.h" -#include namespace Pinetime { namespace Controllers { + class DateTime; class CurrentTimeClient : public BleClient { public: diff --git a/src/components/ble/CurrentTimeService.h b/src/components/ble/CurrentTimeService.h index a6be964..2395628 100644 --- a/src/components/ble/CurrentTimeService.h +++ b/src/components/ble/CurrentTimeService.h @@ -3,7 +3,11 @@ #include #include "components/datetime/DateTimeController.h" +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max #include +#undef max +#undef min namespace Pinetime { namespace Controllers { diff --git a/src/components/ble/DeviceInformationService.h b/src/components/ble/DeviceInformationService.h index 25ab840..94ca7bb 100644 --- a/src/components/ble/DeviceInformationService.h +++ b/src/components/ble/DeviceInformationService.h @@ -1,9 +1,10 @@ #pragma once -#include -#include - +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max #include -#include +#undef max +#undef min +#include "Version.h" namespace Pinetime { namespace Controllers { diff --git a/src/components/ble/DfuService.cpp b/src/components/ble/DfuService.cpp index 4dec514..90795b4 100644 --- a/src/components/ble/DfuService.cpp +++ b/src/components/ble/DfuService.cpp @@ -1,8 +1,8 @@ +#include "DfuService.h" #include - #include "components/ble/BleController.h" +#include "drivers/SpiNorFlash.h" #include "systemtask/SystemTask.h" -#include "DfuService.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/DfuService.h b/src/components/ble/DfuService.h index d7ba460..096bd99 100644 --- a/src/components/ble/DfuService.h +++ b/src/components/ble/DfuService.h @@ -3,7 +3,11 @@ #include #include +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max #include +#undef max +#undef min namespace Pinetime { namespace System { diff --git a/src/components/ble/ImmediateAlertService.cpp b/src/components/ble/ImmediateAlertService.cpp index e2cee30..0f6bf6c 100644 --- a/src/components/ble/ImmediateAlertService.cpp +++ b/src/components/ble/ImmediateAlertService.cpp @@ -1,7 +1,7 @@ -#include -#include #include "ImmediateAlertService.h" -#include "AlertNotificationService.h" +#include +#include "NotificationManager.h" +#include "systemtask/SystemTask.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/ImmediateAlertService.h b/src/components/ble/ImmediateAlertService.h index c42846c..2bc9cba 100644 --- a/src/components/ble/ImmediateAlertService.h +++ b/src/components/ble/ImmediateAlertService.h @@ -1,5 +1,9 @@ #pragma once +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max #include +#undef max +#undef min namespace Pinetime { namespace System { diff --git a/src/components/ble/MusicService.cpp b/src/components/ble/MusicService.cpp index 84f2972..fdecb6b 100644 --- a/src/components/ble/MusicService.cpp +++ b/src/components/ble/MusicService.cpp @@ -15,8 +15,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include #include "MusicService.h" +#include "systemtask/SystemTask.h" int MSCallback(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { auto musicService = static_cast(arg); diff --git a/src/components/ble/MusicService.h b/src/components/ble/MusicService.h index b365909..ee3628b 100644 --- a/src/components/ble/MusicService.h +++ b/src/components/ble/MusicService.h @@ -18,10 +18,13 @@ #pragma once #include -#include +#include +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max #include #include -#include +#undef max +#undef min //c7e50000-78fc-48fe-8e23-43b37a1942d0 #define MUSIC_SERVICE_UUID_BASE {0xd0, 0x42, 0x19, 0x3a, 0x3b, 0x43, 0x23, 0x8e, 0xfe, 0x48, 0xfc, 0x78, 0x00, 0x00, 0xe5, 0xc7} diff --git a/src/components/ble/NimbleController.cpp b/src/components/ble/NimbleController.cpp index af7f402..a6f3cc3 100644 --- a/src/components/ble/NimbleController.cpp +++ b/src/components/ble/NimbleController.cpp @@ -1,15 +1,19 @@ -#include "components/datetime/DateTimeController.h" -#include -#include "components/ble/NotificationManager.h" -#include #include "NimbleController.h" -#include "MusicService.h" -#include -#include -#include -#include -#include +#include +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max #include +#include +#include +#include +#undef max +#undef min +#include +#include +#include "components/ble/BleController.h" +#include "components/ble/NotificationManager.h" +#include "components/datetime/DateTimeController.h" +#include "systemtask/SystemTask.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/NimbleController.h b/src/components/ble/NimbleController.h index 8ddec1f..914f11e 100644 --- a/src/components/ble/NimbleController.h +++ b/src/components/ble/NimbleController.h @@ -2,24 +2,35 @@ #include -#include "AlertNotificationService.h" +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max +#include +#undef max +#undef min #include "AlertNotificationClient.h" -#include "DeviceInformationService.h" +#include "AlertNotificationService.h" +#include "BatteryInformationService.h" #include "CurrentTimeClient.h" -#include "DfuService.h" #include "CurrentTimeService.h" -#include "MusicService.h" -#include "BatteryInformationService.h" +#include "DeviceInformationService.h" +#include "DfuService.h" #include "ImmediateAlertService.h" +#include "MusicService.h" #include "ServiceDiscovery.h" -#include namespace Pinetime { namespace Drivers { class SpiNorFlash; } + + namespace System { + class SystemTask; + } + namespace Controllers { + class Ble; class DateTime; + class NotificationManager; class NimbleController { diff --git a/src/components/ble/NotificationManager.cpp b/src/components/ble/NotificationManager.cpp index 6771172..dabcb4b 100644 --- a/src/components/ble/NotificationManager.cpp +++ b/src/components/ble/NotificationManager.cpp @@ -1,6 +1,6 @@ +#include "NotificationManager.h" #include #include -#include "NotificationManager.h" using namespace Pinetime::Controllers; diff --git a/src/components/ble/NotificationManager.h b/src/components/ble/NotificationManager.h index 49fe830..036d2ed 100644 --- a/src/components/ble/NotificationManager.h +++ b/src/components/ble/NotificationManager.h @@ -2,6 +2,8 @@ #include #include +#include +#include namespace Pinetime { namespace Controllers { @@ -27,7 +29,7 @@ namespace Pinetime { bool ClearNewNotificationFlag(); bool AreNewNotificationsAvailable(); - static constexpr uint8_t MaximumMessageSize() { return MessageSize; }; + static constexpr size_t MaximumMessageSize() { return MessageSize; }; size_t NbNotifications() const; private: diff --git a/src/components/ble/ServiceDiscovery.cpp b/src/components/ble/ServiceDiscovery.cpp index 4b29d89..4d37b8b 100644 --- a/src/components/ble/ServiceDiscovery.cpp +++ b/src/components/ble/ServiceDiscovery.cpp @@ -1,5 +1,7 @@ -#include #include "ServiceDiscovery.h" +#include +#include "BleClient.h" + using namespace Pinetime::Controllers; ServiceDiscovery::ServiceDiscovery(std::array&& clients) : clients{clients} { diff --git a/src/components/ble/ServiceDiscovery.h b/src/components/ble/ServiceDiscovery.h index c86fc4e..0b26bd1 100644 --- a/src/components/ble/ServiceDiscovery.h +++ b/src/components/ble/ServiceDiscovery.h @@ -1,12 +1,12 @@ #pragma once #include -#include -#include -#include "BleClient.h" +#include namespace Pinetime { namespace Controllers { + class BleClient; + class ServiceDiscovery { public: ServiceDiscovery(std::array&& bleClients); diff --git a/src/components/brightness/BrightnessController.cpp b/src/components/brightness/BrightnessController.cpp index c8825d6..78c461d 100644 --- a/src/components/brightness/BrightnessController.cpp +++ b/src/components/brightness/BrightnessController.cpp @@ -1,5 +1,5 @@ -#include #include "BrightnessController.h" +#include using namespace Pinetime::Controllers; diff --git a/src/components/firmwarevalidator/FirmwareValidator.cpp b/src/components/firmwarevalidator/FirmwareValidator.cpp index 244d5c0..48f9855 100644 --- a/src/components/firmwarevalidator/FirmwareValidator.cpp +++ b/src/components/firmwarevalidator/FirmwareValidator.cpp @@ -1,8 +1,8 @@ -#include -#include - #include "FirmwareValidator.h" +#include +#include "drivers/InternalFlash.h" + using namespace Pinetime::Controllers; bool FirmwareValidator::IsValidated() const { diff --git a/src/components/gfx/Gfx.cpp b/src/components/gfx/Gfx.cpp index 3c5dbfb..b9b9401 100644 --- a/src/components/gfx/Gfx.cpp +++ b/src/components/gfx/Gfx.cpp @@ -1,8 +1,5 @@ -#include -#include -#include #include "Gfx.h" -#include "../../drivers/St7789.h" +#include "drivers/St7789.h" using namespace Pinetime::Components; Gfx::Gfx(Pinetime::Drivers::St7789 &lcd) : lcd{lcd} { diff --git a/src/components/gfx/Gfx.h b/src/components/gfx/Gfx.h index 091f06f..35341e0 100644 --- a/src/components/gfx/Gfx.h +++ b/src/components/gfx/Gfx.h @@ -1,10 +1,10 @@ #pragma once -#include -#include -#include #include +#include #include - +#include +#include +#include "drivers/BufferProvider.h" namespace Pinetime { namespace Drivers { diff --git a/src/logging/NrfLogger.cpp b/src/logging/NrfLogger.cpp index 0d95c06..9f7624b 100644 --- a/src/logging/NrfLogger.cpp +++ b/src/logging/NrfLogger.cpp @@ -1,9 +1,8 @@ +#include "NrfLogger.h" + +#include #include #include -#include -#include -#include -#include "NrfLogger.h" using namespace Pinetime::Logging; diff --git a/src/logging/NrfLogger.h b/src/logging/NrfLogger.h index cb7089f..fb68b91 100644 --- a/src/logging/NrfLogger.h +++ b/src/logging/NrfLogger.h @@ -1,6 +1,9 @@ #pragma once #include "Logger.h" +#include +#include + namespace Pinetime { namespace Logging{ class NrfLogger : public Logger { diff --git a/src/main.cpp b/src/main.cpp index 45aac6d..3505704 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,32 +1,44 @@ -#include -#include -#include -#include +// nrf #include #include -#include -#include +#include #include -#include "displayapp/DisplayApp.h" +#include #include -#include "components/datetime/DateTimeController.h" -#include "components/battery/BatteryController.h" -#include "components/ble/BleController.h" -#include "components/ble/NotificationManager.h" -#include -#include -#include -#include "displayapp/LittleVgl.h" -#include -#include -#include -#include -#include + +// nimble +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max #include -#include +#include #include +#include +#include +#include +#include #include +#include +#undef max +#undef min + +// FreeRTOS +#include +#include +#include +#include "components/battery/BatteryController.h" +#include "components/ble/BleController.h" +#include "components/ble/NotificationManager.h" +#include "components/datetime/DateTimeController.h" +#include "displayapp/DisplayApp.h" +#include "displayapp/LittleVgl.h" +#include "drivers/Spi.h" +#include "drivers/SpiMaster.h" +#include "drivers/SpiNorFlash.h" +#include "drivers/St7789.h" +#include "drivers/TwiMaster.h" +#include "drivers/Cst816s.h" +#include "systemtask/SystemTask.h" #if NRF_LOG_ENABLED #include "logging/NrfLogger.h" diff --git a/src/main.h b/src/main.h index b0a8a57..2ff32b8 100644 --- a/src/main.h +++ b/src/main.h @@ -2,6 +2,7 @@ #include #include +#include void nrfx_gpiote_evt_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action); void DebounceTimerCallback(TimerHandle_t xTimer); \ No newline at end of file diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index dac4ce2..81e7323 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -1,19 +1,27 @@ -#include -#include -#include -#include "displayapp/LittleVgl.h" -#include -#include "components/ble/NotificationManager.h" -#include -#include #include "SystemTask.h" -#include +#define min // workaround: nimble's min/max macros conflict with libstdc++ +#define max #include +#include +#include #include -#include +#include +#undef max +#undef min +#include +#include +#include + +#include "BootloaderVersion.h" +#include "components/ble/BleController.h" +#include "displayapp/LittleVgl.h" +#include "drivers/Cst816s.h" +#include "drivers/St7789.h" +#include "drivers/InternalFlash.h" +#include "drivers/SpiMaster.h" +#include "drivers/SpiNorFlash.h" +#include "drivers/TwiMaster.h" #include "main.h" -#include "components/ble/NimbleController.h" -#include "../BootloaderVersion.h" using namespace Pinetime::System; diff --git a/src/systemtask/SystemTask.h b/src/systemtask/SystemTask.h index 6ef0cfb..fe6e7cb 100644 --- a/src/systemtask/SystemTask.h +++ b/src/systemtask/SystemTask.h @@ -4,17 +4,23 @@ #include #include -#include -#include -#include "components/battery/BatteryController.h" -#include "displayapp/DisplayApp.h" -#include -#include +#include + #include "SystemMonitor.h" +#include "components/battery/BatteryController.h" #include "components/ble/NimbleController.h" -#include "timers.h" +#include "components/ble/NotificationManager.h" +#include "displayapp/DisplayApp.h" +#include "drivers/Watchdog.h" namespace Pinetime { + namespace Drivers { + class Cst816S; + class SpiMaster; + class SpiNorFlash; + class St7789; + class TwiMaster; + } namespace System { class SystemTask { public: -- cgit v0.10.2 From cadc0c25d4f20653689c019b372a6822624c41b0 Mon Sep 17 00:00:00 2001 From: okaestne Date: Sun, 15 Nov 2020 16:49:36 +0100 Subject: Include cleanup: displayapp + screens diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index d4d4133..efc042b 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -1,25 +1,24 @@ -#include - #include "DisplayApp.h" -#include -#include #include -#include -#include +#include "components/battery/BatteryController.h" +#include "components/ble/BleController.h" #include "components/datetime/DateTimeController.h" -#include -#include "displayapp/screens/Notifications.h" -#include "displayapp/screens/Tile.h" -#include "displayapp/screens/Meter.h" -#include "displayapp/screens/Gauge.h" -#include "displayapp/screens/Brightness.h" -#include "displayapp/screens/SystemInfo.h" -#include "displayapp/screens/Music.h" #include "components/ble/NotificationManager.h" -#include "displayapp/screens/FirmwareUpdate.h" #include "displayapp/screens/ApplicationList.h" +#include "displayapp/screens/Brightness.h" +#include "displayapp/screens/Clock.h" +#include "displayapp/screens/FirmwareUpdate.h" #include "displayapp/screens/FirmwareValidation.h" +#include "displayapp/screens/Gauge.h" #include "displayapp/screens/InfiniPaint.h" +#include "displayapp/screens/Meter.h" +#include "displayapp/screens/Music.h" +#include "displayapp/screens/Notifications.h" +#include "displayapp/screens/SystemInfo.h" +#include "displayapp/screens/Tile.h" +#include "drivers/Cst816s.h" +#include "drivers/St7789.h" +#include "drivers/Watchdog.h" #include "systemtask/SystemTask.h" using namespace Pinetime::Applications; diff --git a/src/displayapp/DisplayApp.h b/src/displayapp/DisplayApp.h index 2a0efde..25cd281 100644 --- a/src/displayapp/DisplayApp.h +++ b/src/displayapp/DisplayApp.h @@ -1,28 +1,30 @@ #pragma once #include -#include -#include -#include -#include +#include #include -#include "components/gfx/Gfx.h" -#include "components/battery/BatteryController.h" +#include +#include +#include "Apps.h" +#include "LittleVgl.h" +#include "TouchEvents.h" #include "components/brightness/BrightnessController.h" -#include "components/ble/BleController.h" -#include "components/datetime/DateTimeController.h" -#include "components/ble/NotificationManager.h" #include "components/firmwarevalidator/FirmwareValidator.h" -#include "drivers/Cst816s.h" -#include "LittleVgl.h" -#include -#include "displayapp/screens/Clock.h" #include "displayapp/screens/Modal.h" -#include -#include "TouchEvents.h" -#include "Apps.h" - namespace Pinetime { + + namespace Drivers { + class St7789; + class Cst816S; + class WatchdogView; + } + namespace Controllers { + class Battery; + class Ble; + class DateTime; + class NotificationManager; + } + namespace System { class SystemTask; }; diff --git a/src/displayapp/LittleVgl.cpp b/src/displayapp/LittleVgl.cpp index 3483f8e..8a296c0 100644 --- a/src/displayapp/LittleVgl.cpp +++ b/src/displayapp/LittleVgl.cpp @@ -1,14 +1,10 @@ +#include "LittleVgl.h" + #include -#include #include -#include -#include -#include - -#include -#include - -#include "LittleVgl.h" +//#include +#include "drivers/Cst816s.h" +#include "drivers/St7789.h" using namespace Pinetime::Components; diff --git a/src/displayapp/LittleVgl.h b/src/displayapp/LittleVgl.h index 5c1c443..ea50985 100644 --- a/src/displayapp/LittleVgl.h +++ b/src/displayapp/LittleVgl.h @@ -1,12 +1,13 @@ #pragma once -#include -#include -#include -#include -#include +#include namespace Pinetime { + namespace Drivers { + class Cst816S; + class St7789; + } + namespace Components { class LittleVgl { public: diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp index 7eb9718..1702697 100644 --- a/src/displayapp/screens/ApplicationList.cpp +++ b/src/displayapp/screens/ApplicationList.cpp @@ -1,9 +1,10 @@ -#include -#include -#include #include "ApplicationList.h" -#include "Tile.h" +#include +#include #include "Symbols.h" +#include "Tile.h" +#include "displayapp/Apps.h" +#include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/ApplicationList.h b/src/displayapp/screens/ApplicationList.h index 9c95acb..aefb238 100644 --- a/src/displayapp/screens/ApplicationList.h +++ b/src/displayapp/screens/ApplicationList.h @@ -1,14 +1,9 @@ #pragma once -#include -#include +#include -#include "components/ble/NimbleController.h" #include "Screen.h" -#include "Label.h" #include "ScreenList.h" -#include "Gauge.h" -#include "Meter.h" namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/BatteryIcon.cpp b/src/displayapp/screens/BatteryIcon.cpp index 26939d1..4c10247 100644 --- a/src/displayapp/screens/BatteryIcon.cpp +++ b/src/displayapp/screens/BatteryIcon.cpp @@ -1,5 +1,6 @@ #include "BatteryIcon.h" #include "Symbols.h" + using namespace Pinetime::Applications::Screens; const char* BatteryIcon::GetBatteryIcon(float batteryPercent) { diff --git a/src/displayapp/screens/BatteryIcon.h b/src/displayapp/screens/BatteryIcon.h index 58f04a8..f100192 100644 --- a/src/displayapp/screens/BatteryIcon.h +++ b/src/displayapp/screens/BatteryIcon.h @@ -1,7 +1,5 @@ #pragma once -#include - namespace Pinetime { namespace Applications { namespace Screens { diff --git a/src/displayapp/screens/Brightness.cpp b/src/displayapp/screens/Brightness.cpp index 8ea9a77..c8085be 100644 --- a/src/displayapp/screens/Brightness.cpp +++ b/src/displayapp/screens/Brightness.cpp @@ -1,5 +1,5 @@ -#include #include "Brightness.h" +#include using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Brightness.h b/src/displayapp/screens/Brightness.h index 7d599ac..7aee968 100644 --- a/src/displayapp/screens/Brightness.h +++ b/src/displayapp/screens/Brightness.h @@ -1,8 +1,9 @@ #pragma once -#include -#include "components/brightness/BrightnessController.h" +#include +#include #include "Screen.h" +#include "components/brightness/BrightnessController.h" namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/Clock.cpp b/src/displayapp/screens/Clock.cpp index 977321c1..5765914 100644 --- a/src/displayapp/screens/Clock.cpp +++ b/src/displayapp/screens/Clock.cpp @@ -1,15 +1,16 @@ -#include - -#include -#include "components/datetime/DateTimeController.h" -#include #include "Clock.h" -#include "../DisplayApp.h" + +#include +#include +#include #include "BatteryIcon.h" #include "BleIcon.h" +#include "NotificationIcon.h" #include "Symbols.h" +#include "components/battery/BatteryController.h" +#include "components/ble/BleController.h" #include "components/ble/NotificationManager.h" -#include "NotificationIcon.h" +#include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; extern lv_font_t jetbrains_mono_extrabold_compressed; diff --git a/src/displayapp/screens/Clock.h b/src/displayapp/screens/Clock.h index 58149a7..4c5f60a 100644 --- a/src/displayapp/screens/Clock.h +++ b/src/displayapp/screens/Clock.h @@ -1,17 +1,19 @@ #pragma once -#include +#include #include - +#include +#include #include "Screen.h" -#include -#include -#include -#include "components/ble/NotificationManager.h" -#include "components/battery/BatteryController.h" -#include "components/ble/BleController.h" +#include "components/datetime/DateTimeController.h" namespace Pinetime { + namespace Controllers { + class Battery; + class Ble; + class NotificationManager; + } + namespace Applications { namespace Screens { @@ -34,7 +36,7 @@ namespace Pinetime { T value; bool isUpdated = true; }; - class Clock : public Screen{ + class Clock : public Screen { public: Clock(DisplayApp* app, Controllers::DateTime& dateTimeController, diff --git a/src/displayapp/screens/DropDownDemo.cpp b/src/displayapp/screens/DropDownDemo.cpp index ce3acd5..37728e1 100644 --- a/src/displayapp/screens/DropDownDemo.cpp +++ b/src/displayapp/screens/DropDownDemo.cpp @@ -1,6 +1,6 @@ -#include -#include #include "DropDownDemo.h" +#include +#include #include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/DropDownDemo.h b/src/displayapp/screens/DropDownDemo.h index 7c75efc..d66aeed 100644 --- a/src/displayapp/screens/DropDownDemo.h +++ b/src/displayapp/screens/DropDownDemo.h @@ -2,15 +2,13 @@ #include #include "Screen.h" -#include -#include -#include +#include namespace Pinetime { namespace Applications { namespace Screens { - class DropDownDemo : public Screen{ + class DropDownDemo : public Screen { public: DropDownDemo(DisplayApp* app); ~DropDownDemo() override; diff --git a/src/displayapp/screens/FirmwareUpdate.cpp b/src/displayapp/screens/FirmwareUpdate.cpp index 778409e..b9f891d 100644 --- a/src/displayapp/screens/FirmwareUpdate.cpp +++ b/src/displayapp/screens/FirmwareUpdate.cpp @@ -1,5 +1,6 @@ -#include #include "FirmwareUpdate.h" +#include +#include "components/ble/BleController.h" #include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/FirmwareUpdate.h b/src/displayapp/screens/FirmwareUpdate.h index 893fe68..262e7af 100644 --- a/src/displayapp/screens/FirmwareUpdate.h +++ b/src/displayapp/screens/FirmwareUpdate.h @@ -1,15 +1,12 @@ #pragma once -#include -#include - #include "Screen.h" -#include -#include -#include -#include "components/ble/BleController.h" +#include namespace Pinetime { + namespace Controllers { + class Ble; + } namespace Applications { namespace Screens { diff --git a/src/displayapp/screens/FirmwareValidation.cpp b/src/displayapp/screens/FirmwareValidation.cpp index 4ac399f..d4165dc 100644 --- a/src/displayapp/screens/FirmwareValidation.cpp +++ b/src/displayapp/screens/FirmwareValidation.cpp @@ -1,8 +1,8 @@ -#include #include "FirmwareValidation.h" -#include "../DisplayApp.h" -#include "../../Version.h" +#include +#include "Version.h" #include "components/firmwarevalidator/FirmwareValidator.h" +#include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; extern lv_font_t jetbrains_mono_extrabold_compressed; @@ -87,5 +87,3 @@ void FirmwareValidation::OnButtonEvent(lv_obj_t *object, lv_event_t event) { } } - - diff --git a/src/displayapp/screens/FirmwareValidation.h b/src/displayapp/screens/FirmwareValidation.h index 947f557..9eea86b 100644 --- a/src/displayapp/screens/FirmwareValidation.h +++ b/src/displayapp/screens/FirmwareValidation.h @@ -1,10 +1,7 @@ #pragma once -#include #include "Screen.h" -#include -#include -#include +#include namespace Pinetime { namespace Controllers { diff --git a/src/displayapp/screens/Gauge.cpp b/src/displayapp/screens/Gauge.cpp index 81c283c..1b9f2c6 100644 --- a/src/displayapp/screens/Gauge.cpp +++ b/src/displayapp/screens/Gauge.cpp @@ -1,4 +1,3 @@ -#include #include "Gauge.h" #include "../DisplayApp.h" diff --git a/src/displayapp/screens/Gauge.h b/src/displayapp/screens/Gauge.h index 03c06be..2a6b8f8 100644 --- a/src/displayapp/screens/Gauge.h +++ b/src/displayapp/screens/Gauge.h @@ -2,9 +2,7 @@ #include #include "Screen.h" -#include -#include -#include +#include namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/InfiniPaint.cpp b/src/displayapp/screens/InfiniPaint.cpp index 3ea75e9..65be662 100644 --- a/src/displayapp/screens/InfiniPaint.cpp +++ b/src/displayapp/screens/InfiniPaint.cpp @@ -1,7 +1,6 @@ -#include -#include #include "InfiniPaint.h" #include "../DisplayApp.h" +#include "../LittleVgl.h" using namespace Pinetime::Applications::Screens; extern lv_font_t jetbrains_mono_extrabold_compressed; diff --git a/src/displayapp/screens/InfiniPaint.h b/src/displayapp/screens/InfiniPaint.h index f29135d..9a7ac07 100644 --- a/src/displayapp/screens/InfiniPaint.h +++ b/src/displayapp/screens/InfiniPaint.h @@ -1,31 +1,30 @@ #pragma once +#include #include #include "Screen.h" -#include -#include -#include -#include -#include "displayapp/LittleVgl.h" namespace Pinetime { + namespace Components { + class LittleVgl; + } namespace Applications { namespace Screens { - + class InfiniPaint : public Screen { public: InfiniPaint(DisplayApp* app, Pinetime::Components::LittleVgl& lvgl); - + ~InfiniPaint() override; - + bool Refresh() override; - + bool OnButtonPushed() override; - + bool OnTouchEvent(TouchEvents event) override; - + bool OnTouchEvent(uint16_t x, uint16_t y) override; - + private: Pinetime::Components::LittleVgl& lvgl; static constexpr uint16_t width = 10; diff --git a/src/displayapp/screens/Label.cpp b/src/displayapp/screens/Label.cpp index 540776c..4be7742 100644 --- a/src/displayapp/screens/Label.cpp +++ b/src/displayapp/screens/Label.cpp @@ -1,4 +1,3 @@ -#include #include "Label.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Label.h b/src/displayapp/screens/Label.h index 3e7b379..dba89bb 100644 --- a/src/displayapp/screens/Label.h +++ b/src/displayapp/screens/Label.h @@ -1,6 +1,5 @@ #pragma once -#include #include "Screen.h" #include diff --git a/src/displayapp/screens/Meter.cpp b/src/displayapp/screens/Meter.cpp index 273e111..3c8e703 100644 --- a/src/displayapp/screens/Meter.cpp +++ b/src/displayapp/screens/Meter.cpp @@ -1,5 +1,5 @@ -#include #include "Meter.h" +#include #include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Meter.h b/src/displayapp/screens/Meter.h index ddf8be8..86888dd 100644 --- a/src/displayapp/screens/Meter.h +++ b/src/displayapp/screens/Meter.h @@ -1,11 +1,9 @@ #pragma once #include -#include #include "Screen.h" -#include -#include -#include +#include +#include namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/Modal.cpp b/src/displayapp/screens/Modal.cpp index 29f7bfa..d1a110e 100644 --- a/src/displayapp/screens/Modal.cpp +++ b/src/displayapp/screens/Modal.cpp @@ -1,5 +1,5 @@ -#include #include "Modal.h" +#include #include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Modal.h b/src/displayapp/screens/Modal.h index c616c29..9cc177f 100644 --- a/src/displayapp/screens/Modal.h +++ b/src/displayapp/screens/Modal.h @@ -1,11 +1,8 @@ #pragma once -#include -#include #include "Screen.h" -#include -#include -#include +#include +#include namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/Music.cpp b/src/displayapp/screens/Music.cpp index 225a15a..c4ae3ac 100644 --- a/src/displayapp/screens/Music.cpp +++ b/src/displayapp/screens/Music.cpp @@ -15,9 +15,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include - #include "Music.h" +#include +#include "../DisplayApp.h" +#include "components/ble/MusicService.h" +#include "displayapp/icons/music/disc.cpp" +#include "displayapp/icons/music/disc_f_1.cpp" +#include "displayapp/icons/music/disc_f_2.cpp" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Music.h b/src/displayapp/screens/Music.h index 81ba793..66bde21 100644 --- a/src/displayapp/screens/Music.h +++ b/src/displayapp/screens/Music.h @@ -17,24 +17,16 @@ */ #pragma once -#include -#include +#include +#include #include - -#include "components/gfx/Gfx.h" -#include "components/battery/BatteryController.h" -#include "components/ble/BleController.h" -#include "components/ble/MusicService.h" #include "Screen.h" -#include -#include -#include -#include "../../Version.h" -#include "displayapp/icons/music/disc.cpp" -#include "displayapp/icons/music/disc_f_1.cpp" -#include "displayapp/icons/music/disc_f_2.cpp" namespace Pinetime { + namespace Controllers { + class MusicService; + } + namespace Applications { namespace Screens { class Music : public Screen { diff --git a/src/displayapp/screens/Notifications.cpp b/src/displayapp/screens/Notifications.cpp index 85848b2..51a601c 100644 --- a/src/displayapp/screens/Notifications.cpp +++ b/src/displayapp/screens/Notifications.cpp @@ -1,7 +1,5 @@ -#include -#include -#include #include "Notifications.h" +#include using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Notifications.h b/src/displayapp/screens/Notifications.h index fb4e1ef..f5c6a86 100644 --- a/src/displayapp/screens/Notifications.h +++ b/src/displayapp/screens/Notifications.h @@ -1,11 +1,10 @@ #pragma once -#include -#include - +#include +#include +#include #include "Screen.h" -#include "ScreenList.h" - +#include "components/ble/NotificationManager.h" namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/ScreenList.h b/src/displayapp/screens/ScreenList.h index b198634..736e363 100644 --- a/src/displayapp/screens/ScreenList.h +++ b/src/displayapp/screens/ScreenList.h @@ -1,10 +1,10 @@ #pragma once -#include +#include #include -#include "components/ble/NimbleController.h" +#include #include "Screen.h" -#include "Label.h" +#include "../DisplayApp.h" namespace Pinetime { namespace Applications { diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp index 867fdae..15bcfc5 100644 --- a/src/displayapp/screens/SystemInfo.cpp +++ b/src/displayapp/screens/SystemInfo.cpp @@ -1,9 +1,13 @@ -#include -#include -#include #include "SystemInfo.h" -#include "../../Version.h" -#include "Tile.h" +#include +#include "../DisplayApp.h" +#include "Label.h" +#include "Version.h" +#include "components/battery/BatteryController.h" +#include "components/ble/BleController.h" +#include "components/brightness/BrightnessController.h" +#include "components/datetime/DateTimeController.h" +#include "drivers/Watchdog.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/SystemInfo.h b/src/displayapp/screens/SystemInfo.h index 987a584..a71bacc 100644 --- a/src/displayapp/screens/SystemInfo.h +++ b/src/displayapp/screens/SystemInfo.h @@ -1,17 +1,24 @@ #pragma once -#include -#include - -#include "components/ble/NimbleController.h" +#include #include "Screen.h" -#include "Label.h" #include "ScreenList.h" -#include "Gauge.h" -#include "Meter.h" namespace Pinetime { + namespace Controllers { + class DateTime; + class Battery; + class BrightnessController; + class Ble; + } + + namespace Drivers { + class WatchdogView; + } + namespace Applications { + class DisplayApp; + namespace Screens { class SystemInfo : public Screen { public: diff --git a/src/displayapp/screens/Tab.cpp b/src/displayapp/screens/Tab.cpp index 44b806c..7d7697b 100644 --- a/src/displayapp/screens/Tab.cpp +++ b/src/displayapp/screens/Tab.cpp @@ -1,14 +1,11 @@ -#include -#include -#include "components/datetime/DateTimeController.h" +#include "Tab.h" #include -#include -#include -#include #include -#include "Tab.h" -#include "displayapp/DisplayApp.h" - +#include +#include +#include "../DisplayApp.h" +#include "components/datetime/DateTimeController.h" +#include "components/gfx/Gfx.h" using namespace Pinetime::Applications::Screens; @@ -19,7 +16,7 @@ extern lv_font_t jetbrains_mono_bold_20; // screen->OnObjectEvent(obj, event); //} -Tab::Tab(DisplayApp* app, Pinetime::Components::Gfx &gfx) : Screen(app, gfx) { +Tab::Tab(DisplayApp* app, Pinetime::Components::Gfx &gfx) : Screen(app), gfx(gfx) { /*Create a Tab view object*/ lv_obj_t *tabview; tabview = lv_tabview_create(lv_scr_act(), NULL); diff --git a/src/displayapp/screens/Tab.h b/src/displayapp/screens/Tab.h index e16dbb9..1066129 100644 --- a/src/displayapp/screens/Tab.h +++ b/src/displayapp/screens/Tab.h @@ -1,22 +1,24 @@ #pragma once -#include #include "Screen.h" -#include #include +#include namespace Pinetime { + namespace Components { + class Gfx; + } namespace Applications { namespace Screens { class Tab : public Screen { public: explicit Tab(DisplayApp* app, Components::Gfx& gfx); ~Tab() override; - void Refresh(bool fullRefresh) override; + void Refresh(bool fullRefresh); void OnObjectEvent(lv_obj_t* obj, lv_event_t event); - private: - + protected: + Components::Gfx& gfx; }; } } diff --git a/src/displayapp/screens/Tile.cpp b/src/displayapp/screens/Tile.cpp index 75fa6ef..c1a5e94 100644 --- a/src/displayapp/screens/Tile.cpp +++ b/src/displayapp/screens/Tile.cpp @@ -1,11 +1,5 @@ -#include -#include -#include - #include "Tile.h" -#include "displayapp/DisplayApp.h" -#include "Symbols.h" -#include "../../Version.h" +#include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; diff --git a/src/displayapp/screens/Tile.h b/src/displayapp/screens/Tile.h index cf5fcf1..7edf67b 100644 --- a/src/displayapp/screens/Tile.h +++ b/src/displayapp/screens/Tile.h @@ -1,11 +1,11 @@ #pragma once +#include #include -#include "Screen.h" -#include +#include #include "Modal.h" -#include -#include +#include "Screen.h" +#include "../Apps.h" namespace Pinetime { namespace Applications { -- cgit v0.10.2 From f42b33ed6d3db56fd61450c4c47b5c6c597d3227 Mon Sep 17 00:00:00 2001 From: okaestne Date: Sun, 15 Nov 2020 17:45:43 +0100 Subject: fix TWI includes diff --git a/src/drivers/TwiMaster.h b/src/drivers/TwiMaster.h index cc0b6f0..399e3d0 100644 --- a/src/drivers/TwiMaster.h +++ b/src/drivers/TwiMaster.h @@ -1,6 +1,8 @@ #pragma once #include #include +#include // NRF_TWIM_Type +#include namespace Pinetime { namespace Drivers { -- cgit v0.10.2 From 600dbb0280aae3cc45f7256ac845780663eaf7f8 Mon Sep 17 00:00:00 2001 From: Samuel Archibald Date: Mon, 16 Nov 2020 09:43:32 -0500 Subject: Fix for comments on issue #125, bounds check removed diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp index 34359c2..8170430 100644 --- a/src/displayapp/screens/SystemInfo.cpp +++ b/src/displayapp/screens/SystemInfo.cpp @@ -43,9 +43,7 @@ bool SystemInfo::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } std::unique_ptr SystemInfo::CreateScreen1() { - auto batteryPercent = batteryController.PercentRemaining(); - if(batteryPercent > 100.0f) batteryPercent = 100; - else if(batteryPercent < 0.0f) batteryPercent = 0; + int8_t batteryPercent = (int)batteryController.PercentRemaining(); uint8_t brightness = 0; switch(brightnessController.Level()) { -- cgit v0.10.2 From 6e22509b5ffe6d7c29d09b07f38e64fb1bdc0b21 Mon Sep 17 00:00:00 2001 From: okaestne Date: Tue, 17 Nov 2020 20:51:27 +0100 Subject: Delete Tab.cpp and Tab.h as discussed with JF diff --git a/src/displayapp/screens/Tab.cpp b/src/displayapp/screens/Tab.cpp deleted file mode 100644 index 7d7697b..0000000 --- a/src/displayapp/screens/Tab.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "Tab.h" -#include -#include -#include -#include -#include "../DisplayApp.h" -#include "components/datetime/DateTimeController.h" -#include "components/gfx/Gfx.h" - -using namespace Pinetime::Applications::Screens; - -extern lv_font_t jetbrains_mono_bold_20; - -//static void event_handler(lv_obj_t * obj, lv_event_t event) { -// Tile* screen = static_cast(obj->user_data); -// screen->OnObjectEvent(obj, event); -//} - -Tab::Tab(DisplayApp* app, Pinetime::Components::Gfx &gfx) : Screen(app), gfx(gfx) { -/*Create a Tab view object*/ - lv_obj_t *tabview; - tabview = lv_tabview_create(lv_scr_act(), NULL); - - /*Add 3 tabs (the tabs are page (lv_page) and can be scrolled*/ - lv_obj_t *tab1 = lv_tabview_add_tab(tabview, "Tab 1"); - lv_obj_t *tab2 = lv_tabview_add_tab(tabview, "Tab 2"); - lv_obj_t *tab3 = lv_tabview_add_tab(tabview, "Tab 3"); - - - /*Add content to the tabs*/ - lv_obj_t * label = lv_label_create(tab1, NULL); - lv_label_set_text(label, "This the first tab\n\n" - "If the content\n" - "of a tab\n" - "become too long\n" - "the it \n" - "automatically\n" - "become\n" - "scrollable."); - - label = lv_label_create(tab2, NULL); - lv_label_set_text(label, "Second tab"); - - label = lv_label_create(tab3, NULL); - lv_label_set_text(label, "Third tab"); - -} - -Tab::~Tab() { - lv_obj_clean(lv_scr_act()); -} - -void Tab::Refresh(bool fullRefresh) { - -} - -void Tab::OnObjectEvent(lv_obj_t *obj, lv_event_t event) { - if(event == LV_EVENT_CLICKED) { - NRF_LOG_INFO("Clicked"); - } - else if(event == LV_EVENT_VALUE_CHANGED) { - NRF_LOG_INFO("Toggled"); - } -} diff --git a/src/displayapp/screens/Tab.h b/src/displayapp/screens/Tab.h deleted file mode 100644 index 1066129..0000000 --- a/src/displayapp/screens/Tab.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "Screen.h" -#include -#include - -namespace Pinetime { - namespace Components { - class Gfx; - } - namespace Applications { - namespace Screens { - class Tab : public Screen { - public: - explicit Tab(DisplayApp* app, Components::Gfx& gfx); - ~Tab() override; - void Refresh(bool fullRefresh); - void OnObjectEvent(lv_obj_t* obj, lv_event_t event); - - protected: - Components::Gfx& gfx; - }; - } - } -} -- cgit v0.10.2 From 3703611a6013f4f0905ab4f3de9f3157e73f52b5 Mon Sep 17 00:00:00 2001 From: Samuel Archibald Date: Wed, 18 Nov 2020 00:00:33 -0500 Subject: Fixes #119! Improved based off suggested changes diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp index 8170430..83384fb 100644 --- a/src/displayapp/screens/SystemInfo.cpp +++ b/src/displayapp/screens/SystemInfo.cpp @@ -43,7 +43,7 @@ bool SystemInfo::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } std::unique_ptr SystemInfo::CreateScreen1() { - int8_t batteryPercent = (int)batteryController.PercentRemaining(); + auto batteryPercent = static_cast(batteryController.PercentRemaining()); uint8_t brightness = 0; switch(brightnessController.Level()) { @@ -95,7 +95,7 @@ std::unique_ptr SystemInfo::CreateScreen1() { dateTimeController.Day(), static_cast(dateTimeController.Month()), dateTimeController.Year(), dateTimeController.Hours(), dateTimeController.Minutes(), dateTimeController.Seconds(), uptimeDays, uptimeHours, uptimeMinutes, uptimeSeconds, - (int) batteryPercent, brightness, resetReason); + batteryPercent, brightness, resetReason); return std::unique_ptr(new Screens::Label(app, t1)); } -- cgit v0.10.2 From 9d96b09048416d164d23c6945837bdb7efa73f2c Mon Sep 17 00:00:00 2001 From: incyi Date: Wed, 18 Nov 2020 08:49:27 +0100 Subject: Update README.md diff --git a/README.md b/README.md index 9eeee4a..09e85dd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # PineTime -![Build PineTime Firmware](https://github.com/JF002/Pinetime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=develop) +![Build PineTime Firmware](https://github.com/JF002/Pinetime/workflows/Build%20PineTime%20Firmware/badge.svg?branch=master) > The PineTime is a free and open source smartwatch capable of running custom-built open operating systems. Some of the notable features include a heart rate monitor, a week-long battery as well as a capacitive touch IPS display that is legible in direct sunlight. It is a fully community driven side-project, which means that it will ultimately be up to the developers and end-users to determine when they deem the PineTime ready to ship. -- cgit v0.10.2 From 681182d16ab502d103e277d817a05f750dc59e66 Mon Sep 17 00:00:00 2001 From: Samuel Archibald Date: Thu, 19 Nov 2020 15:44:57 -0500 Subject: Readability and fix diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 3271edc..51b8491 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -192,7 +192,8 @@ void SystemTask::Work() { } monitor.Process(); - dateTimeController.UpdateTime(nrf_rtc_counter_get(portNRF_RTC_REG);); + uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG); + dateTimeController.UpdateTime(nrf_rtc_counter_get(systick_counter); if(!nrf_gpio_pin_read(pinButton)) watchdog.Kick(); } -- cgit v0.10.2 From e18485c92bc4941eff38d61de52077c8d2aebeeb Mon Sep 17 00:00:00 2001 From: Samuel Archibald Date: Thu, 19 Nov 2020 15:47:27 -0500 Subject: Whoops! Don't look at this XD diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 51b8491..96ab7b7 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -193,7 +193,7 @@ void SystemTask::Work() { monitor.Process(); uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG); - dateTimeController.UpdateTime(nrf_rtc_counter_get(systick_counter); + dateTimeController.UpdateTime(nrf_rtc_counter_get(systick_counter)); if(!nrf_gpio_pin_read(pinButton)) watchdog.Kick(); } -- cgit v0.10.2 From e180ec5f3a45e5ad4774ca915c84dff481692206 Mon Sep 17 00:00:00 2001 From: Samuel Archibald Date: Thu, 19 Nov 2020 15:50:39 -0500 Subject: =?UTF-8?q?Jeez=20this=20is=20what=20I=20get=20for=20rushing=20?= =?UTF-8?q?=F0=9F=98=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index 96ab7b7..3177bce 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -193,7 +193,7 @@ void SystemTask::Work() { monitor.Process(); uint32_t systick_counter = nrf_rtc_counter_get(portNRF_RTC_REG); - dateTimeController.UpdateTime(nrf_rtc_counter_get(systick_counter)); + dateTimeController.UpdateTime(systick_counter); if(!nrf_gpio_pin_read(pinButton)) watchdog.Kick(); } -- cgit v0.10.2 From 8f69a45fd97208e1b1caefc4013a10e3c382c0b8 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Fri, 20 Nov 2020 10:07:17 +1000 Subject: Rename dockerfile folders to correct architectures diff --git a/docker/amd64/Dockerfile b/docker/amd64/Dockerfile new file mode 100644 index 0000000..7899c8c --- /dev/null +++ b/docker/amd64/Dockerfile @@ -0,0 +1,17 @@ +FROM ubuntu:18.04 + +ARG USER_ID +ARG GROUP_ID + +RUN addgroup --gid $GROUP_ID user +RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user + +RUN apt-get update -qq && apt-get install -y wget unzip cmake make build-essential git python3 python3-pip +RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz -O - | tar -xj -C /opt/ +RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip + +RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git /opt/mcuboot && pip3 install -r /opt/mcuboot/scripts/requirements.txt +RUN pip3 install adafruit-nrfutil + +USER user +CMD ["/sources/docker/build.sh"] \ No newline at end of file diff --git a/docker/arm64/Dockerfile b/docker/arm64/Dockerfile deleted file mode 100644 index 87c5c62..0000000 --- a/docker/arm64/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM ubuntu:18.04 - -ARG USER_ID -ARG GROUP_ID - -RUN addgroup --gid $GROUP_ID user -RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user - -RUN apt-get update -qq && apt-get install -y wget unzip cmake make build-essential git python3 python3-pip libffi-dev libssl-dev python3-dev -RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2 -O - | tar -xj -C /opt/ -RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip - -RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git /opt/mcuboot && pip3 install -r /opt/mcuboot/scripts/requirements.txt -RUN pip3 install adafruit-nrfutil - -USER user -CMD ["/sources/docker/build.sh"] diff --git a/docker/arm64v8/Dockerfile b/docker/arm64v8/Dockerfile new file mode 100644 index 0000000..87c5c62 --- /dev/null +++ b/docker/arm64v8/Dockerfile @@ -0,0 +1,17 @@ +FROM ubuntu:18.04 + +ARG USER_ID +ARG GROUP_ID + +RUN addgroup --gid $GROUP_ID user +RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user + +RUN apt-get update -qq && apt-get install -y wget unzip cmake make build-essential git python3 python3-pip libffi-dev libssl-dev python3-dev +RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2 -O - | tar -xj -C /opt/ +RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip + +RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git /opt/mcuboot && pip3 install -r /opt/mcuboot/scripts/requirements.txt +RUN pip3 install adafruit-nrfutil + +USER user +CMD ["/sources/docker/build.sh"] diff --git a/docker/x86_64/Dockerfile b/docker/x86_64/Dockerfile deleted file mode 100644 index 7899c8c..0000000 --- a/docker/x86_64/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM ubuntu:18.04 - -ARG USER_ID -ARG GROUP_ID - -RUN addgroup --gid $GROUP_ID user -RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user - -RUN apt-get update -qq && apt-get install -y wget unzip cmake make build-essential git python3 python3-pip -RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz -O - | tar -xj -C /opt/ -RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip - -RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git /opt/mcuboot && pip3 install -r /opt/mcuboot/scripts/requirements.txt -RUN pip3 install adafruit-nrfutil - -USER user -CMD ["/sources/docker/build.sh"] \ No newline at end of file -- cgit v0.10.2 From a205509cbe02a7551f6db95a24b99fb82f668bc7 Mon Sep 17 00:00:00 2001 From: JF Date: Fri, 20 Nov 2020 18:36:39 +0100 Subject: Add new Getting started doc. diff --git a/README.md b/README.md index 1f522b1..3c607e1 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,9 @@ As of now, here is the list of achievements of this project: ## Documentation +### Getting started + - [Flash, upgrade (OTA), time synchronization,...](doc/gettingStarted/gettingStarted.md) + ### Develop - [Generate the fonts and symbols](src/displayapp/fonts/Readme.md) diff --git a/doc/gettingStarted/dfuFile.png b/doc/gettingStarted/dfuFile.png new file mode 100644 index 0000000..f6d112e Binary files /dev/null and b/doc/gettingStarted/dfuFile.png differ diff --git a/doc/gettingStarted/gadgetbridge0.jpg b/doc/gettingStarted/gadgetbridge0.jpg new file mode 100644 index 0000000..7ea2e3c Binary files /dev/null and b/doc/gettingStarted/gadgetbridge0.jpg differ diff --git a/doc/gettingStarted/gadgetbridge1.jpg b/doc/gettingStarted/gadgetbridge1.jpg new file mode 100644 index 0000000..470b0b3 Binary files /dev/null and b/doc/gettingStarted/gadgetbridge1.jpg differ diff --git a/doc/gettingStarted/gadgetbridge2.jpg b/doc/gettingStarted/gadgetbridge2.jpg new file mode 100644 index 0000000..8f75b23 Binary files /dev/null and b/doc/gettingStarted/gadgetbridge2.jpg differ diff --git a/doc/gettingStarted/gadgetbridge3.jpg b/doc/gettingStarted/gadgetbridge3.jpg new file mode 100644 index 0000000..cfb83f5 Binary files /dev/null and b/doc/gettingStarted/gadgetbridge3.jpg differ diff --git a/doc/gettingStarted/gadgetbridge4.jpg b/doc/gettingStarted/gadgetbridge4.jpg new file mode 100644 index 0000000..e41aff0 Binary files /dev/null and b/doc/gettingStarted/gadgetbridge4.jpg differ diff --git a/doc/gettingStarted/gadgetbridge5.jpg b/doc/gettingStarted/gadgetbridge5.jpg new file mode 100644 index 0000000..1ef9f77 Binary files /dev/null and b/doc/gettingStarted/gadgetbridge5.jpg differ diff --git a/doc/gettingStarted/gettingStarted.md b/doc/gettingStarted/gettingStarted.md new file mode 100644 index 0000000..a3aa49a --- /dev/null +++ b/doc/gettingStarted/gettingStarted.md @@ -0,0 +1,101 @@ +# Flash and upgrade InfiniTime +If you just want to flash or upgrade InfiniTime on your PineTime, this page is for you! + +- [InfiniTime releases and versions](#infinitime-releases-and-versions) +- [How to upgrade Over-The-Air (OTA)](#how-to-upgrade-over-the-air-ota) + - [Using Gadgetbridge](#using-gadgetbridge) + - [Using NRFConnect](#Using-nrfconnect) +- [How to flash InfiniTime using the SWD interface](#how-to-flash-infinitime-using-the-swd-interface) + +## InfiniTime releases and versions +All releases of InfiniTime are available on the [release page of the GitHub repo](https://github.com/JF002/Pinetime/releases). + +Versions that are tagged as **RELEASE CANDIDATE** are pre-release versions, that are available for testing before actually releasing a new stable version. If you want to help us debug the project and provide stable versions to other user, you can use them. If you want stable and tested version, you should not flash these release candidate version. + +Release files are available under the *Assets* button. + +## How to upgrade Over-The-Air (OTA) +OTA is the easiest method to upgrade InfiniTime. Note that it's only possible is your PineTime is already running InfiniTime (>= 0.7.1). + +2 companion apps provide support for OTA : + - [Gadgetbridge](https://gadgetbridge.org/) (open source, runs on Android, [available on F-Droid](https://f-droid.org/packages/nodomain.freeyourgadget.gadgetbridge/)). + - [NRFConnect](https://www.nordicsemi.com/Software-and-tools/Development-Tools/nRF-Connect-for-mobile) (close source, runs on Android and iOS). + +Both applications need you to download the **DFU file** of InfiniTime. This file contains the new version of InfiniTime that will be flashed into your device. It's called **dfu-x.y.z.zip** (ex: dfu-0.9.0.zip) in the release note. +![Dfu file](dfuFile.png ) + +### Using Gadgetbridge +Launch Gadgetbridge and tap on the **"+"** button on the bottom right to add a new device: + +![Gadgetbridge 0](gadgetbridge0.jpg) + +Wait for the scan to complete, your PineTime should be detected: + +![Gadgetbridge 1](gadgetbridge1.jpg) + +Tap on it. Gadgdetbridge will pair and connect to your device: + +![Gadgetbridge 2](gadgetbridge2.jpg) + +Now that Gadgetbridge is connected to your PineTime, use a file browser application (I'm using Seafile to browse my NAS) and browse to the DFU file (image-xxx.zip) you downloaded previously. Tap on it and open it using the Gadgetbridge application/firmware installer: + +![Gadgetbridge 3](gadgetbridge3.jpg) + +Read carefully the warning and tap **Install**: + +![Gadgetbridge 4](gadgetbridge4.jpg) + +Wait for the transfer to finish. Your PineTime should reset and reboot with the new version of InfiniTime! + +![Gadgetbridge 5](gadgetbridge5.jpg) + +### Using NRFConnect +Open NRFConnect. Swipe down in the *Scanner* tab and wait for your device to appear: + +![NRFConnect 0](nrfconnect0.jpg) + +Tap on the *Connect* button on the right of your device. NRFConnect will connect to your PineTime and discover its characteristics. Tap on the **DFU** button on the top right: + +![NRFConnect 1](nrfconnect1.jpg) + +Select **Distribution packet (ZIP)**: + +![NRFConnect 2](nrfconnect2.jpg) + +Browse to the DFU file you downloaded previously, the DFU transfer will start automatically. When the transfer is finished, your PineTime will reset and restart on the new version of InfiniTime! + +![NRFConnect 3](nrfconnect3.jpg) + +## How to flash InfiniTime using the SWD interface +Download the files **bootloader.bin**, **image-x.y.z.bin** and **pinetime-graphics-x.y.z.bin** from the release page: + +![Image file](imageFile.png ) + +The bootloader reads a boot logo from the external SPI flash memory. The first step consists in flashing a tool in the MCU that will flash the boot logo into this SPI flash memory. This first step is optional but recommanded (the bootloader will display garbage on screen for a few second if you don't do it). +Using your SWD tool, flash **pinetime-graphics-x.y.z.bin** at offset **0x0000**. Reset the MCU and wait for a few second, until the logo is completely drawn on the display. + +Then, using your SWD tool, flash those file at specific offset: + + - bootloader.bin : **0x0000** + - image-x.y.z.bin : **0x8000** + +Reset and voilà, you're running InfiniTime on your PineTime! + +If you are using OpenOCD with a STLinkV2, you can find more info [on this page](../openOCD.md). + +## How to synchronize the time + +### Using Gadgetbridge +Good news! Gadgetbridge **automatically** synchronizes the time when connecting to your PineTime! + +### Using NRFConnect +You must enable the **CTS** *GATT server* into NRFConnect so that InfiniTime can synchronize the time with your smartphone. + +Launch NRFConnect, tap the sandwish button on the top left and select *Configure GATT server*: + +![NRFConnect CTS 0](nrfconnectcts0.jpg) + + +Tap *Add service* and select the server configuration *Current Time service*. Tap OK and connect to your PineTime, it should automcatically sync the time once the connection is established! + +![NRFConnect CTS 1](nrfconnectcts1.jpg) \ No newline at end of file diff --git a/doc/gettingStarted/imageFile.png b/doc/gettingStarted/imageFile.png new file mode 100644 index 0000000..64e9432 Binary files /dev/null and b/doc/gettingStarted/imageFile.png differ diff --git a/doc/gettingStarted/nrfconnect0.jpg b/doc/gettingStarted/nrfconnect0.jpg new file mode 100644 index 0000000..68f0653 Binary files /dev/null and b/doc/gettingStarted/nrfconnect0.jpg differ diff --git a/doc/gettingStarted/nrfconnect1.jpg b/doc/gettingStarted/nrfconnect1.jpg new file mode 100644 index 0000000..29778c3 Binary files /dev/null and b/doc/gettingStarted/nrfconnect1.jpg differ diff --git a/doc/gettingStarted/nrfconnect2.jpg b/doc/gettingStarted/nrfconnect2.jpg new file mode 100644 index 0000000..3b14a47 Binary files /dev/null and b/doc/gettingStarted/nrfconnect2.jpg differ diff --git a/doc/gettingStarted/nrfconnect3.jpg b/doc/gettingStarted/nrfconnect3.jpg new file mode 100644 index 0000000..e8a5d8e Binary files /dev/null and b/doc/gettingStarted/nrfconnect3.jpg differ diff --git a/doc/gettingStarted/nrfconnectcts0.jpg b/doc/gettingStarted/nrfconnectcts0.jpg new file mode 100644 index 0000000..d42bea2 Binary files /dev/null and b/doc/gettingStarted/nrfconnectcts0.jpg differ diff --git a/doc/gettingStarted/nrfconnectcts1.jpg b/doc/gettingStarted/nrfconnectcts1.jpg new file mode 100644 index 0000000..2a478e9 Binary files /dev/null and b/doc/gettingStarted/nrfconnectcts1.jpg differ -- cgit v0.10.2 From 1d69c79942622eddb531406cabaed77d73bb4c40 Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 19:46:36 +0530 Subject: Addition of new files in MakeList added Paddle.cpp and Paddle.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 254fabc..7e48607 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -333,6 +333,7 @@ list(APPEND SOURCE_FILES displayapp/screens/Meter.cpp displayapp/screens/Gauge.cpp displayapp/screens/InfiniPaint.cpp + displayapp/screens/Paddle.cpp displayapp/screens/DropDownDemo.cpp displayapp/screens/Modal.cpp displayapp/screens/BatteryIcon.cpp @@ -414,6 +415,7 @@ set(INCLUDE_FILES displayapp/screens/Meter.h displayapp/screens/Gauge.h displayapp/screens/InfiniPaint.h + displayapp/screens/Paddle.h displayapp/screens/DropDownDemo.h displayapp/screens/Modal.h displayapp/screens/BatteryIcon.h diff --git a/src/displayapp/Apps.h b/src/displayapp/Apps.h index bfa799b..2722fe0 100644 --- a/src/displayapp/Apps.h +++ b/src/displayapp/Apps.h @@ -2,6 +2,6 @@ namespace Pinetime { namespace Applications { - enum class Apps {None, Launcher, Clock, SysInfo, Meter, Gauge, Brightness, Music, FirmwareValidation, Paint, Notifications}; + enum class Apps {None, Launcher, Clock, SysInfo, Meter, Gauge, Brightness, Music, FirmwareValidation, Paint, Paddle, Notifications}; } } \ No newline at end of file diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index efc042b..c096324 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -11,6 +11,7 @@ #include "displayapp/screens/FirmwareValidation.h" #include "displayapp/screens/Gauge.h" #include "displayapp/screens/InfiniPaint.h" +#include "displayapp/screens/paddle.h" #include "displayapp/screens/Meter.h" #include "displayapp/screens/Music.h" #include "displayapp/screens/Notifications.h" @@ -203,6 +204,7 @@ void DisplayApp::RunningState() { case Apps::Meter: currentScreen.reset(new Screens::Meter(this)); break; case Apps::Gauge: currentScreen.reset(new Screens::Gauge(this)); break; case Apps::Paint: currentScreen.reset(new Screens::InfiniPaint(this, lvgl)); break; + case Apps::Paddle: currentScreen.reset(new Screens::Paddle(this, lvgl)); break; case Apps::Brightness : currentScreen.reset(new Screens::Brightness(this, brightnessController)); break; case Apps::Music : currentScreen.reset(new Screens::Music(this, systemTask.nimble().music())); break; case Apps::FirmwareValidation: currentScreen.reset(new Screens::FirmwareValidation(this, validator)); break; diff --git a/src/displayapp/fonts/Readme.md b/src/displayapp/fonts/Readme.md index a5eec64..6bd13fe 100644 --- a/src/displayapp/fonts/Readme.md +++ b/src/displayapp/fonts/Readme.md @@ -10,7 +10,7 @@ * Bpp : 1 bit-per-pixel * Do not enable font compression and horizontal subpixel hinting * Load the file `JetBrainsMono-Bold.woff` and specify the following range : `0x20-0x7f, 0x410-0x44f` - * Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc` + * Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d` * Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts` Add new symbols: diff --git a/src/displayapp/fonts/jetbrains_mono_bold_20.c b/src/displayapp/fonts/jetbrains_mono_bold_20.c index 183e591..f36cda1 100644 --- a/src/displayapp/fonts/jetbrains_mono_bold_20.c +++ b/src/displayapp/fonts/jetbrains_mono_bold_20.c @@ -847,6 +847,15 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t gylph_bitmap[] = { 0xdf, 0xe0, 0xff, 0x3f, 0xff, 0xfe, 0x3f, 0xff, 0xf8, + /* U+F45D "" */ + 0x0, 0x10, 0x0, 0xf, 0xe0, 0x3, 0xff, 0x80, + 0x7f, 0xfc, 0xf, 0xff, 0xe0, 0xff, 0xfe, 0x7, + 0xff, 0xe2, 0x3f, 0xff, 0x31, 0xff, 0xf3, 0x8f, + 0xff, 0x3e, 0x7f, 0xf3, 0xf3, 0xc2, 0x1f, 0x90, + 0x0, 0xfc, 0x3c, 0x1f, 0xe7, 0xe3, 0xfe, 0xff, + 0x7e, 0xef, 0xff, 0xc6, 0xff, 0x78, 0x7, 0xe3, + 0x0, 0x3c, + /* U+F54B "" */ 0x0, 0xf, 0xf8, 0x1, 0xdf, 0xff, 0x1, 0xef, 0xff, 0xc0, 0xf7, 0xff, 0xf0, 0x7b, 0xff, 0xf8, @@ -1050,8 +1059,9 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 3085, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, {.bitmap_index = 3123, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, {.bitmap_index = 3152, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3201, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3261, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3} + {.bitmap_index = 3201, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3251, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3311, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3} }; /*--------------------- @@ -1061,7 +1071,7 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { static const uint16_t unicode_list_2[] = { 0x0, 0x16, 0x39, 0x68, 0x128, 0x184, 0x1e5, 0x1fb, 0x21d, 0x23f, 0x240, 0x241, 0x242, 0x243, 0x292, 0x293, - 0x3fc, 0x54a, 0x55f + 0x3fc, 0x45c, 0x54a, 0x55f }; /*Collect the unicode lists and glyph_id offsets*/ @@ -1077,7 +1087,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = }, { .range_start = 61441, .range_length = 1376, .glyph_id_start = 160, - .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 19, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 20, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY } }; diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp index 1702697..10f20d2 100644 --- a/src/displayapp/screens/ApplicationList.cpp +++ b/src/displayapp/screens/ApplicationList.cpp @@ -60,7 +60,7 @@ std::unique_ptr ApplicationList::CreateScreen2() { {Symbols::asterisk, Apps::Meter}, {Symbols::paintbrush, Apps::Paint}, {Symbols::info, Apps::Notifications}, - {Symbols::none, Apps::None}, + {Symbols::paddle, Apps::Paddle}, {Symbols::none, Apps::None} } }; diff --git a/src/displayapp/screens/Paddle.cpp b/src/displayapp/screens/Paddle.cpp new file mode 100644 index 0000000..94833ad --- /dev/null +++ b/src/displayapp/screens/Paddle.cpp @@ -0,0 +1,100 @@ +#include "Paddle.h" +#include "../DisplayApp.h" +#include "../LittleVgl.h" + +using namespace Pinetime::Applications::Screens; +extern lv_font_t jetbrains_mono_extrabold_compressed; +extern lv_font_t jetbrains_mono_bold_20; + +Paddle::Paddle(Pinetime::Applications::DisplayApp *app, Pinetime::Components::LittleVgl& lvgl) : Screen(app){ + app->SetTouchMode(DisplayApp::TouchModes::Polling); + + points = lv_label_create(lv_scr_act(), NULL); + lv_label_set_text(points, "0"); + lv_obj_align(points, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 0); + + paddle.header.always_zero = 0; + paddle.header.w = 4; + paddle.header.h = 60; + paddle.data_size = 60 * 4 * LV_COLOR_SIZE / 8; + paddle.header.cf = LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED; + paddle.data = paddle_map; + paddle_image = lv_img_create(lv_scr_act(), NULL); + lv_img_set_src(paddle_image, &paddle); + + ball.header.always_zero = 0; + ball.header.w = 24; + ball.header.h = 24; + ball.data_size = 24 * 24 * LV_COLOR_SIZE / 8; + ball.header.cf = LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED; + ball.data = ball_map; + ball_image = lv_img_create(lv_scr_act(), NULL); + lv_img_set_src(ball_image, &ball); +} + +Paddle::~Paddle() { + // Reset the touchmode + app->SetTouchMode(DisplayApp::TouchModes::Gestures); + lv_obj_clean(lv_scr_act()); +} + +bool Paddle::Refresh() { + + if((counter++ % 5) == 0){ + + counter = 0; + + ball_x += dx; + ball_y += dy; + + lv_obj_set_pos(ball_image, ball_x, ball_y); + + //checks if it has touched the sides (floor and ceiling) + if(ball_y <= 0 || ball_y >= 215){ + dy *= -1; + } + + //checks if it has touched the side (left side) + if(ball_x >= 215){ + dx *= -1; + } + + //checks if it is in the position of the paddle + if(ball_y >= (y_paddle_bottom + 16) && ball_y <= (y_paddle_top - 8)){ + if(ball_x >= 0 && ball_x < 4){ + lv_obj_set_pos(ball_image, 5, ball_y); + dx *= -1; + score++; + } + } + + //checks if it has gone behind the paddle + else if(ball_x <= -40){ + ball_x = 107; + ball_y = 107; + score = 0; + } + sprintf(Val, "%d", score); + lv_label_set_text(points, Val); + } + return running; +} + +bool Paddle::OnButtonPushed() { + running = false; + return true; +} + + +bool Paddle::OnTouchEvent(Pinetime::Applications::TouchEvents event) { + return true; +} + +bool Paddle::OnTouchEvent(uint16_t x, uint16_t y) { + + lv_obj_set_pos(paddle_image, 0, y - 30); // sets the center paddle pos. (30px offset) with the the y_coordinate of the finger and defaults the x_coordinate to 0 + y_paddle_top = y - 30; // refreshes the upper extreme of the paddle + y_paddle_bottom = y + 30; // refreshes the lower extreme of the paddle + + return true; +} diff --git a/src/displayapp/screens/Paddle.h b/src/displayapp/screens/Paddle.h new file mode 100644 index 0000000..5e85866 --- /dev/null +++ b/src/displayapp/screens/Paddle.h @@ -0,0 +1,142 @@ +#pragma once + +#include +#include +#include "Screen.h" + +namespace Pinetime { + namespace Applications { + namespace Screens { + + class Paddle : public Screen{ + public: + Paddle(DisplayApp* app, Pinetime::Components::LittleVgl& lvgl); + ~Paddle() override; + + bool Refresh() override; + bool OnButtonPushed() override; + bool OnTouchEvent(TouchEvents event) override; + bool OnTouchEvent(uint16_t x, uint16_t y) override; + + private: + const int x_paddle_bottom = 0; + int y_paddle_bottom = 90; // bottom extreme of the paddle + + const int x_paddle_top = 0; + int y_paddle_top = 150; //top extreme of the paddle + + int ball_x = 107; // Initial x_coordinate for the ball (12px offset from the center to counteract the ball's 24px size) + int ball_y = 107; // Initial y_coordinate for the ball + + int dx = 2; // Velocity of the ball in the x_coordinate + int dy = 3; // Velocity of the ball in the y_coordinate + + int counter = 0; // init Frame refresh limit counter + int score = 0; + + char Val[10]; + + lv_obj_t* points; + lv_obj_t *paddle_image; // pointer to paddle image + lv_obj_t *ball_image; // pointer to ball image + + bool running = true; + }; + } + } +} + +static lv_img_dsc_t paddle; +static lv_img_dsc_t ball; + +// Image data + +const uint8_t paddle_map[] = { + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff + }; + +const uint8_t ball_map[] = { + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, + 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, + 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, + 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, +}; diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h index aeea324..0b713f2 100644 --- a/src/displayapp/screens/Symbols.h +++ b/src/displayapp/screens/Symbols.h @@ -24,7 +24,8 @@ namespace Pinetime { static constexpr const char* tachometer = "\xEF\x8F\xBD"; static constexpr const char* asterisk = "\xEF\x81\xA9"; static constexpr const char* paintbrush = "\xEF\x87\xBC"; + static constexpr const char* paddle = "\xEF\x86\x85"; } } } -} \ No newline at end of file +} -- cgit v0.10.2 From adfec51230ab44450da67e675eba494b720c8e4d Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:01:03 +0530 Subject: Update ApplicationList.cpp added paddle app diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp index 10f20d2..ddb98e5 100644 --- a/src/displayapp/screens/ApplicationList.cpp +++ b/src/displayapp/screens/ApplicationList.cpp @@ -81,3 +81,4 @@ std::unique_ptr ApplicationList::CreateScreen3() { return std::unique_ptr(new Screens::Tile(app, applications)); } + -- cgit v0.10.2 From 251dddb0bf5c5635d2b2838f22db9492c4c2109e Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:01:44 +0530 Subject: Update Symbols.h added paddle symbol diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h index 0b713f2..a5191d5 100644 --- a/src/displayapp/screens/Symbols.h +++ b/src/displayapp/screens/Symbols.h @@ -29,3 +29,4 @@ namespace Pinetime { } } } + -- cgit v0.10.2 From 29989b323e01693f40991e0e7297b734e97da267 Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:02:08 +0530 Subject: Update Readme.md added range of paddle symbol diff --git a/src/displayapp/fonts/Readme.md b/src/displayapp/fonts/Readme.md index 6bd13fe..314cb19 100644 --- a/src/displayapp/fonts/Readme.md +++ b/src/displayapp/fonts/Readme.md @@ -21,3 +21,4 @@ Add new symbols: ``` static constex char* newSymbol = "\xEF\x86\x85"; ``` + -- cgit v0.10.2 From 96346b988466bab14c9fe94211f3b31f198185a2 Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:02:35 +0530 Subject: Update jetbrains_mono_bold_20.c added paddle symbol in font diff --git a/src/displayapp/fonts/jetbrains_mono_bold_20.c b/src/displayapp/fonts/jetbrains_mono_bold_20.c index f36cda1..620df7c 100644 --- a/src/displayapp/fonts/jetbrains_mono_bold_20.c +++ b/src/displayapp/fonts/jetbrains_mono_bold_20.c @@ -1134,4 +1134,3 @@ lv_font_t jetbrains_mono_bold_20 = { #endif /*#if JETBRAINS_MONO_BOLD_20*/ - -- cgit v0.10.2 From ed340963204e6f25587d9eb074f2ec01ebd0bb34 Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:02:58 +0530 Subject: Update Paddle.h created Paddle.h diff --git a/src/displayapp/screens/Paddle.h b/src/displayapp/screens/Paddle.h index 5e85866..09a188b 100644 --- a/src/displayapp/screens/Paddle.h +++ b/src/displayapp/screens/Paddle.h @@ -140,3 +140,4 @@ const uint8_t ball_map[] = { 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, }; + -- cgit v0.10.2 From 4f41d4d85465f7cfedd92c45a0bc6d7f2d60dad3 Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:03:11 +0530 Subject: Update Paddle.cpp create Paddle.cpp diff --git a/src/displayapp/screens/Paddle.cpp b/src/displayapp/screens/Paddle.cpp index 94833ad..6695257 100644 --- a/src/displayapp/screens/Paddle.cpp +++ b/src/displayapp/screens/Paddle.cpp @@ -98,3 +98,4 @@ bool Paddle::OnTouchEvent(uint16_t x, uint16_t y) { return true; } + -- cgit v0.10.2 From 253a86bb8c769cd5e08d1a0d096b24a89319495d Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:03:45 +0530 Subject: Update Apps.h added Paddle app diff --git a/src/displayapp/Apps.h b/src/displayapp/Apps.h index 2722fe0..7e4afa2 100644 --- a/src/displayapp/Apps.h +++ b/src/displayapp/Apps.h @@ -4,4 +4,4 @@ namespace Pinetime { namespace Applications { enum class Apps {None, Launcher, Clock, SysInfo, Meter, Gauge, Brightness, Music, FirmwareValidation, Paint, Paddle, Notifications}; } -} \ No newline at end of file +} -- cgit v0.10.2 From 91b37f8de0993497552f91d5b4c318ed59ca305a Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:04:37 +0530 Subject: Update DisplayApp.cpp added Paddle header and paddle app screen diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index c096324..d9bcfef 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -277,3 +277,4 @@ void DisplayApp::SetFullRefresh(DisplayApp::FullRefreshDirections direction) { void DisplayApp::SetTouchMode(DisplayApp::TouchModes mode) { touchMode = mode; } + -- cgit v0.10.2 From 09a94ee2b842e7a865cfaa1f04ba4db29879b1ea Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:17:22 +0530 Subject: Update DisplayApp.cpp fixed file typo diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index d9bcfef..7282319 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -11,7 +11,7 @@ #include "displayapp/screens/FirmwareValidation.h" #include "displayapp/screens/Gauge.h" #include "displayapp/screens/InfiniPaint.h" -#include "displayapp/screens/paddle.h" +#include "displayapp/screens/Paddle.h" #include "displayapp/screens/Meter.h" #include "displayapp/screens/Music.h" #include "displayapp/screens/Notifications.h" -- cgit v0.10.2 From ad1a99acac75dbcc5dd248cafdb67eadb04a67ae Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:57:54 +0530 Subject: Update Paddle.h bugfix: add missing class diff --git a/src/displayapp/screens/Paddle.h b/src/displayapp/screens/Paddle.h index 09a188b..6e91041 100644 --- a/src/displayapp/screens/Paddle.h +++ b/src/displayapp/screens/Paddle.h @@ -5,6 +5,9 @@ #include "Screen.h" namespace Pinetime { + namespace Components { + class LittleVgl; + } namespace Applications { namespace Screens { @@ -19,6 +22,8 @@ namespace Pinetime { bool OnTouchEvent(uint16_t x, uint16_t y) override; private: + Pinetime::Components::LittleVgl& lvgl; + const int x_paddle_bottom = 0; int y_paddle_bottom = 90; // bottom extreme of the paddle @@ -139,5 +144,4 @@ const uint8_t ball_map[] = { 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, -}; - +}; -- cgit v0.10.2 From 418d857308a60cf19a5002a6291f73b48445310e Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Thu, 3 Dec 2020 20:59:22 +0530 Subject: Update Paddle.cpp bugfix: add missing class diff --git a/src/displayapp/screens/Paddle.cpp b/src/displayapp/screens/Paddle.cpp index 6695257..aaba8d9 100644 --- a/src/displayapp/screens/Paddle.cpp +++ b/src/displayapp/screens/Paddle.cpp @@ -6,7 +6,7 @@ using namespace Pinetime::Applications::Screens; extern lv_font_t jetbrains_mono_extrabold_compressed; extern lv_font_t jetbrains_mono_bold_20; -Paddle::Paddle(Pinetime::Applications::DisplayApp *app, Pinetime::Components::LittleVgl& lvgl) : Screen(app){ +Paddle::Paddle(Pinetime::Applications::DisplayApp* app, Pinetime::Components::LittleVgl& lvgl) : Screen(app), lvgl{lvgl} { app->SetTouchMode(DisplayApp::TouchModes::Polling); points = lv_label_create(lv_scr_act(), NULL); @@ -98,4 +98,3 @@ bool Paddle::OnTouchEvent(uint16_t x, uint16_t y) { return true; } - -- cgit v0.10.2 From a701ef23d80aa3d7fc825eca942b3d4786e71d8f Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Fri, 4 Dec 2020 14:09:12 +0530 Subject: Update Symbols.h change symbol to correct vale diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h index a5191d5..b66b5fa 100644 --- a/src/displayapp/screens/Symbols.h +++ b/src/displayapp/screens/Symbols.h @@ -24,7 +24,7 @@ namespace Pinetime { static constexpr const char* tachometer = "\xEF\x8F\xBD"; static constexpr const char* asterisk = "\xEF\x81\xA9"; static constexpr const char* paintbrush = "\xEF\x87\xBC"; - static constexpr const char* paddle = "\xEF\x86\x85"; + static constexpr const char* paddle = "\xEF\x91\x9D"; } } } -- cgit v0.10.2 From 6b2dbafd6caad9eb49219a86860c16861f9ea4ab Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Tue, 8 Dec 2020 09:50:44 +0530 Subject: Update Paddle.h add changes from PR diff --git a/src/displayapp/screens/Paddle.h b/src/displayapp/screens/Paddle.h index 6e91041..ab57584 100644 --- a/src/displayapp/screens/Paddle.h +++ b/src/displayapp/screens/Paddle.h @@ -24,14 +24,11 @@ namespace Pinetime { private: Pinetime::Components::LittleVgl& lvgl; - const int x_paddle_bottom = 0; - int y_paddle_bottom = 90; // bottom extreme of the paddle + int PaddleBottomY = 90; // bottom extreme of the paddle + int PaddleTopY = 150; //top extreme of the paddle - const int x_paddle_top = 0; - int y_paddle_top = 150; //top extreme of the paddle - - int ball_x = 107; // Initial x_coordinate for the ball (12px offset from the center to counteract the ball's 24px size) - int ball_y = 107; // Initial y_coordinate for the ball + int BallX = 107; // Initial x_coordinate for the ball (12px offset from the center to counteract the ball's 24px size) + int BallY = 107; // Initial y_coordinate for the ball int dx = 2; // Velocity of the ball in the x_coordinate int dy = 3; // Velocity of the ball in the y_coordinate @@ -39,109 +36,17 @@ namespace Pinetime { int counter = 0; // init Frame refresh limit counter int score = 0; - char Val[10]; + char scoreStr[10]; + + lv_img_dsc_t paddle; + lv_img_dsc_t ball; lv_obj_t* points; - lv_obj_t *paddle_image; // pointer to paddle image - lv_obj_t *ball_image; // pointer to ball image + lv_obj_t* paddle_image; // pointer to paddle image + lv_obj_t* ball_image; // pointer to ball image bool running = true; }; } } } - -static lv_img_dsc_t paddle; -static lv_img_dsc_t ball; - -// Image data - -const uint8_t paddle_map[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff - }; - -const uint8_t ball_map[] = { - 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, - 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, - 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, - 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, - 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, -}; -- cgit v0.10.2 From ea4d2560cf6e0a726ae0d2fa037fe52cfa9a948a Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Tue, 8 Dec 2020 10:06:30 +0530 Subject: Update Paddle.cpp added changes from PR diff --git a/src/displayapp/screens/Paddle.cpp b/src/displayapp/screens/Paddle.cpp index aaba8d9..36b8173 100644 --- a/src/displayapp/screens/Paddle.cpp +++ b/src/displayapp/screens/Paddle.cpp @@ -6,20 +6,115 @@ using namespace Pinetime::Applications::Screens; extern lv_font_t jetbrains_mono_extrabold_compressed; extern lv_font_t jetbrains_mono_bold_20; +namespace{ +const uint8_t paddle_map[] = { + 0xfc, 0xfe, 0xfc, 0xff, /*Color of index 0*/ + 0xff, 0xff, 0xff, 0xff, /*Color of index 1*/ + + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 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 uint8_t ball_map[] = { + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, + 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, + 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, + 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, + 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, 0x6f, 0xed, +}; +} + Paddle::Paddle(Pinetime::Applications::DisplayApp* app, Pinetime::Components::LittleVgl& lvgl) : Screen(app), lvgl{lvgl} { app->SetTouchMode(DisplayApp::TouchModes::Polling); - points = lv_label_create(lv_scr_act(), NULL); + points = lv_label_create(lv_scr_act(), nullptr); lv_label_set_text(points, "0"); lv_obj_align(points, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 0); paddle.header.always_zero = 0; paddle.header.w = 4; paddle.header.h = 60; - paddle.data_size = 60 * 4 * LV_COLOR_SIZE / 8; - paddle.header.cf = LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED; + paddle.data_size = 68; + paddle.header.cf = LV_IMG_CF_INDEXED_1BIT; paddle.data = paddle_map; - paddle_image = lv_img_create(lv_scr_act(), NULL); + paddle_image = lv_img_create(lv_scr_act(), nullptr); lv_img_set_src(paddle_image, &paddle); ball.header.always_zero = 0; @@ -28,7 +123,7 @@ Paddle::Paddle(Pinetime::Applications::DisplayApp* app, Pinetime::Components::Li ball.data_size = 24 * 24 * LV_COLOR_SIZE / 8; ball.header.cf = LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED; ball.data = ball_map; - ball_image = lv_img_create(lv_scr_act(), NULL); + ball_image = lv_img_create(lv_scr_act(), nullptr); lv_img_set_src(ball_image, &ball); } @@ -44,38 +139,38 @@ bool Paddle::Refresh() { counter = 0; - ball_x += dx; - ball_y += dy; + BallX += dx; + BallY += dy; - lv_obj_set_pos(ball_image, ball_x, ball_y); + lv_obj_set_pos(ball_image, BallX, BallY); //checks if it has touched the sides (floor and ceiling) - if(ball_y <= 0 || ball_y >= 215){ + if(BallY <= 0 || BallY >= 215){ dy *= -1; } //checks if it has touched the side (left side) - if(ball_x >= 215){ + if(BallX >= 215){ dx *= -1; } //checks if it is in the position of the paddle - if(ball_y >= (y_paddle_bottom + 16) && ball_y <= (y_paddle_top - 8)){ - if(ball_x >= 0 && ball_x < 4){ - lv_obj_set_pos(ball_image, 5, ball_y); + if(BallY >= (PaddleBottomY + 16) && BallY <= (PaddleTopY - 8)){ + if(BallX >= 0 && BallX < 4){ + lv_obj_set_pos(ball_image, 5, BallY); dx *= -1; score++; } } //checks if it has gone behind the paddle - else if(ball_x <= -40){ - ball_x = 107; - ball_y = 107; + else if(BallX <= -40){ + BallX = 107; + BallY = 107; score = 0; } - sprintf(Val, "%d", score); - lv_label_set_text(points, Val); + sprintf(scoreStr, "%d", score); + lv_label_set_text(points, scoreStr); } return running; } @@ -85,7 +180,6 @@ bool Paddle::OnButtonPushed() { return true; } - bool Paddle::OnTouchEvent(Pinetime::Applications::TouchEvents event) { return true; } @@ -93,8 +187,8 @@ bool Paddle::OnTouchEvent(Pinetime::Applications::TouchEvents event) { bool Paddle::OnTouchEvent(uint16_t x, uint16_t y) { lv_obj_set_pos(paddle_image, 0, y - 30); // sets the center paddle pos. (30px offset) with the the y_coordinate of the finger and defaults the x_coordinate to 0 - y_paddle_top = y - 30; // refreshes the upper extreme of the paddle - y_paddle_bottom = y + 30; // refreshes the lower extreme of the paddle + PaddleTopY = y - 30; // refreshes the upper extreme of the paddle + PaddleBottomY = y + 30; // refreshes the lower extreme of the paddle return true; } -- cgit v0.10.2 From d50912a8373532d3e995c32296249bf90e8e939f Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sat, 12 Dec 2020 12:33:38 +1000 Subject: Reference specific architectures diff --git a/docker/amd64/Dockerfile b/docker/amd64/Dockerfile index 7899c8c..1b7932f 100644 --- a/docker/amd64/Dockerfile +++ b/docker/amd64/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM amd64/ubuntu:18.04 ARG USER_ID ARG GROUP_ID diff --git a/docker/arm64v8/Dockerfile b/docker/arm64v8/Dockerfile index 87c5c62..c95f625 100644 --- a/docker/arm64v8/Dockerfile +++ b/docker/arm64v8/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:18.04 +FROM arm64v8/ubuntu:18.04 ARG USER_ID ARG GROUP_ID -- cgit v0.10.2 From 8a6b828ab750b6fb8682534aea45ed1fdc3610d0 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sat, 12 Dec 2020 12:56:21 +1000 Subject: Move user block to reduce layer change breakage + tweaks diff --git a/docker/amd64/Dockerfile b/docker/amd64/Dockerfile index 1b7932f..0ea2c0a 100644 --- a/docker/amd64/Dockerfile +++ b/docker/amd64/Dockerfile @@ -1,11 +1,5 @@ FROM amd64/ubuntu:18.04 -ARG USER_ID -ARG GROUP_ID - -RUN addgroup --gid $GROUP_ID user -RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user - RUN apt-get update -qq && apt-get install -y wget unzip cmake make build-essential git python3 python3-pip RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz -O - | tar -xj -C /opt/ RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip @@ -13,5 +7,9 @@ RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_ RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git /opt/mcuboot && pip3 install -r /opt/mcuboot/scripts/requirements.txt RUN pip3 install adafruit-nrfutil -USER user +ARG PUID=1000 +ARG PGID=1000 +RUN groupadd --system --gid $PGID infinitime && useradd --system --uid $PUID --gid $PGID infinitime + +USER infinitime:infinitime CMD ["/sources/docker/build.sh"] \ No newline at end of file diff --git a/docker/arm64v8/Dockerfile b/docker/arm64v8/Dockerfile index c95f625..8b9e451 100644 --- a/docker/arm64v8/Dockerfile +++ b/docker/arm64v8/Dockerfile @@ -1,11 +1,5 @@ FROM arm64v8/ubuntu:18.04 -ARG USER_ID -ARG GROUP_ID - -RUN addgroup --gid $GROUP_ID user -RUN adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user - RUN apt-get update -qq && apt-get install -y wget unzip cmake make build-essential git python3 python3-pip libffi-dev libssl-dev python3-dev RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2 -O - | tar -xj -C /opt/ RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip @@ -13,5 +7,9 @@ RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_ RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git /opt/mcuboot && pip3 install -r /opt/mcuboot/scripts/requirements.txt RUN pip3 install adafruit-nrfutil -USER user +ARG PUID=1000 +ARG PGID=1000 +RUN groupadd --system --gid $PGID infinitime && useradd --system --uid $PUID --gid $PGID infinitime + +USER infinitime:infinitime CMD ["/sources/docker/build.sh"] -- cgit v0.10.2 From 1aaa906a78e7265669cd0b8f227885e010fd0173 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sat, 12 Dec 2020 12:58:14 +1000 Subject: Expand update block for readability and add cleanup diff --git a/docker/amd64/Dockerfile b/docker/amd64/Dockerfile index 0ea2c0a..c5bccb1 100644 --- a/docker/amd64/Dockerfile +++ b/docker/amd64/Dockerfile @@ -1,6 +1,19 @@ FROM amd64/ubuntu:18.04 -RUN apt-get update -qq && apt-get install -y wget unzip cmake make build-essential git python3 python3-pip +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get update -qq \ + && apt-get install -y \ + build-essential \ + cmake \ + git \ + make \ + python3 \ + python3-pip \ + tar \ + unzip \ + wget \ + && rm -rf /var/cache/apt/* /var/lib/apt/lists/* + RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz -O - | tar -xj -C /opt/ RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip diff --git a/docker/arm64v8/Dockerfile b/docker/arm64v8/Dockerfile index 8b9e451..9de2b90 100644 --- a/docker/arm64v8/Dockerfile +++ b/docker/arm64v8/Dockerfile @@ -1,6 +1,22 @@ FROM arm64v8/ubuntu:18.04 -RUN apt-get update -qq && apt-get install -y wget unzip cmake make build-essential git python3 python3-pip libffi-dev libssl-dev python3-dev +ENV DEBIAN_FRONTEND=noninteractive +RUN apt-get update -qq \ + && apt-get install -y \ + build-essential \ + cmake \ + git \ + libffi-dev \ + libssl-dev \ + make \ + python3 \ + python3-dev \ + python3-pip \ + tar \ + unzip \ + wget \ + && rm -rf /var/cache/apt/* /var/lib/apt/lists/* + RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2 -O - | tar -xj -C /opt/ RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip -- cgit v0.10.2 From 3eab95ea4ecfc31bef27c20e713ec1af24db2508 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sat, 12 Dec 2020 13:02:55 +1000 Subject: Add cleanup and make download stages more readable diff --git a/docker/amd64/Dockerfile b/docker/amd64/Dockerfile index c5bccb1..5f3c77e 100644 --- a/docker/amd64/Dockerfile +++ b/docker/amd64/Dockerfile @@ -14,10 +14,16 @@ RUN apt-get update -qq \ wget \ && rm -rf /var/cache/apt/* /var/lib/apt/lists/* -RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz -O - | tar -xj -C /opt/ -RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip +RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz \ + && tar -xjf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz -C /opt \ + && rm gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz + +RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip \ + && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip + +RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git /opt/mcuboot \ + && pip3 install -r /opt/mcuboot/scripts/requirements.txt -RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git /opt/mcuboot && pip3 install -r /opt/mcuboot/scripts/requirements.txt RUN pip3 install adafruit-nrfutil ARG PUID=1000 @@ -25,4 +31,4 @@ ARG PGID=1000 RUN groupadd --system --gid $PGID infinitime && useradd --system --uid $PUID --gid $PGID infinitime USER infinitime:infinitime -CMD ["/sources/docker/build.sh"] \ No newline at end of file +CMD ["/sources/docker/build.sh"] diff --git a/docker/arm64v8/Dockerfile b/docker/arm64v8/Dockerfile index 9de2b90..cea2b83 100644 --- a/docker/arm64v8/Dockerfile +++ b/docker/arm64v8/Dockerfile @@ -17,10 +17,16 @@ RUN apt-get update -qq \ wget \ && rm -rf /var/cache/apt/* /var/lib/apt/lists/* -RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2 -O - | tar -xj -C /opt/ -RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip +RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2 \ + && tar -xjf gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2 -C /opt \ + && rm gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2 + +RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip \ + && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ \ + && rm nRF5_SDK_15.3.0_59ac345.zip RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git /opt/mcuboot && pip3 install -r /opt/mcuboot/scripts/requirements.txt + RUN pip3 install adafruit-nrfutil ARG PUID=1000 -- cgit v0.10.2 From edc88b6042d409a5d197922bea2d12f39f71a7cd Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sun, 13 Dec 2020 09:50:20 +1000 Subject: Add Docker Hub info to docs and tweak instructions diff --git a/doc/buildWithDocker.md b/doc/buildWithDocker.md index 705c6d9..7afd8db 100644 --- a/doc/buildWithDocker.md +++ b/doc/buildWithDocker.md @@ -1,17 +1,49 @@ # Build the project using Docker -A [Docker image (Dockerfile)](../docker) containing all the build environment is available for X86_64 and AMD64 architectures. This image makes the build of the firmware and the generation of the DFU file for OTA. +There are [Docker images (Dockerfile)](../docker) containing the build environment for AMD64 (x86_64) and ARM64 architectures. These images make the build of the firmware and the generation of the DFU file for OTA quite easy, as well as preventing clashes with any other toolchains or development environments you may have installed. -## Build the image -The image is not (yet) available on DockerHub, you need to build it yourself, which is quite easy. The following commands must be run from the root of the project. +## Using the image from Docker Hub + +The image is avaiable via Docker Hub for both the amd64 and arm64v8 architectures at via [pfeerick/infinitime-build](https://hub.docker.com/repository/docker/pfeerick/infinitime-build). + +It can be pulled (downloaded) using the following command: -If you are running on a x86_64 computer : ``` -docker image build -t infinitime-build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) docker/x86_64/ +docker pull pfeerick/infinitime-build ``` -And if your are running on an ARM64 device (tested on RaspberryPi4 and Pine64 PineBookPro): +The default `latest` tag *should* automatically identify the correct image architecture, but if for some reason Docker does not, you can specify it manually: + +* For AMD64 (x86_64) systems: `docker pull pfeerick/infinitime-build:amd64` + +* For ARM64v8 (ARM64/aarch64) systems: `docker pull pfeerick/infinitime-build:arm64v8` + +The Docker Hub images are built using 1000:1000 for the user id and group id. If this is different to your user or group ids (run `id -u` and `id -g` to find out what your id values are if you are unsure), you will need to override them via the `--user` parameter in order to prevent permission errors during and after compilation. + +The below example will run the container, setting the user and group ids automatically: + +``` +docker run --rm -v :/sources --user $(id -u):$(id -g) infinitime-build +``` + +Or you can specify your user id and group id (by number, not by name) directly: + ``` -docker image build -t infinitime-build --build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g) docker/arm64/ +docker run --rm -v :/sources --user uid_num:gid_num infinitime-build +``` + +## Build the image yourself +Building the docker images yourself is quite easy. The following commands must be run from the root of the project. + +The `PUID` and `PGID` build arguments are used to set the user id and group id for use in the container, meaning you will not need to specify it later unless on a multi-user system, or they change for some reason. Specifying them is not mandatory, as this can be over-ridden at build time via the `--user` flag, but doing so will make it so the command you need to run later is just a bit shorter. In the below examples, they are being set to your current user id and group id automatically, but you can also specify them manually, but they must be specified by number, not by name. + +If you are running on a AMD64 (x86_64) computer: +``` +docker image build -t infinitime-build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) docker/amd64/ +``` + +If you are running on an ARM64 computer (tested on Raspberry Pi 4 and Pine64 Pinebook Pro): +``` +docker image build -t infinitime-build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) docker/arm64v8/ ``` This operation will take some time. It builds a Docker image based on Ubuntu, install some packages, download the ARM toolchain, the NRF SDK, MCUBoot and adafruit-nrfutil. @@ -20,14 +52,18 @@ When this is done, a new image named *infinitime-build* is available. ## Run a container to build the project: +The command to run the container is essentially the same, regardless of if you built it yourself from the dockerfiles, or are using the Docker hub image: + ``` docker run --rm -v :/sources infinitime-build ``` +This will start a container (removing it when finished), build the firmware and generate the MCUBoot image and DFU file. The output of the build is stored in `/built/output`. + Replace ** by the path of the root of the project on your computer. For example: ``` docker run --rm -v /home/jf/git/PineTime:/sources infinitime-build ``` -This will start a container, build the firmware and generate the MCUBoot image and the DFU file. The output of the build is stored in **/built/output**. \ No newline at end of file +If you encounter permission errors (due to being logged in as a different user, changed user id, running the docker hub image, etc.), see the `--user` parameter mentioned above in the Docker Hub image section to see if this resolves the issue for you. -- cgit v0.10.2 From 72960ef8803595c76350471156240e324e87b3e3 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Sun, 13 Dec 2020 10:02:08 +1000 Subject: Minor changes to docker doc wording diff --git a/doc/buildWithDocker.md b/doc/buildWithDocker.md index 7afd8db..34bf50d 100644 --- a/doc/buildWithDocker.md +++ b/doc/buildWithDocker.md @@ -3,7 +3,7 @@ There are [Docker images (Dockerfile)](../docker) containing the build environme ## Using the image from Docker Hub -The image is avaiable via Docker Hub for both the amd64 and arm64v8 architectures at via [pfeerick/infinitime-build](https://hub.docker.com/repository/docker/pfeerick/infinitime-build). +The image is avaiable via Docker Hub for both the amd64 and arm64v8 architectures at [pfeerick/infinitime-build](https://hub.docker.com/repository/docker/pfeerick/infinitime-build). It can be pulled (downloaded) using the following command: @@ -34,7 +34,7 @@ docker run --rm -v :/sources --user uid_num:gid_num infinitime-bui ## Build the image yourself Building the docker images yourself is quite easy. The following commands must be run from the root of the project. -The `PUID` and `PGID` build arguments are used to set the user id and group id for use in the container, meaning you will not need to specify it later unless on a multi-user system, or they change for some reason. Specifying them is not mandatory, as this can be over-ridden at build time via the `--user` flag, but doing so will make it so the command you need to run later is just a bit shorter. In the below examples, they are being set to your current user id and group id automatically, but you can also specify them manually, but they must be specified by number, not by name. +The `PUID` and `PGID` build arguments are used to set the user and group ids used in the container, meaning you will not need to specify it later unless they change for some reason. Specifying them is not mandatory, as this can be over-ridden at build time via the `--user` flag, but doing so will make the command you need to run later a bit shorter. In the below examples, they are set to your current user id and group id automatically. You can specify them manually, but they must be specified by number, not by name. If you are running on a AMD64 (x86_64) computer: ``` @@ -46,13 +46,13 @@ If you are running on an ARM64 computer (tested on Raspberry Pi 4 and Pine64 Pin docker image build -t infinitime-build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) docker/arm64v8/ ``` -This operation will take some time. It builds a Docker image based on Ubuntu, install some packages, download the ARM toolchain, the NRF SDK, MCUBoot and adafruit-nrfutil. +This operation will take some time, as it builds a Docker image based on Ubuntu, installs some required packages, downloads the ARM toolchain, the NRF SDK, MCUBoot and adafruit-nrfutil. When this is done, a new image named *infinitime-build* is available. ## Run a container to build the project: -The command to run the container is essentially the same, regardless of if you built it yourself from the dockerfiles, or are using the Docker hub image: +The command to run the container is essentially the same, regardless of whether you built it yourself from the dockerfiles, or are using the Docker hub image: ``` docker run --rm -v :/sources infinitime-build -- cgit v0.10.2 From aa45f2517413d6ce81611d8fb6fb2b4924579e46 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Tue, 15 Dec 2020 20:17:24 +1000 Subject: Missed username for some Docker Hub commands diff --git a/doc/buildWithDocker.md b/doc/buildWithDocker.md index 34bf50d..1db5e7a 100644 --- a/doc/buildWithDocker.md +++ b/doc/buildWithDocker.md @@ -22,13 +22,13 @@ The Docker Hub images are built using 1000:1000 for the user id and group id. If The below example will run the container, setting the user and group ids automatically: ``` -docker run --rm -v :/sources --user $(id -u):$(id -g) infinitime-build +docker run --rm -v :/sources --user $(id -u):$(id -g) pfeerick/infinitime-build ``` Or you can specify your user id and group id (by number, not by name) directly: ``` -docker run --rm -v :/sources --user uid_num:gid_num infinitime-build +docker run --rm -v :/sources --user uid_num:gid_num pfeerick/infinitime-build ``` ## Build the image yourself @@ -52,7 +52,7 @@ When this is done, a new image named *infinitime-build* is available. ## Run a container to build the project: -The command to run the container is essentially the same, regardless of whether you built it yourself from the dockerfiles, or are using the Docker hub image: +The command to run the container is essentially the same, regardless of whether you built it yourself from the dockerfiles, or are using the Docker Hub images (use `pfeerick/infinitime-build` instead of `infinitime-build` for the later): ``` docker run --rm -v :/sources infinitime-build -- cgit v0.10.2 From b098d27d086733fad3d6c4e04385b73e0c123ef8 Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Sun, 20 Dec 2020 09:23:31 +0530 Subject: Update Paddle.cpp tranparent paddle bug fix. diff --git a/src/displayapp/screens/Paddle.cpp b/src/displayapp/screens/Paddle.cpp index 36b8173..14ae220 100644 --- a/src/displayapp/screens/Paddle.cpp +++ b/src/displayapp/screens/Paddle.cpp @@ -155,7 +155,7 @@ bool Paddle::Refresh() { } //checks if it is in the position of the paddle - if(BallY >= (PaddleBottomY + 16) && BallY <= (PaddleTopY - 8)){ + if(BallY <= (PaddleBottomY + 16) && BallY >= (PaddleTopY - 8)){ if(BallX >= 0 && BallX < 4){ lv_obj_set_pos(ball_image, 5, BallY); dx *= -1; -- cgit v0.10.2 From 020840e04fb922db509a9f1289e1c856801566da Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Sun, 20 Dec 2020 09:28:51 +0530 Subject: Update Paddle.h fix uppercase diff --git a/src/displayapp/screens/Paddle.h b/src/displayapp/screens/Paddle.h index ab57584..358bd2f 100644 --- a/src/displayapp/screens/Paddle.h +++ b/src/displayapp/screens/Paddle.h @@ -24,11 +24,11 @@ namespace Pinetime { private: Pinetime::Components::LittleVgl& lvgl; - int PaddleBottomY = 90; // bottom extreme of the paddle - int PaddleTopY = 150; //top extreme of the paddle + int paddleBottomY = 90; // bottom extreme of the paddle + int paddleTopY = 150; //top extreme of the paddle - int BallX = 107; // Initial x_coordinate for the ball (12px offset from the center to counteract the ball's 24px size) - int BallY = 107; // Initial y_coordinate for the ball + int ballX = 107; // Initial x_coordinate for the ball (12px offset from the center to counteract the ball's 24px size) + int ballY = 107; // Initial y_coordinate for the ball int dx = 2; // Velocity of the ball in the x_coordinate int dy = 3; // Velocity of the ball in the y_coordinate -- cgit v0.10.2 From 61e78d338b9dbf620e0292dcd15252da131a2bd3 Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Sun, 20 Dec 2020 09:32:00 +0530 Subject: Update Paddle.cpp fix uppercase diff --git a/src/displayapp/screens/Paddle.cpp b/src/displayapp/screens/Paddle.cpp index 14ae220..347abb6 100644 --- a/src/displayapp/screens/Paddle.cpp +++ b/src/displayapp/screens/Paddle.cpp @@ -134,39 +134,37 @@ Paddle::~Paddle() { } bool Paddle::Refresh() { - if((counter++ % 5) == 0){ - counter = 0; - BallX += dx; - BallY += dy; + ballX += dx; + ballY += dy; - lv_obj_set_pos(ball_image, BallX, BallY); + lv_obj_set_pos(ball_image, ballX, ballY); //checks if it has touched the sides (floor and ceiling) - if(BallY <= 0 || BallY >= 215){ + if(ballY <= 0 || ballY >= 215){ dy *= -1; } //checks if it has touched the side (left side) - if(BallX >= 215){ + if(ballX >= 215){ dx *= -1; } //checks if it is in the position of the paddle - if(BallY <= (PaddleBottomY + 16) && BallY >= (PaddleTopY - 8)){ - if(BallX >= 0 && BallX < 4){ - lv_obj_set_pos(ball_image, 5, BallY); + if(ballY <= (paddleBottomY + 16) && ballY >= (paddleTopY - 8)){ + if(ballX >= 0 && ballX < 4){ + lv_obj_set_pos(ball_image, 5, ballY); dx *= -1; score++; } } //checks if it has gone behind the paddle - else if(BallX <= -40){ - BallX = 107; - BallY = 107; + else if(ballX <= -40){ + ballX = 107; + ballY = 107; score = 0; } sprintf(scoreStr, "%d", score); @@ -185,10 +183,9 @@ bool Paddle::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } bool Paddle::OnTouchEvent(uint16_t x, uint16_t y) { - lv_obj_set_pos(paddle_image, 0, y - 30); // sets the center paddle pos. (30px offset) with the the y_coordinate of the finger and defaults the x_coordinate to 0 - PaddleTopY = y - 30; // refreshes the upper extreme of the paddle - PaddleBottomY = y + 30; // refreshes the lower extreme of the paddle + paddleTopY = y - 30; // refreshes the upper extreme of the paddle + paddleBottomY = y + 30; // refreshes the lower extreme of the paddle return true; } -- cgit v0.10.2 From cc04c2c1f8a8a05cf284ad69a43b5cd682e37172 Mon Sep 17 00:00:00 2001 From: ZephyrLabs <65145081+ZephyrLabs@users.noreply.github.com> Date: Sun, 20 Dec 2020 11:53:39 +0530 Subject: Update Paddle.cpp blankline removal diff --git a/src/displayapp/screens/Paddle.cpp b/src/displayapp/screens/Paddle.cpp index 347abb6..9a04b3b 100644 --- a/src/displayapp/screens/Paddle.cpp +++ b/src/displayapp/screens/Paddle.cpp @@ -186,6 +186,5 @@ bool Paddle::OnTouchEvent(uint16_t x, uint16_t y) { lv_obj_set_pos(paddle_image, 0, y - 30); // sets the center paddle pos. (30px offset) with the the y_coordinate of the finger and defaults the x_coordinate to 0 paddleTopY = y - 30; // refreshes the upper extreme of the paddle paddleBottomY = y + 30; // refreshes the lower extreme of the paddle - return true; } -- cgit v0.10.2 From a7df0a02799442ab38e1b365d4363cca6d93f029 Mon Sep 17 00:00:00 2001 From: Joe Eaves Date: Thu, 17 Dec 2020 13:12:06 +0000 Subject: Unify the Dockerfiles by fleshing out build.sh Script is written to handle it's own dependencies so it can be used within Docker or on the host system diff --git a/doc/buildWithDocker.md b/doc/buildWithDocker.md index 1db5e7a..771dd77 100644 --- a/doc/buildWithDocker.md +++ b/doc/buildWithDocker.md @@ -1,69 +1,58 @@ # Build the project using Docker There are [Docker images (Dockerfile)](../docker) containing the build environment for AMD64 (x86_64) and ARM64 architectures. These images make the build of the firmware and the generation of the DFU file for OTA quite easy, as well as preventing clashes with any other toolchains or development environments you may have installed. -## Using the image from Docker Hub +Based on Ubuntu 18.04 with the following build dependencies: -The image is avaiable via Docker Hub for both the amd64 and arm64v8 architectures at [pfeerick/infinitime-build](https://hub.docker.com/repository/docker/pfeerick/infinitime-build). - -It can be pulled (downloaded) using the following command: - -``` -docker pull pfeerick/infinitime-build -``` - -The default `latest` tag *should* automatically identify the correct image architecture, but if for some reason Docker does not, you can specify it manually: - -* For AMD64 (x86_64) systems: `docker pull pfeerick/infinitime-build:amd64` - -* For ARM64v8 (ARM64/aarch64) systems: `docker pull pfeerick/infinitime-build:arm64v8` +When this is done, a new image named *infinitime-build* is available. +* ARM GCC Toolchain +* nRF SDK +* MCUBoot +* adafruit-nrfutil -The Docker Hub images are built using 1000:1000 for the user id and group id. If this is different to your user or group ids (run `id -u` and `id -g` to find out what your id values are if you are unsure), you will need to override them via the `--user` parameter in order to prevent permission errors during and after compilation. +## Run a container to build the project: +The `infinitime-build` image contains all the dependencies you need. The default `CMD` will compile sources found in `/sources`, so you need only mount your code. -The below example will run the container, setting the user and group ids automatically: +This example will build the firmware, generate the MCUBoot image and generate the DFU file. Outputs will be written to **/build/output**: -``` -docker run --rm -v :/sources --user $(id -u):$(id -g) pfeerick/infinitime-build +```bash +$ cd # e.g. cd ./work/Pinetime +$ docker run --rm -it -v $(pwd):/sources infinitime-build ``` -Or you can specify your user id and group id (by number, not by name) directly: - -``` -docker run --rm -v :/sources --user uid_num:gid_num pfeerick/infinitime-build -``` +* `--rm` to delete the container after we're done. Build cache will be written out to host disk, so no worries. +* `-it` for better interactivity with the running container. + * `-i` Interactive - required if you want to send CTRL+C + * `-t` TTY - This lets colours work nicely etc? +* `-v` for mounting a volume to the container -## Build the image yourself -Building the docker images yourself is quite easy. The following commands must be run from the root of the project. +Output files (and the cmake build cache) will have `uid`/`gid` not matching your host user. To override them, use `docker run` like this: -The `PUID` and `PGID` build arguments are used to set the user and group ids used in the container, meaning you will not need to specify it later unless they change for some reason. Specifying them is not mandatory, as this can be over-ridden at build time via the `--user` flag, but doing so will make the command you need to run later a bit shorter. In the below examples, they are set to your current user id and group id automatically. You can specify them manually, but they must be specified by number, not by name. - -If you are running on a AMD64 (x86_64) computer: -``` -docker image build -t infinitime-build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) docker/amd64/ -``` - -If you are running on an ARM64 computer (tested on Raspberry Pi 4 and Pine64 Pinebook Pro): -``` -docker image build -t infinitime-build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) docker/arm64v8/ +```bash +$ docker run --rm -it -v $(pwd):/sources \ + -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) \ + infinitime-build ``` -This operation will take some time, as it builds a Docker image based on Ubuntu, installs some required packages, downloads the ARM toolchain, the NRF SDK, MCUBoot and adafruit-nrfutil. - -When this is done, a new image named *infinitime-build* is available. +If you only want to build a single CMake target, you can pass it in as the first parameter to the build script. This means calling the script explicitly as it will override the `CMD`. Here's an example For `pinetime-app`: -## Run a container to build the project: +```bash +$ docker run --rm -it -v $(pwd):/sources infinitime-build /opt/build.sh pinetime-app +``` -The command to run the container is essentially the same, regardless of whether you built it yourself from the dockerfiles, or are using the Docker Hub images (use `pfeerick/infinitime-build` instead of `infinitime-build` for the later): +## Build the image +The image is not (yet) available on DockerHub, you need to build it yourself, but that is quite easy. The following commands must be run from the root of the project. This operation will take some time but, when done, a new image named *infinitime-build* is available. -``` -docker run --rm -v :/sources infinitime-build +```bash +$ docker image build -t infinitime-build ./docker ``` -This will start a container (removing it when finished), build the firmware and generate the MCUBoot image and DFU file. The output of the build is stored in `/built/output`. +The resulting -Replace ** by the path of the root of the project on your computer. For example: +You can bake your custom USER_ID and GROUP_ID numbers in to the image, then you don't have to pass them to `docker run` every time. +```bash +docker image build -t infinitime-build \ + --build-arg USER_ID=$(id -u) \ + --build-arg GROUP_ID=$(id -g) \ + ./docker ``` -docker run --rm -v /home/jf/git/PineTime:/sources infinitime-build -``` - -If you encounter permission errors (due to being logged in as a different user, changed user id, running the docker hub image, etc.), see the `--user` parameter mentioned above in the Docker Hub image section to see if this resolves the issue for you. diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..8f56356 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,37 @@ +FROM ubuntu:18.04 + +RUN \ + apt-get update -qq && \ + apt-get install -y \ +# x86_64 / generic packages + bash git gosu \ + cmake make build-essential \ + wget unzip \ + python3 python3-pip \ +# aarch64 packages + libffi-dev libssl-dev python3-dev \ + && rm -rf /var/lib/apt/lists/*; + +RUN pip3 install adafruit-nrfutil + +# build.sh knows how to compile +COPY build.sh /opt/ + +# Lets get each in a separate docker layer for better downloads +# GCC +RUN bash -c "source /opt/build.sh; GetGcc;" +# NrfSdk +RUN bash -c "source /opt/build.sh; GetNrfSdk;" +# McuBoot +RUN bash -c "source /opt/build.sh; GetMcuBoot;" + +# Set and arg and use it in the env for power to override at build AND runtime +ARG USER_ID=33333 +ARG GROUP_ID=33333 +ENV USER_ID $USER_ID +ENV GROUP_ID $GROUP_ID + +ENV SOURCES_DIR /sources +COPY entrypoint.sh /opt/ +ENTRYPOINT ["/opt/entrypoint.sh"] +CMD ["/opt/build.sh"] diff --git a/docker/amd64/Dockerfile b/docker/amd64/Dockerfile deleted file mode 100644 index 5f3c77e..0000000 --- a/docker/amd64/Dockerfile +++ /dev/null @@ -1,34 +0,0 @@ -FROM amd64/ubuntu:18.04 - -ARG DEBIAN_FRONTEND=noninteractive -RUN apt-get update -qq \ - && apt-get install -y \ - build-essential \ - cmake \ - git \ - make \ - python3 \ - python3-pip \ - tar \ - unzip \ - wget \ - && rm -rf /var/cache/apt/* /var/lib/apt/lists/* - -RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz \ - && tar -xjf gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz -C /opt \ - && rm gcc-arm-none-eabi-9-2020-q2-update-x86_64-linux.tar.bz - -RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip \ - && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ && rm nRF5_SDK_15.3.0_59ac345.zip - -RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git /opt/mcuboot \ - && pip3 install -r /opt/mcuboot/scripts/requirements.txt - -RUN pip3 install adafruit-nrfutil - -ARG PUID=1000 -ARG PGID=1000 -RUN groupadd --system --gid $PGID infinitime && useradd --system --uid $PUID --gid $PGID infinitime - -USER infinitime:infinitime -CMD ["/sources/docker/build.sh"] diff --git a/docker/arm64v8/Dockerfile b/docker/arm64v8/Dockerfile deleted file mode 100644 index cea2b83..0000000 --- a/docker/arm64v8/Dockerfile +++ /dev/null @@ -1,37 +0,0 @@ -FROM arm64v8/ubuntu:18.04 - -ENV DEBIAN_FRONTEND=noninteractive -RUN apt-get update -qq \ - && apt-get install -y \ - build-essential \ - cmake \ - git \ - libffi-dev \ - libssl-dev \ - make \ - python3 \ - python3-dev \ - python3-pip \ - tar \ - unzip \ - wget \ - && rm -rf /var/cache/apt/* /var/lib/apt/lists/* - -RUN wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2 \ - && tar -xjf gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2 -C /opt \ - && rm gcc-arm-none-eabi-9-2020-q2-update-aarch64-linux.tar.bz2 - -RUN wget -q https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/nRF5_SDK_15.3.0_59ac345.zip \ - && unzip -q nRF5_SDK_15.3.0_59ac345.zip -d /opt/ \ - && rm nRF5_SDK_15.3.0_59ac345.zip - -RUN git clone https://github.com/JuulLabs-OSS/mcuboot.git /opt/mcuboot && pip3 install -r /opt/mcuboot/scripts/requirements.txt - -RUN pip3 install adafruit-nrfutil - -ARG PUID=1000 -ARG PGID=1000 -RUN groupadd --system --gid $PGID infinitime && useradd --system --uid $PUID --gid $PGID infinitime - -USER infinitime:infinitime -CMD ["/sources/docker/build.sh"] diff --git a/docker/build.sh b/docker/build.sh index fcb819a..1c697d4 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -1,12 +1,73 @@ -#!/bin/sh +#!/bin/bash +(return 0 2>/dev/null) && SOURCED="true" || SOURCED="false" export LC_ALL=C.UTF-8 export LANG=C.UTF-8 set -x +set -e -mkdir /sources/build -cd /sources/build +# Default locations if the var isn't already set +export TOOLS_DIR="${TOOLS_DIR:=/opt}" +export SOURCES_DIR="${SOURCES_DIR:=/sources}" +export BUILD_DIR="${BUILD_DIR:=$SOURCES_DIR/build}" +export OUTPUT_DIR="${OUTPUT_DIR:=$BUILD_DIR/output}" -cmake -DARM_NONE_EABI_TOOLCHAIN_PATH=/opt/gcc-arm-none-eabi-9-2020-q2-update -DNRF5_SDK_PATH=/opt/nRF5_SDK_15.3.0_59ac345 -DUSE_OPENOCD=1 ../ -make -j$(nproc) +export BUILD_TYPE=${BUILD_TYPE:=Release} +export GCC_ARM_VER=${GCC_ARM_VER:="gcc-arm-none-eabi-9-2020-q2-update"} +export NRF_SDK_VER=${NRF_SDK_VER:="nRF5_SDK_15.3.0_59ac345"} -sh /sources/docker/post_build.sh +MACHINE="$(uname -m)" +[[ "$MACHINE" == "arm64" ]] && MACHINE="aarch64" + +main() { + local target="$1" + [[ ! -d "$TOOLS_DIR/$GCC_ARM_VER" ]] && GetGcc + [[ ! -d "$TOOLS_DIR/$NRF_SDK_VER" ]] && GetNrfSdk + [[ ! -d "$TOOLS_DIR/mcuboot" ]] && GetMcuBoot + + mkdir -p "$BUILD_DIR" + + CmakeGenerate + CmakeBuild "$target" + + if [[ "$DISABLE_POSTBUILD" != "true" ]]; then + source "$BUILD_DIR/post_build.sh" + fi +} + +GetGcc() { + GCC_SRC="$GCC_ARM_VER-$MACHINE-linux.tar.bz" + wget -q https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/$GCC_SRC -O - | tar -xj -C $TOOLS_DIR/ +} + +GetMcuBoot() { + git clone https://github.com/JuulLabs-OSS/mcuboot.git "$TOOLS_DIR/mcuboot" + pip3 install -r "$TOOLS_DIR/mcuboot/scripts/requirements.txt" +} + +GetNrfSdk() { + wget -q "https://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/$NRF_SDK_VER.zip" -O /tmp/$NRF_SDK_VER + unzip -q /tmp/$NRF_SDK_VER -d "$TOOLS_DIR/" + rm /tmp/$NRF_SDK_VER +} + +CmakeGenerate() { + # We can swap the CD and trailing SOURCES_DIR for -B and -S respectively + # once we go to newer CMake (Ubuntu 18.10 gives us CMake 3.10) + cd "$BUILD_DIR" + + cmake -G "Unix Makefiles" \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + -DUSE_OPENOCD=1 \ + -DARM_NONE_EABI_TOOLCHAIN_PATH="$TOOLS_DIR/$GCC_ARM_VER" \ + -DNRF5_SDK_PATH="$TOOLS_DIR/$NRF_SDK_VER" \ + "$SOURCES_DIR" + cmake -L -N . +} + +CmakeBuild() { + local target="$1" + [[ -n "$target" ]] && target="--target $target" + cmake --build "$BUILD_DIR" --config $BUILD_TYPE "$target" -- -j$(nproc) +} + +[[ $SOURCED == "false" ]] && main "$@" || echo "Sourced!" \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100755 index 0000000..5adb88f --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +## Create a user on-the-fly before running CMD +## This allows us to override at runtime, allowing use of a pre-built docker image +addgroup --gid $GROUP_ID user +adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user +exec gosu user:user /bin/bash -c "$@" \ No newline at end of file diff --git a/docker/post_build.sh.in b/docker/post_build.sh.in index 0665100..414fdb4 100755 --- a/docker/post_build.sh.in +++ b/docker/post_build.sh.in @@ -2,15 +2,24 @@ export LC_ALL=C.UTF-8 export LANG=C.UTF-8 set -x +set -e -mkdir -p /sources/build/output -/opt/mcuboot/scripts/imgtool.py create --align 4 --version 1.0.0 --header-size 32 --slot-size 475136 --pad-header /sources/build/src/pinetime-mcuboot-app-@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.bin /sources/build/output/image-@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.bin -adafruit-nrfutil dfu genpkg --dev-type 0x0052 --application /sources/build/output/image-@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.bin /sources/build/output/dfu-@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@.zip +export PROJECT_VERSION="@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" -cp /sources/build/src/*.bin /sources/build/output/ -cp /sources/build/src/*.hex /sources/build/output/ -cp /sources/build/src/*.out /sources/build/output/ -cp /sources/build/src/*.map /sources/build/output/ -cp /sources/bootloader/bootloader-5.0.4.bin /sources/build/output/bootloader.bin +mkdir -p "$OUTPUT_DIR" +"$TOOLS_DIR"/mcuboot/scripts/imgtool.py create --version 1.0.0 \ + --align 4 --header-size 32 --slot-size 475136 --pad-header \ + "$BUILD_DIR/src/pinetime-mcuboot-app-$PROJECT_VERSION.bin" \ + "$OUTPUT_DIR/image-$PROJECT_VERSION.bin" +adafruit-nrfutil dfu genpkg --dev-type 0x0052 \ + --application "$OUTPUT_DIR/image-$PROJECT_VERSION.bin" \ + "$OUTPUT_DIR/dfu-$PROJECT_VERSION.zip" + +cp "$BUILD_DIR"/src/*.bin \ + "$BUILD_DIR"/src/*.hex \ + "$BUILD_DIR"/src/*.out \ + "$BUILD_DIR"/src/*.map \ + $OUTPUT_DIR +cp "$SOURCES_DIR"/bootloader/bootloader-5.0.4.bin $OUTPUT_DIR/bootloader.bin \ No newline at end of file -- cgit v0.10.2 From 60ef9b54fbe35c1a985c3260e8c90158da129399 Mon Sep 17 00:00:00 2001 From: Joe Eaves Date: Fri, 18 Dec 2020 17:58:34 +0000 Subject: Integrate improvements from #137 Also fixed a bug with empty quoted strings diff --git a/doc/buildWithDocker.md b/doc/buildWithDocker.md index 771dd77..7a2f372 100644 --- a/doc/buildWithDocker.md +++ b/doc/buildWithDocker.md @@ -1,58 +1,73 @@ # Build the project using Docker -There are [Docker images (Dockerfile)](../docker) containing the build environment for AMD64 (x86_64) and ARM64 architectures. These images make the build of the firmware and the generation of the DFU file for OTA quite easy, as well as preventing clashes with any other toolchains or development environments you may have installed. + +A [Docker image (Dockerfile)](../docker) containing all the build environment is available for X86_64 and AMD64 architectures. These images make the build of the firmware and the generation of the DFU file for OTA quite easy, as well as preventing clashes with any other toolchains or development environments you may have installed. Based on Ubuntu 18.04 with the following build dependencies: -When this is done, a new image named *infinitime-build* is available. * ARM GCC Toolchain * nRF SDK * MCUBoot * adafruit-nrfutil -## Run a container to build the project: +## Run a container to build the project + The `infinitime-build` image contains all the dependencies you need. The default `CMD` will compile sources found in `/sources`, so you need only mount your code. This example will build the firmware, generate the MCUBoot image and generate the DFU file. Outputs will be written to **/build/output**: ```bash -$ cd # e.g. cd ./work/Pinetime -$ docker run --rm -it -v $(pwd):/sources infinitime-build +cd # e.g. cd ./work/Pinetime +docker run --rm -it -v $(pwd):/sources infinitime-build +``` + +If you only want to build a single CMake target, you can pass it in as the first parameter to the build script. This means calling the script explicitly as it will override the `CMD`. Here's an example For `pinetime-app`: + +```bash +docker run --rm -it -v $(pwd):/sources infinitime-build /opt/build.sh pinetime-app ``` -* `--rm` to delete the container after we're done. Build cache will be written out to host disk, so no worries. -* `-it` for better interactivity with the running container. - * `-i` Interactive - required if you want to send CTRL+C - * `-t` TTY - This lets colours work nicely etc? -* `-v` for mounting a volume to the container +The image is built using 1000:1000 for the user id and group id. If this is different to your user or group ids (run `id -u` and `id -g` to find out what your id values are if you are unsure), you will need to override them via the `--user` parameter in order to prevent permission errors with the output files (and the cmake build cache). -Output files (and the cmake build cache) will have `uid`/`gid` not matching your host user. To override them, use `docker run` like this: +Running with this image is the same as above, you just specify the ids to `docker run` ```bash -$ docker run --rm -it -v $(pwd):/sources \ - -e USER_ID=$(id -u) -e GROUP_ID=$(id -g) \ - infinitime-build +docker run --rm -it -v $(pwd):/sources --user $(id -u):$(id -g) pfeerick/infinitime-build ``` -If you only want to build a single CMake target, you can pass it in as the first parameter to the build script. This means calling the script explicitly as it will override the `CMD`. Here's an example For `pinetime-app`: +Or you can specify your user id and group id (by number, not by name) directly: ```bash -$ docker run --rm -it -v $(pwd):/sources infinitime-build /opt/build.sh pinetime-app +docker run --rm -it -v $(pwd):/sources --user 1234:1234 infinitime-build ``` -## Build the image -The image is not (yet) available on DockerHub, you need to build it yourself, but that is quite easy. The following commands must be run from the root of the project. This operation will take some time but, when done, a new image named *infinitime-build* is available. +## Using the image from Docker Hub + +The image is avaiable via Docker Hub for both the amd64 and arm64v8 architectures at [pfeerick/infinitime-build](https://hub.docker.com/repository/docker/pfeerick/infinitime-build). + +It can be pulled (downloaded) using the following command: ```bash -$ docker image build -t infinitime-build ./docker +docker pull pfeerick/infinitime-build ``` -The resulting +The default `latest` tag *should* automatically identify the correct image architecture, but if for some reason Docker does not, you can specify it manually: + +* For AMD64 (x86_64) systems: `docker pull pfeerick/infinitime-build:amd64` + +* For ARM64v8 (ARM64/aarch64) systems: `docker pull pfeerick/infinitime-build:arm64v8` + +## Build the image + +You can build the image yourself if you like! + +The following commands must be run from the root of the project. This operation will take some time but, when done, a new image named *infinitime-build* is available. + +```bash +docker image build -t infinitime-build ./docker +``` -You can bake your custom USER_ID and GROUP_ID numbers in to the image, then you don't have to pass them to `docker run` every time. +The `PUID` and `PGID` build arguments are used to set the user and group ids used in the container, meaning you will not need to specify it later unless they change for some reason. Specifying them is not mandatory, as this can be over-ridden at build time via the `--user` flag, but doing so will make the command you need to run later a bit shorter. In the below examples, they are set to your current user id and group id automatically. You can specify them manually, but they must be specified by number, not by name. ```bash -docker image build -t infinitime-build \ - --build-arg USER_ID=$(id -u) \ - --build-arg GROUP_ID=$(id -g) \ - ./docker +docker image build -t infinitime-build --build-arg PUID=$(id -u) --build-arg PGID=$(id -g) ./docker ``` diff --git a/docker/Dockerfile b/docker/Dockerfile index 8f56356..7f0fb4b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,16 +1,24 @@ FROM ubuntu:18.04 -RUN \ - apt-get update -qq && \ - apt-get install -y \ +ARG DEBIAN_FRONTEND=noninteractive +RUN apt-get update -qq \ + && apt-get install -y \ # x86_64 / generic packages - bash git gosu \ - cmake make build-essential \ - wget unzip \ - python3 python3-pip \ + bash \ + build-essential \ + cmake \ + git \ + make \ + python3 \ + python3-pip \ + tar \ + unzip \ + wget \ # aarch64 packages - libffi-dev libssl-dev python3-dev \ - && rm -rf /var/lib/apt/lists/*; + libffi-dev \ + libssl-dev \ + python3-dev \ + && rm -rf /var/cache/apt/* /var/lib/apt/lists/*; RUN pip3 install adafruit-nrfutil @@ -25,13 +33,10 @@ RUN bash -c "source /opt/build.sh; GetNrfSdk;" # McuBoot RUN bash -c "source /opt/build.sh; GetMcuBoot;" -# Set and arg and use it in the env for power to override at build AND runtime -ARG USER_ID=33333 -ARG GROUP_ID=33333 -ENV USER_ID $USER_ID -ENV GROUP_ID $GROUP_ID +ARG PUID=1000 +ARG PGID=1000 +RUN groupadd --system --gid $PGID infinitime && useradd --system --uid $PUID --gid $PGID infinitime +USER infinitime:infinitime ENV SOURCES_DIR /sources -COPY entrypoint.sh /opt/ -ENTRYPOINT ["/opt/entrypoint.sh"] CMD ["/opt/build.sh"] diff --git a/docker/build.sh b/docker/build.sh index 1c697d4..48dd9f3 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -27,7 +27,7 @@ main() { mkdir -p "$BUILD_DIR" CmakeGenerate - CmakeBuild "$target" + CmakeBuild $target if [[ "$DISABLE_POSTBUILD" != "true" ]]; then source "$BUILD_DIR/post_build.sh" @@ -67,7 +67,7 @@ CmakeGenerate() { CmakeBuild() { local target="$1" [[ -n "$target" ]] && target="--target $target" - cmake --build "$BUILD_DIR" --config $BUILD_TYPE "$target" -- -j$(nproc) + cmake --build "$BUILD_DIR" --config $BUILD_TYPE $target -- -j$(nproc) } [[ $SOURCED == "false" ]] && main "$@" || echo "Sourced!" \ No newline at end of file diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh deleted file mode 100755 index 5adb88f..0000000 --- a/docker/entrypoint.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -set -e -## Create a user on-the-fly before running CMD -## This allows us to override at runtime, allowing use of a pre-built docker image -addgroup --gid $GROUP_ID user -adduser --disabled-password --gecos '' --uid $USER_ID --gid $GROUP_ID user -exec gosu user:user /bin/bash -c "$@" \ No newline at end of file -- cgit v0.10.2 From 186fee9337154bef4e6cda2c1d1d5268eb303c6a Mon Sep 17 00:00:00 2001 From: Joe Eaves Date: Tue, 22 Dec 2020 11:38:17 +0000 Subject: Generate post_build.sh into CMAKE_CURRENT_BINARY_DIR diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e340f7..5eb89e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,7 @@ endif() set(VERSION_EDIT_WARNING "// Do not edit this file, it is automatically generated by CMAKE!") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/src/Version.h) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docker/post_build.sh.in ${CMAKE_CURRENT_SOURCE_DIR}/docker/post_build.sh) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docker/post_build.sh.in ${CMAKE_CURRENT_BINARY_DIR}/post_build.sh) add_subdirectory(src) -- cgit v0.10.2 From 1f243aeedbc42349dbaba0ad3c2801606f4a5623 Mon Sep 17 00:00:00 2001 From: Joe Eaves Date: Tue, 22 Dec 2020 11:38:57 +0000 Subject: Make TOOLS_DIR if needed Added some extra dir names to gitignore diff --git a/.gitignore b/.gitignore index 8d416f8..100e258 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,13 @@ .idea/ # CMake -cmake-build-*/ -CMakeFiles/ +cmake-build-* +cmake-* +CMakeFiles **/CMakeCache.txt cmake_install.cmake Makefile -build/ +build +tools # Resulting binary files *.a diff --git a/docker/build.sh b/docker/build.sh index 48dd9f3..f35c2f3 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -20,6 +20,9 @@ MACHINE="$(uname -m)" main() { local target="$1" + + mkdir -p "$TOOLS_DIR" + [[ ! -d "$TOOLS_DIR/$GCC_ARM_VER" ]] && GetGcc [[ ! -d "$TOOLS_DIR/$NRF_SDK_VER" ]] && GetNrfSdk [[ ! -d "$TOOLS_DIR/mcuboot" ]] && GetMcuBoot -- cgit v0.10.2 From 6c6ffc61ee273ba29f2a094e9953dbaf3df920d6 Mon Sep 17 00:00:00 2001 From: Joe Eaves Date: Tue, 22 Dec 2020 11:39:21 +0000 Subject: Make the post_build output a little cleaner diff --git a/docker/post_build.sh.in b/docker/post_build.sh.in index 414fdb4..52824c5 100755 --- a/docker/post_build.sh.in +++ b/docker/post_build.sh.in @@ -7,6 +7,7 @@ set -e export PROJECT_VERSION="@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" mkdir -p "$OUTPUT_DIR" +cp "$SOURCES_DIR"/bootloader/bootloader-5.0.4.bin $OUTPUT_DIR/bootloader.bin "$TOOLS_DIR"/mcuboot/scripts/imgtool.py create --version 1.0.0 \ --align 4 --header-size 32 --slot-size 475136 --pad-header \ @@ -17,9 +18,9 @@ adafruit-nrfutil dfu genpkg --dev-type 0x0052 \ --application "$OUTPUT_DIR/image-$PROJECT_VERSION.bin" \ "$OUTPUT_DIR/dfu-$PROJECT_VERSION.zip" -cp "$BUILD_DIR"/src/*.bin \ - "$BUILD_DIR"/src/*.hex \ - "$BUILD_DIR"/src/*.out \ - "$BUILD_DIR"/src/*.map \ - $OUTPUT_DIR -cp "$SOURCES_DIR"/bootloader/bootloader-5.0.4.bin $OUTPUT_DIR/bootloader.bin \ No newline at end of file +pushd "$BUILD_DIR" + cp src/*.bin $OUTPUT_DIR + cp src/*.hex $OUTPUT_DIR + cp src/*.out $OUTPUT_DIR + cp src/*.map $OUTPUT_DIR +popd \ No newline at end of file -- cgit v0.10.2 From 5cdd3f6e6f0abf439da0389b38ebc13bd30fc8e5 Mon Sep 17 00:00:00 2001 From: Joe Eaves Date: Tue, 22 Dec 2020 12:40:21 +0000 Subject: Improve the post_build again, again? diff --git a/docker/post_build.sh.in b/docker/post_build.sh.in index 52824c5..53ae343 100755 --- a/docker/post_build.sh.in +++ b/docker/post_build.sh.in @@ -1,12 +1,13 @@ #!/bin/sh export LC_ALL=C.UTF-8 export LANG=C.UTF-8 -set -x set -e +set +x export PROJECT_VERSION="@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" mkdir -p "$OUTPUT_DIR" + cp "$SOURCES_DIR"/bootloader/bootloader-5.0.4.bin $OUTPUT_DIR/bootloader.bin "$TOOLS_DIR"/mcuboot/scripts/imgtool.py create --version 1.0.0 \ @@ -18,9 +19,11 @@ adafruit-nrfutil dfu genpkg --dev-type 0x0052 \ --application "$OUTPUT_DIR/image-$PROJECT_VERSION.bin" \ "$OUTPUT_DIR/dfu-$PROJECT_VERSION.zip" -pushd "$BUILD_DIR" - cp src/*.bin $OUTPUT_DIR - cp src/*.hex $OUTPUT_DIR - cp src/*.out $OUTPUT_DIR - cp src/*.map $OUTPUT_DIR -popd \ No newline at end of file +mkdir -p "$OUTPUT_DIR/src" +cd "$BUILD_DIR" +cp src/*.bin "$OUTPUT_DIR/src" +cp src/*.hex "$OUTPUT_DIR/src" +cp src/*.out "$OUTPUT_DIR/src" +cp src/*.map "$OUTPUT_DIR/src" + +ls -RUv1 "$OUTPUT_DIR" | sed 's;^\([^/]\); \1;g' \ No newline at end of file -- cgit v0.10.2 From 1a6de3326fc224ef58b814856659940607d15dc5 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 28 Dec 2020 02:45:24 -0500 Subject: Add source code license and link to github to system app diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp index d821ac7..4fd96a8 100644 --- a/src/displayapp/screens/SystemInfo.cpp +++ b/src/displayapp/screens/SystemInfo.cpp @@ -112,6 +112,13 @@ std::unique_ptr SystemInfo::CreateScreen2() { } std::unique_ptr SystemInfo::CreateScreen3() { - strncpy(t3, "Hello from\nthe developer!", 27); + sprintf(t3, "Hello from\nthe developer!\n" + "Software Licensed\n" + "under the terms of\n" + "the GNU General\n" + "Public License v3\n" + "Source code:\n" + "https://github.com/\n" + " JF002/Pinetime"); return std::unique_ptr(new Screens::Label(app, t3)); } diff --git a/src/displayapp/screens/SystemInfo.h b/src/displayapp/screens/SystemInfo.h index a71bacc..75268c7 100644 --- a/src/displayapp/screens/SystemInfo.h +++ b/src/displayapp/screens/SystemInfo.h @@ -43,7 +43,7 @@ namespace Pinetime { char t1[200]; char t2[200]; - char t3[30]; + char t3[200]; ScreenList<3> screens; std::unique_ptr CreateScreen1(); -- cgit v0.10.2 From 12617ed1bf0738970c1ccf32d0b523e6d5999531 Mon Sep 17 00:00:00 2001 From: Jed Date: Sat, 2 Jan 2021 14:08:12 -0600 Subject: adds 2048 clone game styles table reads touch events allows moving tiles allows merging tiles improves tile movement allows merging tiles adds score display implements color edit comments adjust game logic disallows double merges diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7e48607..fde1f58 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -259,6 +259,7 @@ set(LVGL_SRC libs/lvgl/src/lv_objx/lv_cont.c libs/lvgl/src/lv_objx/lv_label.h libs/lvgl/src/lv_objx/lv_label.c + libs/lvgl/src/lv_objx/lv_table.c libs/lvgl/src/lv_themes/lv_theme.c libs/lvgl/src/lv_themes/lv_theme.h libs/lvgl/src/lv_themes/lv_theme_night.h @@ -347,6 +348,7 @@ list(APPEND SOURCE_FILES displayapp/screens/FirmwareValidation.cpp displayapp/screens/ApplicationList.cpp displayapp/screens/Notifications.cpp + displayapp/screens/Twos.cpp main.cpp drivers/St7789.cpp drivers/SpiNorFlash.cpp diff --git a/src/displayapp/Apps.h b/src/displayapp/Apps.h index 7e4afa2..f5fb24d 100644 --- a/src/displayapp/Apps.h +++ b/src/displayapp/Apps.h @@ -2,6 +2,6 @@ namespace Pinetime { namespace Applications { - enum class Apps {None, Launcher, Clock, SysInfo, Meter, Gauge, Brightness, Music, FirmwareValidation, Paint, Paddle, Notifications}; + enum class Apps {None, Launcher, Clock, SysInfo, Meter, Gauge, Brightness, Music, FirmwareValidation, Paint, Paddle, Notifications, Twos}; } } diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 7282319..162d022 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -17,6 +17,7 @@ #include "displayapp/screens/Notifications.h" #include "displayapp/screens/SystemInfo.h" #include "displayapp/screens/Tile.h" +#include "displayapp/screens/Twos.h" #include "drivers/Cst816s.h" #include "drivers/St7789.h" #include "drivers/Watchdog.h" @@ -202,6 +203,7 @@ void DisplayApp::RunningState() { // case Apps::Test: currentScreen.reset(new Screens::Message(this)); break; case Apps::SysInfo: currentScreen.reset(new Screens::SystemInfo(this, dateTimeController, batteryController, brightnessController, bleController, watchdog)); break; case Apps::Meter: currentScreen.reset(new Screens::Meter(this)); break; + case Apps::Twos: currentScreen.reset(new Screens::Twos(this)); break; case Apps::Gauge: currentScreen.reset(new Screens::Gauge(this)); break; case Apps::Paint: currentScreen.reset(new Screens::InfiniPaint(this, lvgl)); break; case Apps::Paddle: currentScreen.reset(new Screens::Paddle(this, lvgl)); break; diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp index ddb98e5..0b8face 100644 --- a/src/displayapp/screens/ApplicationList.cpp +++ b/src/displayapp/screens/ApplicationList.cpp @@ -61,7 +61,7 @@ std::unique_ptr ApplicationList::CreateScreen2() { {Symbols::paintbrush, Apps::Paint}, {Symbols::info, Apps::Notifications}, {Symbols::paddle, Apps::Paddle}, - {Symbols::none, Apps::None} + {"2", Apps::Twos} } }; diff --git a/src/displayapp/screens/Twos.cpp b/src/displayapp/screens/Twos.cpp new file mode 100644 index 0000000..f36e35d --- /dev/null +++ b/src/displayapp/screens/Twos.cpp @@ -0,0 +1,271 @@ +#include "Twos.h" +#include +#include +#include +#include +#include +#include + +using namespace Pinetime::Applications::Screens; + +extern lv_font_t jetbrains_mono_bold_20; + +Twos::Twos(Pinetime::Applications::DisplayApp *app) : Screen(app) { + + // create styles to apply to different valued tiles + static lv_style_t style_cell1; + lv_style_copy(&style_cell1, &lv_style_plain); + style_cell1.body.border.width = 1; + style_cell1.text.font = &jetbrains_mono_bold_20; + style_cell1.body.padding.top = 16; + style_cell1.body.padding.bottom = 16; + style_cell1.body.main_color = LV_COLOR_MAKE(214, 197, 165); + style_cell1.body.grad_color = LV_COLOR_MAKE(214, 197, 165); + style_cell1.text.color = LV_COLOR_BLACK; + + static lv_style_t style_cell2; + lv_style_copy(&style_cell2, &style_cell1); + style_cell2.body.main_color = LV_COLOR_MAKE(209, 146, 92); + style_cell2.body.grad_color = LV_COLOR_MAKE(209, 146, 92); + style_cell2.text.color = LV_COLOR_WHITE; + + static lv_style_t style_cell3; + lv_style_copy(&style_cell3, &style_cell2); + style_cell3.body.main_color = LV_COLOR_MAKE(246, 94, 59); + style_cell3.body.grad_color = LV_COLOR_MAKE(246, 94, 59); + + static lv_style_t style_cell4; + lv_style_copy(&style_cell4, &style_cell3); + style_cell4.body.main_color = LV_COLOR_MAKE(212, 170, 28); + style_cell4.body.grad_color = LV_COLOR_MAKE(212, 170, 28); + + // format grid display + gridDisplay = lv_table_create(lv_scr_act(), nullptr); + lv_table_set_style(gridDisplay, LV_TABLE_STYLE_CELL1, &style_cell1); + lv_table_set_style(gridDisplay, LV_TABLE_STYLE_CELL2, &style_cell2); + lv_table_set_style(gridDisplay, LV_TABLE_STYLE_CELL3, &style_cell3); + lv_table_set_style(gridDisplay, LV_TABLE_STYLE_CELL4, &style_cell4); + lv_table_set_col_cnt(gridDisplay, 4); + lv_table_set_row_cnt(gridDisplay, 4); + lv_table_set_col_width(gridDisplay, 0, LV_HOR_RES/4); + lv_table_set_col_width(gridDisplay, 1, LV_HOR_RES/4); + lv_table_set_col_width(gridDisplay, 2, LV_HOR_RES/4); + lv_table_set_col_width(gridDisplay, 3, LV_HOR_RES/4); + lv_obj_align(gridDisplay, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0); + + // initialize grid + for(int row = 0; row < 4; row++) { + for(int col = 0; col < 4; col++) { + grid[row][col].value = 0; + lv_table_set_cell_type(gridDisplay, row, col, 2); + lv_table_set_cell_align(gridDisplay, row, col, LV_LABEL_ALIGN_CENTER); + } + } + placeNewTile(); + placeNewTile(); + + // format score text + scoreText = lv_label_create(lv_scr_act(), nullptr); + lv_obj_set_width(scoreText, LV_HOR_RES); + lv_label_set_align(scoreText, LV_ALIGN_IN_LEFT_MID); + lv_obj_align(scoreText, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0); + lv_label_set_text(scoreText, ("Score: " + std::to_string(score)).c_str()); +} + +Twos::~Twos() { + lv_obj_clean(lv_scr_act()); +} + +bool Twos::Refresh() { + return running; +} + +bool Twos::OnButtonPushed() { + running = false; + return true; +} + +bool Twos::placeNewTile() { + std::vector< std::pair > availableCells; + for(int row = 0; row < 4; row++) { + for(int col = 0; col < 4; col++) { + if(!grid[row][col].value) { + availableCells.push_back(std::make_pair(row, col)); + } + } + } + + if (availableCells.size() == 0) { + return false; // game lost + } + + auto it = availableCells.cbegin(); + int random = rand() % availableCells.size(); + std::advance(it, random); + std::pair newCell = *it; + + if ((rand() % 100) < 90) grid[newCell.first][newCell.second].value = 2; + else grid[newCell.first][newCell.second].value = 4; + updateGridDisplay(grid); + return true; +} + +bool Twos::tryMerge(Tile grid[][4], int &newRow, int &newCol, int oldRow, int oldCol) { + if((grid[newRow][newCol].value == grid[oldRow][oldCol].value)) { + if((newCol != oldCol) || (newRow != oldRow)) { + if(!grid[newRow][newCol].merged) { + unsigned int newVal = grid[oldRow][oldCol].value *= 2; + grid[newRow][newCol].value = newVal; + score += newVal; + lv_label_set_text(scoreText, ("Score: " + std::to_string(score)).c_str()); + grid[oldRow][oldCol].value = 0; + grid[newRow][newCol].merged = true; + return true; + } + } + } + return false; +} + +bool Twos::tryMove(Tile grid[][4], int newRow, int newCol, int oldRow, int oldCol) { + if(((newCol >= 0) && (newCol != oldCol)) || ((newRow >= 0) && (newRow != oldRow))) { + grid[newRow][newCol].value = grid[oldRow][oldCol].value; + grid[oldRow][oldCol].value = 0; + return true; + } + return false; +} + +bool Twos::OnTouchEvent(Pinetime::Applications::TouchEvents event) { + bool validMove; + validMove = false; + for(int row = 0; row < 4; row++) { + for(int col = 0; col < 4; col++) { + grid[row][col].merged = false; // reinitialize merge state + } + } + switch(event) { + case TouchEvents::SwipeLeft: + for(int col = 1; col < 4; col++) { // ignore tiles already on far left + for(int row = 0; row < 4; row++) { + if(grid[row][col].value) { + int newCol = -1; + for(int potentialNewCol = col - 1; potentialNewCol >= 0; potentialNewCol--) { + if(!grid[row][potentialNewCol].value) { + newCol = potentialNewCol; + } + else { // blocked by another tile + if(tryMerge(grid, row, potentialNewCol, row, col)) validMove = true; + break; + } + } + if(tryMove(grid, row, newCol, row, col)) validMove = true; + } + } + } + if (validMove) { + placeNewTile(); + } + return true; + case TouchEvents::SwipeRight: + for(int col = 2; col >= 0; col--) { // ignore tiles already on far right + for(int row = 0; row < 4; row++) { + if(grid[row][col].value) { + int newCol = -1; + for(int potentialNewCol = col + 1; potentialNewCol < 4; potentialNewCol++) { + if(!grid[row][potentialNewCol].value) { + newCol = potentialNewCol; + } + else { // blocked by another tile + if(tryMerge(grid, row, potentialNewCol, row, col)) validMove = true; + break; + } + } + if(tryMove(grid, row, newCol, row, col)) validMove = true; + } + } + } + if (validMove) { + placeNewTile(); + } + return true; + case TouchEvents::SwipeUp: + for(int row = 1; row < 4; row++) { // ignore tiles already on top + for(int col = 0; col < 4; col++) { + if(grid[row][col].value) { + int newRow = -1; + for(int potentialNewRow = row - 1; potentialNewRow >= 0; potentialNewRow--) { + if(!grid[potentialNewRow][col].value) { + newRow = potentialNewRow; + } + else { // blocked by another tile + if(tryMerge(grid, potentialNewRow, col, row, col)) validMove = true; + break; + } + } + if(tryMove(grid, newRow, col, row, col)) validMove = true; + } + } + } + if (validMove) { + placeNewTile(); + } + return true; + case TouchEvents::SwipeDown: + for(int row = 2; row >=0; row--) { // ignore tiles already on bottom + for(int col = 0; col < 4; col++) { + if(grid[row][col].value) { + int newRow = -1; + for(int potentialNewRow = row + 1; potentialNewRow < 4; potentialNewRow++) { + if(!grid[potentialNewRow][col].value) { + newRow = potentialNewRow; + } + else { // blocked by another tile + if(tryMerge(grid, potentialNewRow, col, row, col)) validMove = true; + break; + } + } + if(tryMove(grid, newRow, col, row, col)) validMove = true; + } + } + } + if (validMove) { + placeNewTile(); + } + return true; + default: + return false; + } + return false; +} + +void Twos::updateGridDisplay(Tile grid[][4]) { + for(int row = 0; row < 4; row++) { + for(int col = 0; col < 4; col++) { + if (grid[row][col].value) { + lv_table_set_cell_value(gridDisplay, row, col, (std::to_string(grid[row][col].value)).c_str()); + } + else { + lv_table_set_cell_value(gridDisplay, row, col, ""); + } + switch (grid[row][col].value) { + case 0: + case 2: + case 4: + lv_table_set_cell_type(gridDisplay, row, col, 1); + break; + case 8: + case 16: + lv_table_set_cell_type(gridDisplay, row, col, 2); + break; + case 32: + case 64: + lv_table_set_cell_type(gridDisplay, row, col, 3); + break; + default: + lv_table_set_cell_type(gridDisplay, row, col, 4); + break; + } + } + } +} \ No newline at end of file diff --git a/src/displayapp/screens/Twos.h b/src/displayapp/screens/Twos.h new file mode 100644 index 0000000..ad80ca1 --- /dev/null +++ b/src/displayapp/screens/Twos.h @@ -0,0 +1,34 @@ +#pragma once + +#include +#include "Screen.h" + +namespace Pinetime { + namespace Applications { + struct Tile { + bool merged = false; + unsigned int value = 0; + }; + namespace Screens { + class Twos : public Screen { + public: + Twos(DisplayApp* app); + ~Twos() override; + bool Refresh() override; + bool OnButtonPushed() override; + bool OnTouchEvent(TouchEvents event) override; + + private: + bool running = true; + lv_obj_t *scoreText; + lv_obj_t *gridDisplay; + Tile grid[4][4]; + unsigned int score = 0; + void updateGridDisplay(Tile grid[][4]); + bool tryMerge(Tile grid[][4], int &newRow, int &newCol, int oldRow, int oldCol); + bool tryMove(Tile grid[][4], int newRow, int newCol, int oldRow, int oldCol); + bool placeNewTile(); + }; + } + } +} \ No newline at end of file -- cgit v0.10.2 From e0082f0ae33a809480ee409ccffdd136c13248e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Sat, 2 Jan 2021 21:23:40 +0100 Subject: Rename Pinetime in InfiniTime in sysinfo app. diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp index 4fd96a8..2de5dad 100644 --- a/src/displayapp/screens/SystemInfo.cpp +++ b/src/displayapp/screens/SystemInfo.cpp @@ -84,7 +84,7 @@ std::unique_ptr SystemInfo::CreateScreen1() { uptimeSeconds = uptimeSeconds % secondsInAMinute; // TODO handle more than 100 days of uptime - sprintf(t1, "Pinetime\n" + sprintf(t1, "InfiniTime\n" "Version:%ld.%ld.%ld\n" "Build: %s\n" " %s\n" -- cgit v0.10.2 From 50ae0ae5e073ac48652e6c26549f9b19655e8da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Fran=C3=A7ois=20Milants?= Date: Mon, 4 Jan 2021 19:56:01 +0100 Subject: Set version to 0.10.0. diff --git a/CMakeLists.txt b/CMakeLists.txt index 5eb89e3..2da6cff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.10) -project(pinetime VERSION 0.9.0 LANGUAGES C CXX ASM) +project(pinetime VERSION 0.10.0 LANGUAGES C CXX ASM) set(NRF_TARGET "nrf52") -- cgit v0.10.2