move DATA_SIZE to global

This commit is contained in:
2025-05-25 15:07:39 +02:00
parent 17a5b457d6
commit 52e2c96e0e
3 changed files with 7 additions and 2 deletions

View File

@ -16,7 +16,6 @@
#define IIC_DEVICE "/dev/i2c-7" #define IIC_DEVICE "/dev/i2c-7"
#define BUFFER_BLOCKS 128 #define BUFFER_BLOCKS 128
#define BUFFER_DATA_SIZE 8
#define HEADING_SIM_UP "sim/autopilot/heading_up" #define HEADING_SIM_UP "sim/autopilot/heading_up"
#define HEADING_SIM_DOWN "sim/autopilot/heading_down" #define HEADING_SIM_DOWN "sim/autopilot/heading_down"
@ -31,7 +30,7 @@ struct ringBuffer i2cDataRead;
struct ringBuffer i2cDataWrite; struct ringBuffer i2cDataWrite;
struct blockData { struct blockData {
char data[BUFFER_DATA_SIZE]; char data[DATA_SIZE];
int triggerBit; int triggerBit;
}; };

View File

@ -8,3 +8,4 @@
#define TRIGGER_BIT_2 4 #define TRIGGER_BIT_2 4
#define HIGH_BIT_2 8 #define HIGH_BIT_2 8
#define I2C_ADDRESS_START 0x08 #define I2C_ADDRESS_START 0x08
#define DATA_SIZE 8

View File

@ -51,6 +51,11 @@ uint8_t lastClk = HIGH;
byte valueBuffer[VALUE_BUFFER] = { 0 }; byte valueBuffer[VALUE_BUFFER] = { 0 };
uint8_t readerPos, writerPos = 0; uint8_t readerPos, writerPos = 0;
// ringbuffer of display data
struct {
}
void addValue(uint8_t value) { void addValue(uint8_t value) {
valueBuffer[writerPos++] = value; valueBuffer[writerPos++] = value;