summaryrefslogtreecommitdiff
path: root/src/components/gfx/Gfx.cpp
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2021-01-04 18:56:56 (GMT)
committerGitea <gitea@fake.local>2021-01-04 18:56:56 (GMT)
commit1d940af924bac5728a4d494f780e298e5b67b707 (patch)
tree24540888f3d038ca3c88a0789b63faa8ac07d631 /src/components/gfx/Gfx.cpp
parent04abc91f157f5925ffa404728291a69893acf8cf (diff)
parent50ae0ae5e073ac48652e6c26549f9b19655e8da3 (diff)
Merge branch 'develop' of JF/PineTime into master
Diffstat (limited to 'src/components/gfx/Gfx.cpp')
-rw-r--r--src/components/gfx/Gfx.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/components/gfx/Gfx.cpp b/src/components/gfx/Gfx.cpp
index 3c5dbfb..59c1da9 100644
--- a/src/components/gfx/Gfx.cpp
+++ b/src/components/gfx/Gfx.cpp
@@ -1,8 +1,5 @@
-#include <libraries/svc/nrf_svci.h>
-#include <FreeRTOS.h>
-#include <task.h>
#include "Gfx.h"
-#include "../../drivers/St7789.h"
+#include "drivers/St7789.h"
using namespace Pinetime::Components;
Gfx::Gfx(Pinetime::Drivers::St7789 &lcd) : lcd{lcd} {
@@ -23,7 +20,7 @@ void Gfx::ClearScreen() {
lcd.BeginDrawBuffer(0, 0, width, height);
lcd.NextDrawBuffer(reinterpret_cast<const uint8_t *>(buffer), width * 2);
- WaitTransfertFinished();
+ WaitTransferFinished();
}
@@ -40,7 +37,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 +51,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 +122,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 +150,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 +182,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 +190,7 @@ void Gfx::NotifyEndOfTransfert(TaskHandle_t task) {
}
}
-void Gfx::WaitTransfertFinished() const {
+void Gfx::WaitTransferFinished() const {
ulTaskNotifyTake(pdTRUE, 500);
}
@@ -204,4 +201,3 @@ void Gfx::SetScrollArea(uint16_t topFixedLines, uint16_t scrollLines, uint16_t b
void Gfx::SetScrollStartLine(uint16_t line) {
lcd.VerticalScrollStartAddress(line);
}
-