From b7782c1e8f383fa2a865fa15f528e50b6b58ca92 Mon Sep 17 00:00:00 2001 From: Anton Mukhin Date: Wed, 19 Jun 2024 10:05:47 +0300 Subject: [PATCH] v11.1 Reg 0x2011 --- Core/Inc/board_logic.h | 2 +- Core/Src/board_logic.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/Inc/board_logic.h b/Core/Inc/board_logic.h index 866d8f4..2beda42 100644 --- a/Core/Inc/board_logic.h +++ b/Core/Inc/board_logic.h @@ -6,7 +6,7 @@ #ifndef BOARD_LOGIC_H_ #define BOARD_LOGIC_H_ -#define MODBUS_FIRMWARE_VERSION ( /*major*/ 11 + /*minor*/ 0 * 0x100) +#define MODBUS_FIRMWARE_VERSION ( /*major*/ 11 + /*minor*/ 1 * 0x100) #define MODBUS_BOARD_TYPE (8) //Relay Module board ID #define REL_MAIN_BIT (1u<<0) diff --git a/Core/Src/board_logic.c b/Core/Src/board_logic.c index 4551776..f0084ac 100644 --- a/Core/Src/board_logic.c +++ b/Core/Src/board_logic.c @@ -189,6 +189,10 @@ uint8_t read_register(uint16_t address, uint16_t* value) { *value = status; status &= 0b011; // Reset light button press event status + } + else if (address == 0x2011) //Read E-STOP status + { + *value = (status & 0b010)>>1; // Read E-stop status bit and shift it to bit 0 position } else return 1;