xubovey / freemodbus_slave-master-freertos-stm32 Goto Github PK
View Code? Open in Web Editor NEWThis project forked from xmanazc/freemodbus_slave-master-freertos-stm32
基于FreeRTOS支持多主从机
License: Other
This project forked from xmanazc/freemodbus_slave-master-freertos-stm32
基于FreeRTOS支持多主从机
License: Other
void vMBPortTimersEnable(void * this)
{
TIM_HandleTypeDef *p = (TIM_HandleTypeDef *)this;
__HAL_TIM_SET_COUNTER(p, 0);
HAL_TIM_Base_Start_IT((TIM_HandleTypeDef *)this);
}
开启定时器前先清清零定时器,否则从机接收数据总是出错
case EV_MASTER_FRAME_RECEIVED:
eStatus = p->peMBMasterFrameReceiveCur(this, &ucRcvAddress, &ucMBFrame, &usLength);
/* Check if the frame is for us. If not ,send an error process event. */
if ((eStatus == MB_ENOERR) && (ucRcvAddress == p->ucMBMasterDestAddress))
{
goto EV_MASTER_EXECUTE_LABLE;
}
else
{
p->eMBMasterCurErrorType = EV_ERROR_RECEIVE_DATA;
goto EV_MASTER_ERROR_PROCESS_LABLE;
}
break;
case EV_MASTER_EXECUTE:
EV_MASTER_EXECUTE_LABLE:
ucMBFrame = (UCHAR *)&(p->ucMasterRTUSndBuf[MB_SER_PDU_PDU_OFF]);
ucFunctionCode = ucMBFrame[MB_PDU_FUNC_OFF];
eException = MB_EX_ILLEGAL_FUNCTION;
代码中 ucMBFrame = (UCHAR *)&(p->ucMasterRTUSndBuf[MB_SER_PDU_PDU_OFF]); 不应该出现这行
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.