From 585a656d2e9bf0c6158bff436d4575ce7644dab3 Mon Sep 17 00:00:00 2001 From: Larry Bank Date: Wed, 30 Apr 2025 22:55:53 +0100 Subject: [PATCH] Added missing IO functions for Linux/RPI --- rpi/rpi_io.inl | 22 ++++++++++++++++++++++ src/bb_ep.inl | 2 ++ 2 files changed, 24 insertions(+) diff --git a/rpi/rpi_io.inl b/rpi/rpi_io.inl index e7c86fb..cdc62e1 100644 --- a/rpi/rpi_io.inl +++ b/rpi/rpi_io.inl @@ -86,6 +86,17 @@ void delay(int iMS) usleep(iMS * 1000); } /* delay() */ +long millis(void) +{ +int iTime; +struct timespec res; + + clock_gettime(CLOCK_MONOTONIC, &res); + iTime = 1000*res.tv_sec + res.tv_nsec/1000000; + + return (long)iTime; +} /* millis() */ + static void delayMicroseconds(int iMS) { usleep(iMS); @@ -133,6 +144,17 @@ void bbepCMD2(BBEPDISP *pBBEP, uint8_t cmd1, uint8_t cmd2) digitalWrite(pBBEP->iCSPin, HIGH); digitalWrite(pBBEP->iDCPin, HIGH); // leave data mode as the default } /* bbepCMD2() */ +// +// Set the second CS pin for dual-controller displays +// +void bbepSetCS2(BBEPDISP *pBBEP, uint8_t cs) +{ + pBBEP->iCS1Pin = pBBEP->iCSPin; + pBBEP->iCS2Pin = cs; + pinMode(cs, OUTPUT); + digitalWrite(cs, HIGH); // disable second CS for now +} /* bbepSetCS2() */ + // // Write a single byte as a COMMAND (D/C set low) // diff --git a/src/bb_ep.inl b/src/bb_ep.inl index 77c03d6..de6e360 100644 --- a/src/bb_ep.inl +++ b/src/bb_ep.inl @@ -1639,6 +1639,7 @@ void bbepSetAddrWindow(BBEPDISP *pBBEP, int x, int y, int cx, int cy) if (!pBBEP) return; if (pBBEP->iFlags & (BBEP_4COLOR | BBEP_7COLOR)) return; +#ifdef FUTURE if (pBBEP->chip_type == BBEP_CHIP_IT8951) { uint16_t u16Temp[6]; u16Temp[0] = 0; // DEBUG (_endian_type << 8 | _pix_bpp << 4 | _rotate); @@ -1649,6 +1650,7 @@ void bbepSetAddrWindow(BBEPDISP *pBBEP, int x, int y, int cx, int cy) bbepWriteIT8951CmdArgs(pBBEP, IT8951_TCON_LD_IMG_AREA, u16Temp, 5); return; } +#endif tx = x/8; // round down to next lower byte ty = y; cx = (cx + 7) & 0xfff8; // make width an even number of bytes