Skip to content

Commit

Permalink
update patch
Browse files Browse the repository at this point in the history
  • Loading branch information
lumapu committed Apr 14, 2024
1 parent c3f2c8b commit 0683d1d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions patches/GxEPD2_HAL.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/GxEPD2_EPD.cpp b/src/GxEPD2_EPD.cpp
index 8df8bef..19b210c 100644
index 8df8bef..e9dfb19 100644
--- a/src/GxEPD2_EPD.cpp
+++ b/src/GxEPD2_EPD.cpp
@@ -17,11 +17,10 @@
Expand Down Expand Up @@ -140,7 +140,7 @@ index 8df8bef..19b210c 100644
- if (_cs >= 0) digitalWrite(_cs, HIGH);
- if (_dc >= 0) digitalWrite(_dc, HIGH);
- _pSPIx->endTransaction();
+ _hal->write(c);
+ _hal->writeCmd(c);
}

void GxEPD2_EPD::_writeData(uint8_t d)
Expand Down Expand Up @@ -313,10 +313,10 @@ index 34c1145..1e8ea64 100644

diff --git a/src/GxEPD2_Hal.h b/src/GxEPD2_Hal.h
new file mode 100644
index 0000000..cb8fb9d
index 0000000..13424b6
--- /dev/null
+++ b/src/GxEPD2_Hal.h
@@ -0,0 +1,18 @@
@@ -0,0 +1,19 @@
+#pragma once
+
+class GxEPD2_HalInterface {
Expand All @@ -329,6 +329,7 @@ index 0000000..cb8fb9d
+ virtual void write(uint8_t buf) = 0;
+ virtual void write(const uint8_t *buf, uint16_t n) = 0;
+ virtual void write(const uint8_t *buf, uint16_t n, int16_t fill_with_zeroes) = 0;
+ virtual void writeCmd(const uint8_t val) = 0;
+ virtual void writeCmd(const uint8_t* pCommandData, uint8_t datalen, bool isPGM) = 0;
+
+ virtual void startTransfer(void) = 0;
Expand Down

0 comments on commit 0683d1d

Please sign in to comment.