From e87a900935417d6cc5aee280a2f8a37fb74d9872 Mon Sep 17 00:00:00 2001 From: Raido Pahtma <3406157+raidoz@users.noreply.github.com> Date: Thu, 31 Mar 2022 20:13:21 +0300 Subject: [PATCH] Fix AS504x DIAG and MAGN addresses. --- encoder/enc_as504x.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/encoder/enc_as504x.c b/encoder/enc_as504x.c index 2459943eb..88a7cbe35 100644 --- a/encoder/enc_as504x.c +++ b/encoder/enc_as504x.c @@ -32,6 +32,7 @@ #include #include +#define AS504x_SPI_PARITY_BIT 0x8000 #define AS504x_SPI_READ_BIT 0x4000 #define AS504x_SPI_WRITE_BIT 0x0000 @@ -42,11 +43,11 @@ #define AS504x_SPI_EXCLUDE_PARITY_AND_ERROR_BITMASK 0x3FFF -#define AS504x_SPI_DIAG_ADR 0x3FFD -#define AS504x_SPI_MAGN_ADR 0x3FFE +#define AS504x_SPI_DIAG_ADR 0x3FFC +#define AS504x_SPI_MAGN_ADR 0x3FFD #define AS504x_SPI_CLEAR_ERROR_ADR 0x0001 -#define AS504x_SPI_READ_DIAG_MSG (AS504x_SPI_DIAG_ADR | AS504x_SPI_READ_BIT) +#define AS504x_SPI_READ_DIAG_MSG (AS504x_SPI_DIAG_ADR | AS504x_SPI_READ_BIT | AS504x_SPI_PARITY_BIT) #define AS504x_SPI_READ_MAGN_MSG (AS504x_SPI_MAGN_ADR | AS504x_SPI_READ_BIT) #define AS504x_SPI_READ_CLEAR_ERROR_MSG (AS504x_SPI_CLEAR_ERROR_ADR | AS504x_SPI_READ_BIT)