diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/components/gfx/Gfx.cpp | 15 | ||||
| -rw-r--r-- | src/components/gfx/Gfx.h | 4 | ||||
| -rw-r--r-- | src/displayapp/LittleVgl.cpp | 7 | ||||
| -rw-r--r-- | src/displayapp/screens/SystemInfo.cpp | 5 | ||||
| -rw-r--r-- | src/systemtask/SystemTask.cpp | 12 |
6 files changed, 18 insertions, 27 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6c9ce24b..254fabcf 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" diff --git a/src/components/gfx/Gfx.cpp b/src/components/gfx/Gfx.cpp index 3c5dbfb7..bab7c8d9 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<const uint8_t *>(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<const uint8_t *>(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<const uint8_t *>(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<const uint8_t *>(&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 091f06f5..eba6319f 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 3483f8e8..7b6275e2 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; } - - - diff --git a/src/displayapp/screens/SystemInfo.cpp b/src/displayapp/screens/SystemInfo.cpp index 867fdaeb..83384fbd 100644 --- a/src/displayapp/screens/SystemInfo.cpp +++ b/src/displayapp/screens/SystemInfo.cpp @@ -43,10 +43,7 @@ bool SystemInfo::OnTouchEvent(Pinetime::Applications::TouchEvents event) { } std::unique_ptr<Screen> 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 = static_cast<uint8_t>(batteryController.PercentRemaining()); uint8_t brightness = 0; switch(brightnessController.Level()) { diff --git a/src/systemtask/SystemTask.cpp b/src/systemtask/SystemTask.cpp index dac4ce29..3177bce5 100644 --- a/src/systemtask/SystemTask.cpp +++ b/src/systemtask/SystemTask.cpp @@ -107,21 +107,22 @@ void SystemTask::Work() { while(true) { uint8_t msg; if (xQueueReceive(systemTasksMsgQueue, &msg, isSleeping ? 2500 : 1000)) { + batteryController.Update(); Messages message = static_cast<Messages >(msg); switch(message) { case Messages::GoToRunning: 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; @@ -190,12 +191,9 @@ void SystemTask::Work() { } } + monitor.Process(); 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)) watchdog.Kick(); } |
