mirror of
https://github.com/espressif/esp-modbus.git
synced 2025-07-30 10:27:16 +02:00
change master.c example to test exposed funcs
This commit is contained in:
@ -292,15 +292,18 @@ static esp_err_t master_init(void)
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
//#include "port.h"
|
#include "port.h"
|
||||||
#include "mb_m.h"
|
#include "mbport.h"
|
||||||
|
//#include "mb_m.h"
|
||||||
|
|
||||||
eMBException functionHandler( UCHAR * pucFrame, USHORT * pusLength )
|
// eMBException functionHandler( UCHAR * pucFrame, USHORT * pusLength )
|
||||||
{
|
// {
|
||||||
return MB_EX_GATEWAY_PATH_FAILED;
|
// return MB_EX_GATEWAY_PATH_FAILED;
|
||||||
}
|
// }
|
||||||
|
|
||||||
extern eMBErrorCode eMBRegisterCB( UCHAR ucFunctionCode, pxMBFunctionHandler pxHandler );
|
//extern void vMBMasterRxFlush( void );
|
||||||
|
|
||||||
|
// extern eMBErrorCode eMBRegisterCB( UCHAR ucFunctionCode, pxMBFunctionHandler pxHandler );
|
||||||
|
|
||||||
void app_main(void)
|
void app_main(void)
|
||||||
{
|
{
|
||||||
@ -308,7 +311,8 @@ void app_main(void)
|
|||||||
ESP_ERROR_CHECK(master_init());
|
ESP_ERROR_CHECK(master_init());
|
||||||
vTaskDelay(10);
|
vTaskDelay(10);
|
||||||
|
|
||||||
eMBRegisterCB(10, &functionHandler);
|
//eMBRegisterCB(10, &functionHandler);
|
||||||
|
vMBMasterRxFlush();
|
||||||
|
|
||||||
master_operation_func(NULL);
|
master_operation_func(NULL);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user