release 0.5 (*API CHANGED)

- чуть переделаны некоторые дефайны для универсализации
- смена направления сделана через указател на функцию, а не глобальный дефайн
- добавлен бета осцилограф модбас
- некоторый рефакторинг
This commit is contained in:
2026-02-20 10:41:31 +03:00
parent 3aa279736d
commit a880f46a56
18 changed files with 415 additions and 114 deletions

View File

@@ -36,7 +36,7 @@ MB_ExceptionTypeDef MB_Input_Write_Global(uint16_t Addr, uint16_t WriteVal)
uint16_t *pInRegs;
//------------WRITE COIL-------------
Exception = MB_DefineRegistersAddress(&pInRegs, Addr, 1, RegisterType_Input);
Exception = MB_DefineRegistersAddress(&pInRegs, Addr, 1, RegisterType_Input, 1);
if(Exception == ET_NO_ERRORS)
{
*(pInRegs) = WriteVal;
@@ -62,7 +62,7 @@ uint16_t MB_Input_Read_Global(uint16_t Addr, MB_ExceptionTypeDef *Exception)
uint16_t *pInRegs;
//------------READ COIL--------------
Exception_tmp = MB_DefineRegistersAddress(&pInRegs, Addr, 1, RegisterType_Input);
Exception_tmp = MB_DefineRegistersAddress(&pInRegs, Addr, 1, RegisterType_Input, 0);
if(Exception) // if exception is not given to func fill it
*Exception = Exception_tmp;
@@ -89,7 +89,7 @@ uint8_t MB_Process_Read_Input_Regs(RS_MsgTypeDef *modbus_msg)
//---------CHECK FOR ERRORS----------
// get origin address for data
uint16_t *pInRegs;
modbus_msg->Except_Code = MB_DefineRegistersAddress(&pInRegs, modbus_msg->Addr, modbus_msg->Qnt, RegisterType_Input); // определение адреса регистров
modbus_msg->Except_Code = MB_DefineRegistersAddress(&pInRegs, modbus_msg->Addr, modbus_msg->Qnt, RegisterType_Input, 0); // определение адреса регистров
if(modbus_msg->Except_Code != ET_NO_ERRORS)
return 0;