summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-09-17 01:45:07 +0100
committerGitHub <noreply@github.com>2020-09-17 10:45:07 +1000
commit410d09675a58f1890c24068066bb8eace21c2416 (patch)
treee73317b854be32f53cce9c20ccf1767142896823
parente9b3a12c6e43444f5f6a6e3f63b5e4ece80740eb (diff)
Fix TWIlib compilation on avr-gcc 10 (#9273)
-rw-r--r--keyboards/lfkeyboards/TWIlib.c13
-rw-r--r--keyboards/lfkeyboards/TWIlib.h12
-rwxr-xr-xkeyboards/meira/TWIlib.c13
-rwxr-xr-xkeyboards/meira/TWIlib.h12
4 files changed, 28 insertions, 22 deletions
diff --git a/keyboards/lfkeyboards/TWIlib.c b/keyboards/lfkeyboards/TWIlib.c
index abb12cc87a..dc4fbf016b 100644
--- a/keyboards/lfkeyboards/TWIlib.c
+++ b/keyboards/lfkeyboards/TWIlib.c
@@ -11,6 +11,19 @@
#include "util/delay.h"
#include "print.h"
+// Global transmit buffer
+volatile uint8_t *TWITransmitBuffer;
+// Global receive buffer
+volatile uint8_t TWIReceiveBuffer[RXMAXBUFLEN];
+// Buffer indexes
+volatile int TXBuffIndex; // Index of the transmit buffer. Is volatile, can change at any time.
+int RXBuffIndex; // Current index in the receive buffer
+// Buffer lengths
+int TXBuffLen; // The total length of the transmit buffer
+int RXBuffLen; // The total number of bytes to read (should be less than RXMAXBUFFLEN)
+
+TWIInfoStruct TWIInfo;
+
void TWIInit()
{
TWIInfo.mode = Ready;
diff --git a/keyboards/lfkeyboards/TWIlib.h b/keyboards/lfkeyboards/TWIlib.h
index 6db3cc9513..8ba261c6e5 100644
--- a/keyboards/lfkeyboards/TWIlib.h
+++ b/keyboards/lfkeyboards/TWIlib.h
@@ -16,16 +16,6 @@
#define TXMAXBUFLEN 20
// Receive buffer length
#define RXMAXBUFLEN 20
-// Global transmit buffer
-volatile uint8_t *TWITransmitBuffer;
-// Global receive buffer
-volatile uint8_t TWIReceiveBuffer[RXMAXBUFLEN];
-// Buffer indexes
-volatile int TXBuffIndex; // Index of the transmit buffer. Is volatile, can change at any time.
-int RXBuffIndex; // Current index in the receive buffer
-// Buffer lengths
-int TXBuffLen; // The total length of the transmit buffer
-int RXBuffLen; // The total number of bytes to read (should be less than RXMAXBUFFLEN)
typedef enum {
Ready,
@@ -42,8 +32,8 @@ typedef enum {
uint8_t errorCode;
uint8_t repStart;
}TWIInfoStruct;
-TWIInfoStruct TWIInfo;
+extern TWIInfoStruct TWIInfo;
// TWI Status Codes
#define TWI_START_SENT 0x08 // Start sent
diff --git a/keyboards/meira/TWIlib.c b/keyboards/meira/TWIlib.c
index 8e0c974381..4091429b4e 100755
--- a/keyboards/meira/TWIlib.c
+++ b/keyboards/meira/TWIlib.c
@@ -11,6 +11,19 @@
#include "util/delay.h"
#include "print.h"
+// Global transmit buffer
+volatile uint8_t *TWITransmitBuffer;
+// Global receive buffer
+volatile uint8_t TWIReceiveBuffer[RXMAXBUFLEN];
+// Buffer indexes
+volatile int TXBuffIndex; // Index of the transmit buffer. Is volatile, can change at any time.
+int RXBuffIndex; // Current index in the receive buffer
+// Buffer lengths
+int TXBuffLen; // The total length of the transmit buffer
+int RXBuffLen; // The total number of bytes to read (should be less than RXMAXBUFFLEN)
+
+TWIInfoStruct TWIInfo;
+
void TWIInit()
{
TWIInfo.mode = Ready;
diff --git a/keyboards/meira/TWIlib.h b/keyboards/meira/TWIlib.h
index 6db3cc9513..8ba261c6e5 100755
--- a/keyboards/meira/TWIlib.h
+++ b/keyboards/meira/TWIlib.h
@@ -16,16 +16,6 @@
#define TXMAXBUFLEN 20
// Receive buffer length
#define RXMAXBUFLEN 20
-// Global transmit buffer
-volatile uint8_t *TWITransmitBuffer;
-// Global receive buffer
-volatile uint8_t TWIReceiveBuffer[RXMAXBUFLEN];
-// Buffer indexes
-volatile int TXBuffIndex; // Index of the transmit buffer. Is volatile, can change at any time.
-int RXBuffIndex; // Current index in the receive buffer
-// Buffer lengths
-int TXBuffLen; // The total length of the transmit buffer
-int RXBuffLen; // The total number of bytes to read (should be less than RXMAXBUFFLEN)
typedef enum {
Ready,
@@ -42,8 +32,8 @@ typedef enum {
uint8_t errorCode;
uint8_t repStart;
}TWIInfoStruct;
-TWIInfoStruct TWIInfo;
+extern TWIInfoStruct TWIInfo;
// TWI Status Codes
#define TWI_START_SENT 0x08 // Start sent