summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJF <jf@codingfield.com>2020-03-08 20:38:11 (GMT)
committerJF <jf@codingfield.com>2020-03-08 20:38:11 (GMT)
commitd834f40c1014ac8926af9aaadc434a49e632b000 (patch)
tree196fd24b617102eb1659e046623c107fa9795ac9 /src
parentbfecc8118e90998c62ff0b29c0260e66d83d8e33 (diff)
Do not copy LittleVgl object in DislayApp, use reference instead.
Make Cst816s, SpiMaster and St7789 not copiable and not movable
Diffstat (limited to 'src')
-rw-r--r--src/DisplayApp/DisplayApp.h2
-rw-r--r--src/drivers/Cst816s.h6
-rw-r--r--src/drivers/SpiMaster.h5
-rw-r--r--src/drivers/St7789.h5
4 files changed, 17 insertions, 1 deletions
diff --git a/src/DisplayApp/DisplayApp.h b/src/DisplayApp/DisplayApp.h
index 348fd5b..2505423 100644
--- a/src/DisplayApp/DisplayApp.h
+++ b/src/DisplayApp/DisplayApp.h
@@ -43,7 +43,7 @@ namespace Pinetime {
static void Process(void* instance);
void InitHw();
Pinetime::Drivers::St7789& lcd;
- Pinetime::Components::LittleVgl lvgl;
+ Pinetime::Components::LittleVgl& lvgl;
void Refresh();
States state = States::Running;
diff --git a/src/drivers/Cst816s.h b/src/drivers/Cst816s.h
index 93b05df..4a5dda6 100644
--- a/src/drivers/Cst816s.h
+++ b/src/drivers/Cst816s.h
@@ -27,6 +27,12 @@ namespace Pinetime {
bool isTouch = false;
};
+ Cst816S() = default;
+ Cst816S(const Cst816S&) = delete;
+ Cst816S& operator=(const Cst816S&) = delete;
+ Cst816S(Cst816S&&) = delete;
+ Cst816S& operator=(Cst816S&&) = delete;
+
void Init();
void Probe();
TouchInfos GetTouchInfo();
diff --git a/src/drivers/SpiMaster.h b/src/drivers/SpiMaster.h
index 82042bd..362f480 100644
--- a/src/drivers/SpiMaster.h
+++ b/src/drivers/SpiMaster.h
@@ -26,6 +26,11 @@ namespace Pinetime {
};
SpiMaster(const SpiModule spi, const Parameters& params);
+ SpiMaster(const SpiMaster&) = delete;
+ SpiMaster& operator=(const SpiMaster&) = delete;
+ SpiMaster(SpiMaster&&) = delete;
+ SpiMaster& operator=(SpiMaster&&) = delete;
+
bool Init();
bool Write(const uint8_t* data, size_t size);
diff --git a/src/drivers/St7789.h b/src/drivers/St7789.h
index 4341e90..42fbe6a 100644
--- a/src/drivers/St7789.h
+++ b/src/drivers/St7789.h
@@ -7,6 +7,11 @@ namespace Pinetime {
class St7789 {
public:
explicit St7789(SpiMaster& spiMaster, uint8_t pinDataCommand);
+ St7789(const St7789&) = delete;
+ St7789& operator=(const St7789&) = delete;
+ St7789(St7789&&) = delete;
+ St7789& operator=(St7789&&) = delete;
+
void Init();
void Uninit();
void DrawPixel(uint16_t x, uint16_t y, uint32_t color);