debug modbus slave
This commit is contained in:
+21
-26
@@ -268,9 +268,7 @@ CONFIG_RT_USING_I2C_BITOPS=y
|
|||||||
# CONFIG_RT_USING_MTD_NOR is not set
|
# CONFIG_RT_USING_MTD_NOR is not set
|
||||||
# CONFIG_RT_USING_MTD_NAND is not set
|
# CONFIG_RT_USING_MTD_NAND is not set
|
||||||
# CONFIG_RT_USING_PM is not set
|
# CONFIG_RT_USING_PM is not set
|
||||||
CONFIG_RT_USING_RTC=y
|
# CONFIG_RT_USING_RTC is not set
|
||||||
# CONFIG_RT_USING_ALARM is not set
|
|
||||||
# CONFIG_RT_USING_SOFT_RTC is not set
|
|
||||||
# CONFIG_RT_USING_SDIO is not set
|
# CONFIG_RT_USING_SDIO is not set
|
||||||
# CONFIG_RT_USING_SPI is not set
|
# CONFIG_RT_USING_SPI is not set
|
||||||
CONFIG_RT_USING_WDT=y
|
CONFIG_RT_USING_WDT=y
|
||||||
@@ -392,32 +390,31 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0
|
|||||||
# CONFIG_PKG_USING_WEBTERMINAL is not set
|
# CONFIG_PKG_USING_WEBTERMINAL is not set
|
||||||
CONFIG_PKG_USING_FREEMODBUS=y
|
CONFIG_PKG_USING_FREEMODBUS=y
|
||||||
CONFIG_PKG_FREEMODBUS_PATH="/packages/iot/freemodbus"
|
CONFIG_PKG_FREEMODBUS_PATH="/packages/iot/freemodbus"
|
||||||
CONFIG_PKG_MODBUS_MASTER=y
|
# CONFIG_PKG_MODBUS_MASTER is not set
|
||||||
|
CONFIG_PKG_MODBUS_SLAVE=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# advanced configuration
|
# advanced configuration
|
||||||
#
|
#
|
||||||
CONFIG_RT_M_DISCRETE_INPUT_START=0
|
CONFIG_RT_S_DISCRETE_INPUT_START=0
|
||||||
CONFIG_RT_M_DISCRETE_INPUT_NDISCRETES=16
|
CONFIG_RT_S_DISCRETE_INPUT_NDISCRETES=16
|
||||||
CONFIG_RT_M_COIL_START=0
|
CONFIG_RT_S_COIL_START=0
|
||||||
CONFIG_RT_M_COIL_NCOILS=64
|
CONFIG_RT_S_COIL_NCOILS=64
|
||||||
CONFIG_RT_M_REG_INPUT_START=0
|
CONFIG_RT_S_REG_INPUT_START=0
|
||||||
CONFIG_RT_M_REG_INPUT_NREGS=100
|
CONFIG_RT_S_REG_INPUT_NREGS=100
|
||||||
CONFIG_RT_M_REG_HOLDING_START=0
|
CONFIG_RT_S_REG_HOLDING_START=0
|
||||||
CONFIG_RT_M_REG_HOLDING_NREGS=100
|
CONFIG_RT_S_REG_HOLDING_NREGS=100
|
||||||
CONFIG_RT_M_HD_RESERVE=0
|
CONFIG_RT_S_HD_RESERVE=0
|
||||||
CONFIG_RT_M_IN_RESERVE=0
|
CONFIG_RT_S_IN_RESERVE=0
|
||||||
CONFIG_RT_M_CO_RESERVE=0
|
CONFIG_RT_S_CO_RESERVE=0
|
||||||
CONFIG_RT_M_DI_RESERVE=0
|
CONFIG_RT_S_DI_RESERVE=0
|
||||||
# end of advanced configuration
|
# end of advanced configuration
|
||||||
|
|
||||||
CONFIG_PKG_MODBUS_MASTER_RTU=y
|
CONFIG_PKG_MODBUS_SLAVE_RTU=y
|
||||||
# CONFIG_RT_MODBUS_MASTER_USE_CONTROL_PIN is not set
|
# CONFIG_PKG_MODBUS_SLAVE_ASCII is not set
|
||||||
CONFIG_PKG_MODBUS_MASTER_SAMPLE=y
|
# CONFIG_PKG_MODBUS_SLAVE_TCP is not set
|
||||||
CONFIG_MB_SAMPLE_TEST_SLAVE_ADDR=1
|
# CONFIG_RT_MODBUS_SLAVE_USE_CONTROL_PIN is not set
|
||||||
CONFIG_MB_MASTER_USING_PORT_NUM=1
|
# CONFIG_PKG_MODBUS_SLAVE_SAMPLE is not set
|
||||||
CONFIG_MB_MASTER_USING_PORT_BAUDRATE=115200
|
|
||||||
# CONFIG_PKG_MODBUS_SLAVE is not set
|
|
||||||
# CONFIG_PKG_USING_FREEMODBUS_V160 is not set
|
# CONFIG_PKG_USING_FREEMODBUS_V160 is not set
|
||||||
CONFIG_PKG_USING_FREEMODBUS_LATEST_VERSION=y
|
CONFIG_PKG_USING_FREEMODBUS_LATEST_VERSION=y
|
||||||
CONFIG_PKG_FREEMODBUS_VER="latest"
|
CONFIG_PKG_FREEMODBUS_VER="latest"
|
||||||
@@ -1482,9 +1479,7 @@ CONFIG_BSP_USING_I2C4=y
|
|||||||
CONFIG_BSP_USING_CAN=y
|
CONFIG_BSP_USING_CAN=y
|
||||||
CONFIG_BSP_USING_CAN1=y
|
CONFIG_BSP_USING_CAN1=y
|
||||||
# CONFIG_BSP_USING_ADC is not set
|
# CONFIG_BSP_USING_ADC is not set
|
||||||
CONFIG_BSP_USING_ONCHIP_RTC=y
|
# CONFIG_BSP_USING_ONCHIP_RTC is not set
|
||||||
CONFIG_BSP_RTC_USING_LSE=y
|
|
||||||
# CONFIG_BSP_RTC_USING_LSI is not set
|
|
||||||
CONFIG_BSP_USING_WDT=y
|
CONFIG_BSP_USING_WDT=y
|
||||||
# CONFIG_BSP_USING_USBD is not set
|
# CONFIG_BSP_USING_USBD is not set
|
||||||
# CONFIG_BSP_USING_USBH is not set
|
# CONFIG_BSP_USING_USBH is not set
|
||||||
|
|||||||
@@ -13,13 +13,6 @@
|
|||||||
#include <rtdbg.h>
|
#include <rtdbg.h>
|
||||||
|
|
||||||
struct chrg_tty_t chrgtty[TOTAL_TTY] = {
|
struct chrg_tty_t chrgtty[TOTAL_TTY] = {
|
||||||
[IDX_TTY_RS485] = {
|
|
||||||
.dev = RT_NULL,
|
|
||||||
.name = DEV_NAME_RS485,
|
|
||||||
.index = IDX_TTY_RS485,
|
|
||||||
.baudrate = BAUD_RATE_115200,
|
|
||||||
.rb = RT_NULL,
|
|
||||||
},
|
|
||||||
[IDX_TTY_LCD] = {
|
[IDX_TTY_LCD] = {
|
||||||
.dev = RT_NULL,
|
.dev = RT_NULL,
|
||||||
.name = DEV_NAME_LCD,
|
.name = DEV_NAME_LCD,
|
||||||
@@ -43,33 +36,16 @@ struct chrg_tty_t chrgtty[TOTAL_TTY] = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static rt_err_t chrg_rs485_tty_input (rt_device_t dev, rt_size_t size)
|
|
||||||
{
|
|
||||||
rt_err_t ret;
|
|
||||||
struct chrg_tty_t *pTTY = &chrgtty[IDX_TTY_RS485];
|
|
||||||
|
|
||||||
if ((RT_NULL != dev) && (RT_NULL != pTTY->mq) && (size > 0)) {
|
|
||||||
pTTY->msg_mq.dev = dev;
|
|
||||||
pTTY->msg_mq.size = size;
|
|
||||||
ret = rt_mq_send(pTTY->mq, &pTTY->msg_mq, sizeof(struct mq_msg_t));
|
|
||||||
if (RT_EOK != ret) {
|
|
||||||
LOG_E("send mq '%s' failed.", pTTY->name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static rt_err_t chrg_lcd_tty_input (rt_device_t dev, rt_size_t size)
|
static rt_err_t chrg_lcd_tty_input (rt_device_t dev, rt_size_t size)
|
||||||
{
|
{
|
||||||
rt_err_t ret;
|
rt_err_t ret;
|
||||||
struct chrg_tty_t *pTTY = &chrgtty[IDX_TTY_LCD];
|
struct chrg_tty_t *pTTY = &chrgtty[IDX_TTY_LCD];
|
||||||
|
struct mq_msg_t msg;
|
||||||
|
|
||||||
if ((RT_NULL != dev) && (RT_NULL != pTTY->mq) && (size > 0)) {
|
if ((RT_NULL != dev) && (RT_NULL != pTTY->mq) && (size > 0)) {
|
||||||
pTTY->msg_mq.dev = dev;
|
msg.dev = dev;
|
||||||
pTTY->msg_mq.size = size;
|
msg.size = size;
|
||||||
ret = rt_mq_send(pTTY->mq, &pTTY->msg_mq, sizeof(struct mq_msg_t));
|
ret = rt_mq_send(pTTY->mq, &msg, sizeof(struct mq_msg_t));
|
||||||
if (RT_EOK != ret) {
|
if (RT_EOK != ret) {
|
||||||
LOG_E("send mq '%s' failed.", pTTY->name);
|
LOG_E("send mq '%s' failed.", pTTY->name);
|
||||||
}
|
}
|
||||||
@@ -82,11 +58,12 @@ static rt_err_t chrg_north_tty_input (rt_device_t dev, rt_size_t size)
|
|||||||
{
|
{
|
||||||
rt_err_t ret;
|
rt_err_t ret;
|
||||||
struct chrg_tty_t *pTTY = &chrgtty[IDX_TTY_NORTH];
|
struct chrg_tty_t *pTTY = &chrgtty[IDX_TTY_NORTH];
|
||||||
|
struct mq_msg_t msg;
|
||||||
|
|
||||||
if ((RT_NULL != dev) && (RT_NULL != pTTY->mq) && (size > 0)) {
|
if ((RT_NULL != dev) && (RT_NULL != pTTY->mq) && (size > 0)) {
|
||||||
pTTY->msg_mq.dev = dev;
|
msg.dev = dev;
|
||||||
pTTY->msg_mq.size = size;
|
msg.size = size;
|
||||||
ret = rt_mq_send(pTTY->mq, &pTTY->msg_mq, sizeof(struct mq_msg_t));
|
ret = rt_mq_send(pTTY->mq, &msg, sizeof(struct mq_msg_t));
|
||||||
if (RT_EOK != ret) {
|
if (RT_EOK != ret) {
|
||||||
LOG_E("send mq '%s' failed.", pTTY->name);
|
LOG_E("send mq '%s' failed.", pTTY->name);
|
||||||
}
|
}
|
||||||
@@ -99,11 +76,12 @@ static rt_err_t chrg_south_tty_input (rt_device_t dev, rt_size_t size)
|
|||||||
{
|
{
|
||||||
rt_err_t ret;
|
rt_err_t ret;
|
||||||
struct chrg_tty_t *pTTY = &chrgtty[IDX_TTY_SOUTH];
|
struct chrg_tty_t *pTTY = &chrgtty[IDX_TTY_SOUTH];
|
||||||
|
struct mq_msg_t msg;
|
||||||
|
|
||||||
if ((RT_NULL != dev) && (RT_NULL != pTTY->mq) && (size > 0)) {
|
if ((RT_NULL != dev) && (RT_NULL != pTTY->mq) && (size > 0)) {
|
||||||
pTTY->msg_mq.dev = dev;
|
msg.dev = dev;
|
||||||
pTTY->msg_mq.size = size;
|
msg.size = size;
|
||||||
ret = rt_mq_send(pTTY->mq, &pTTY->msg_mq, sizeof(struct mq_msg_t));
|
ret = rt_mq_send(pTTY->mq, &msg, sizeof(struct mq_msg_t));
|
||||||
if (RT_EOK != ret) {
|
if (RT_EOK != ret) {
|
||||||
LOG_E("send mq '%s' failed.", pTTY->name);
|
LOG_E("send mq '%s' failed.", pTTY->name);
|
||||||
}
|
}
|
||||||
@@ -150,9 +128,6 @@ rt_err_t chrg_tty_open (struct chrg_tty_t *pTTY)
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (pTTY->index) {
|
switch (pTTY->index) {
|
||||||
case IDX_TTY_RS485:
|
|
||||||
rt_device_set_rx_indicate(pTTY->dev, chrg_rs485_tty_input);
|
|
||||||
break;
|
|
||||||
case IDX_TTY_LCD:
|
case IDX_TTY_LCD:
|
||||||
rt_device_set_rx_indicate(pTTY->dev, chrg_lcd_tty_input);
|
rt_device_set_rx_indicate(pTTY->dev, chrg_lcd_tty_input);
|
||||||
break;
|
break;
|
||||||
@@ -181,10 +156,6 @@ static int chrg_tty_init (void)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for (i = 0; i < TOTAL_TTY; i++) {
|
for (i = 0; i < TOTAL_TTY; i++) {
|
||||||
if (IDX_TTY_RS485 == i) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
pTTY = &chrgtty[i];
|
pTTY = &chrgtty[i];
|
||||||
chrg_tty_open(pTTY);
|
chrg_tty_open(pTTY);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
#include <rtdevice.h>
|
#include <rtdevice.h>
|
||||||
|
|
||||||
#define DEV_NAME_RS485 "uart1"
|
|
||||||
#define DEV_NAME_LCD "uart2"
|
#define DEV_NAME_LCD "uart2"
|
||||||
#define DEV_NAME_NORTH "uart3"
|
#define DEV_NAME_NORTH "uart3"
|
||||||
#define DEV_NAME_SOUTH "uart6"
|
#define DEV_NAME_SOUTH "uart6"
|
||||||
@@ -12,10 +11,9 @@
|
|||||||
#define SIZE_BUF_UART 128
|
#define SIZE_BUF_UART 128
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
IDX_TTY_RS485 = 0, // 0
|
IDX_TTY_LCD = 0, // 0
|
||||||
IDX_TTY_LCD, // 1
|
IDX_TTY_NORTH, // 1
|
||||||
IDX_TTY_NORTH, // 2
|
IDX_TTY_SOUTH, // 2
|
||||||
IDX_TTY_SOUTH, // 3
|
|
||||||
|
|
||||||
TOTAL_TTY
|
TOTAL_TTY
|
||||||
} eIDX_TTY;
|
} eIDX_TTY;
|
||||||
@@ -33,7 +31,6 @@ struct chrg_tty_t {
|
|||||||
eIDX_TTY index;
|
eIDX_TTY index;
|
||||||
|
|
||||||
rt_mq_t mq;
|
rt_mq_t mq;
|
||||||
struct mq_msg_t msg_mq;
|
|
||||||
|
|
||||||
struct rt_ringbuffer *rb;
|
struct rt_ringbuffer *rb;
|
||||||
struct rt_semaphore sem_rx;
|
struct rt_semaphore sem_rx;
|
||||||
|
|||||||
@@ -1,7 +1,92 @@
|
|||||||
|
|
||||||
|
#include <rtthread.h>
|
||||||
|
|
||||||
|
#include "mb.h"
|
||||||
#include "chrg_comm.h"
|
#include "chrg_comm.h"
|
||||||
|
|
||||||
|
#define LOG_TAG "chrg.comm"
|
||||||
|
#define DBG_LEVEL DBG_LOG
|
||||||
|
#include <rtdbg.h>
|
||||||
|
|
||||||
|
extern rt_uint16_t usSRegHoldBuf[RT_S_REG_HOLDING_NREGS];
|
||||||
|
|
||||||
|
struct chrg_comm_t chrgcomm = {
|
||||||
|
.tid_poll = RT_NULL,
|
||||||
|
.tid_send = RT_NULL,
|
||||||
|
.name_poll = THR_NAME_POLL,
|
||||||
|
.name_send = THR_NAME_SEND,
|
||||||
|
.addr = MODBUS_ADDRESS_DEFAULT,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
static void chrg_comm_send (void *pdata)
|
||||||
|
{
|
||||||
|
struct chrg_comm_t *pCOMM = (struct chrg_comm_t *)pdata;
|
||||||
|
if (RT_NULL == pCOMM) {
|
||||||
|
LOG_E("send null.");
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
rt_uint16_t *usRegHoldingBuf;
|
||||||
|
usRegHoldingBuf = usSRegHoldBuf;
|
||||||
|
rt_base_t level;
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
level = rt_hw_interrupt_disable();
|
||||||
|
usRegHoldingBuf[3] = (rt_uint16_t)(rt_tick_get() / 100);
|
||||||
|
rt_hw_interrupt_enable(level);
|
||||||
|
|
||||||
|
rt_thread_mdelay(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void chrg_comm_poll (void *pdata)
|
||||||
|
{
|
||||||
|
struct chrg_comm_t *pCOMM = (struct chrg_comm_t *)pdata;
|
||||||
|
if (RT_NULL == pCOMM) {
|
||||||
|
LOG_E("poll null.");
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
|
||||||
|
eMBInit(MB_RTU, pCOMM->addr, 1, 115200, MB_PAR_EVEN);
|
||||||
|
|
||||||
|
eMBEnable();
|
||||||
|
|
||||||
|
while (1) {
|
||||||
|
eMBPoll();
|
||||||
|
rt_thread_mdelay(200);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static int chrg_comm_init (void)
|
||||||
|
{
|
||||||
|
struct chrg_comm_t *pCOMM = &chrgcomm;
|
||||||
|
|
||||||
|
pCOMM->tid_poll = rt_thread_create(pCOMM->name_poll, chrg_comm_poll,
|
||||||
|
pCOMM, 1024, RT_MAIN_THREAD_PRIORITY-1, 10);
|
||||||
|
if (RT_NULL != pCOMM->tid_poll) {
|
||||||
|
rt_thread_startup(pCOMM->tid_poll);
|
||||||
|
} else {
|
||||||
|
LOG_E("create thread '%s' failed.", pCOMM->name_poll);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pCOMM->tid_send = rt_thread_create(pCOMM->name_send, chrg_comm_send,
|
||||||
|
pCOMM, 1024, RT_MAIN_THREAD_PRIORITY-2, 10);
|
||||||
|
if (RT_NULL != pCOMM->tid_send) {
|
||||||
|
rt_thread_startup(pCOMM->tid_send);
|
||||||
|
} else {
|
||||||
|
LOG_E("create thread '%s' failed.", pCOMM->name_send);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
INIT_APP_EXPORT(chrg_comm_init);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,26 @@
|
|||||||
#ifndef __CHRG_COMM_H__
|
#ifndef __CHRG_COMM_H__
|
||||||
#define __CHRG_COMM_H__
|
#define __CHRG_COMM_H__
|
||||||
|
|
||||||
|
#define THR_NAME_POLL "thr.poll"
|
||||||
|
#define THR_NAME_SEND "thr.send"
|
||||||
|
|
||||||
|
#define MODBUS_ADDRESS_DEFAULT 0x01
|
||||||
|
|
||||||
|
struct chrg_comm_t {
|
||||||
|
rt_thread_t tid_poll;
|
||||||
|
rt_thread_t tid_send;
|
||||||
|
|
||||||
|
const char *name_poll;
|
||||||
|
const char *name_send;
|
||||||
|
|
||||||
|
rt_uint8_t addr; // slave address
|
||||||
|
};
|
||||||
|
|
||||||
|
extern struct chrg_comm_t chrgcomm;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -40,23 +40,23 @@ static void chrg_north_thread_entry (void *data)
|
|||||||
rt_uint8_t crc8 = 0;
|
rt_uint8_t crc8 = 0;
|
||||||
rt_size_t len_mq = 0, len_get = 0, len_msg = 0;
|
rt_size_t len_mq = 0, len_get = 0, len_msg = 0;
|
||||||
struct chrg_tty_t *pTTY = pNOR->tty;
|
struct chrg_tty_t *pTTY = pNOR->tty;
|
||||||
struct mq_msg_t *pMQ = &pTTY->msg_mq;
|
struct mq_msg_t msg;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
rt_memset(pMQ, 0, sizeof(struct mq_msg_t));
|
rt_memset(&msg, 0, sizeof(struct mq_msg_t));
|
||||||
len_mq = rt_mq_recv(pTTY->mq, pMQ, sizeof(struct mq_msg_t), RT_WAITING_FOREVER);
|
len_mq = rt_mq_recv(pTTY->mq, &msg, sizeof(struct mq_msg_t), RT_WAITING_FOREVER);
|
||||||
if (len_mq <= 0) {
|
if (len_mq <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
len_get = rt_device_read(pMQ->dev, 0, &pNOR->rx_buf[0], 1);
|
len_get = rt_device_read(msg.dev, 0, &pNOR->rx_buf[0], 1);
|
||||||
if (1 != len_get) {
|
if (1 != len_get) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pNOR->rx_len = 1;
|
pNOR->rx_len = 1;
|
||||||
|
|
||||||
len_msg = rt_device_read(pMQ->dev, 0, &pNOR->rx_buf[1], len_get-1);
|
len_msg = rt_device_read(msg.dev, 0, &pNOR->rx_buf[1], len_get-1);
|
||||||
if (len_msg <= 0) {
|
if (len_msg <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,18 @@ struct chrg_south_t chrgsouth = {
|
|||||||
.rx_len = 0,
|
.rx_len = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
int chrg_south_send (rt_uint8_t *data, rt_size_t length)
|
||||||
|
{
|
||||||
|
rt_ssize_t ret = -1;
|
||||||
|
struct chrg_tty_t *pTTY = chrgsouth.tty;
|
||||||
|
|
||||||
|
if ((RT_NULL != pTTY)&&(RT_NULL != pTTY->dev)) {
|
||||||
|
ret = rt_device_write(pTTY->dev, 0, data, length);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static void chrg_south_thread_entry (void *data)
|
static void chrg_south_thread_entry (void *data)
|
||||||
{
|
{
|
||||||
struct chrg_south_t *pSOU = (struct chrg_south_t *)data;
|
struct chrg_south_t *pSOU = (struct chrg_south_t *)data;
|
||||||
@@ -27,23 +39,23 @@ static void chrg_south_thread_entry (void *data)
|
|||||||
rt_uint8_t crc8 = 0;
|
rt_uint8_t crc8 = 0;
|
||||||
rt_size_t len_mq = 0, len_get = 0, len_msg = 0;
|
rt_size_t len_mq = 0, len_get = 0, len_msg = 0;
|
||||||
struct chrg_tty_t *pTTY = pSOU->tty;
|
struct chrg_tty_t *pTTY = pSOU->tty;
|
||||||
struct mq_msg_t *pMQ = &pTTY->msg_mq;
|
struct mq_msg_t msg;
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
rt_memset(pMQ, 0, sizeof(struct mq_msg_t));
|
rt_memset(&msg, 0, sizeof(struct mq_msg_t));
|
||||||
len_mq = rt_mq_recv(pTTY->mq, pMQ, sizeof(struct mq_msg_t), RT_WAITING_FOREVER);
|
len_mq = rt_mq_recv(pTTY->mq, &msg, sizeof(struct mq_msg_t), RT_WAITING_FOREVER);
|
||||||
if (len_mq <= 0) {
|
if (len_mq <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
len_get = rt_device_read(pMQ->dev, 0, &pSOU->rx_buf[0], 1);
|
len_get = rt_device_read(msg.dev, 0, &pSOU->rx_buf[0], 1);
|
||||||
if (1 != len_get) {
|
if (1 != len_get) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pSOU->rx_len = 1;
|
pSOU->rx_len = 1;
|
||||||
|
|
||||||
len_msg = rt_device_read(pMQ->dev, 0, &pSOU->rx_buf[1], len_get-1);
|
len_msg = rt_device_read(msg.dev, 0, &pSOU->rx_buf[1], len_get-1);
|
||||||
if (len_msg <= 0) {
|
if (len_msg <= 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ struct chrg_south_t {
|
|||||||
|
|
||||||
extern struct chrg_south_t chrgsouth;
|
extern struct chrg_south_t chrgsouth;
|
||||||
|
|
||||||
|
extern int chrg_south_send (rt_uint8_t *data, rt_size_t length);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,21 @@
|
|||||||
|
|
||||||
#include "chrg_pkg.h"
|
#include "chrg_pkg.h"
|
||||||
|
|
||||||
int chrg_pkg_encode (eIDX_ID id, rt_uint8_t cmd, rt_uint8_t *data)
|
int chrg_pkg_encode (eIDX_ID id, rt_uint8_t cmd, rt_uint8_t *data_in,
|
||||||
|
rt_uint8_t len_in, rt_uint8_t *data_out, rt_uint8_t *len_out)
|
||||||
{
|
{
|
||||||
|
if ((RT_NULL == data_in)||(RT_NULL == data_out)||(0 == len_in)) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
data_out[0] = 5+len_in;
|
||||||
|
data_out[1] = 0x00;
|
||||||
|
data_out[2] = id;
|
||||||
|
data_out[3] = cmd;
|
||||||
|
memcpy(&data_out[4], data_in, len_in);
|
||||||
|
data_out[len_in+4] = calc_crc8(data_out, len_in+4);
|
||||||
|
|
||||||
|
*len_out = 5+len_in;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -16,4 +29,25 @@ int chrg_pkg_decode (eIDX_ID id, rt_uint8_t *data)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int chrg_pkg_send (eIDX_TTY idx, rt_uint8_t *data, rt_uint16_t len)
|
||||||
|
{
|
||||||
|
rt_ssize_t ret = -1;
|
||||||
|
struct chrg_tty_t *pTTY = RT_NULL;
|
||||||
|
|
||||||
|
switch (idx) {
|
||||||
|
case IDX_TTY_NORTH:
|
||||||
|
// pTTY = chrgnorth.tty;
|
||||||
|
break;
|
||||||
|
case IDX_TTY_SOUTH:
|
||||||
|
// pTTY = chrgsouth.tty;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((RT_NULL != pTTY)&&(RT_NULL != pTTY->dev)) {
|
||||||
|
ret = rt_device_write(pTTY->dev, 0, data, len);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,16 @@
|
|||||||
|
|
||||||
#include <rtthread.h>
|
#include <rtthread.h>
|
||||||
|
|
||||||
|
#include "chrg_tty.h"
|
||||||
#include "chrg_def.h"
|
#include "chrg_def.h"
|
||||||
|
|
||||||
extern int chrg_pkg_encode (eIDX_ID id, rt_uint8_t cmd, rt_uint8_t *data);
|
extern int chrg_pkg_encode (eIDX_ID id, rt_uint8_t cmd, rt_uint8_t *data_in,
|
||||||
|
rt_uint8_t len_in, rt_uint8_t *data_out, rt_uint8_t *len_out);
|
||||||
|
|
||||||
extern int chrg_pkg_decode (eIDX_ID id, rt_uint8_t *data);
|
extern int chrg_pkg_decode (eIDX_ID id, rt_uint8_t *data);
|
||||||
|
|
||||||
|
extern int chrg_pkg_send (eIDX_TTY idx, rt_uint8_t *data, rt_uint16_t len);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -6,26 +6,20 @@
|
|||||||
|
|
||||||
#include "chrg_utils.h"
|
#include "chrg_utils.h"
|
||||||
|
|
||||||
void source_get_vc (rt_uint16_t vol, rt_uint16_t cur)
|
int source_get_vc (rt_uint16_t vol, rt_uint16_t cur)
|
||||||
{
|
{
|
||||||
rt_size_t len = 0;
|
rt_size_t len = 0;
|
||||||
rt_uint8_t data[12] = {0};
|
rt_uint8_t data[12] = {0};
|
||||||
|
rt_uint8_t frame[16] = {0};
|
||||||
|
|
||||||
data[0] = 0x0B;
|
u16_to_u8v(vol, &data[0]);
|
||||||
data[1] = 0x00;
|
u16_to_u8v(cur, &data[2]);
|
||||||
data[2] = ID_SOURCE;
|
data[4] = 0x00;
|
||||||
data[3] = SRC_CMD_GET_VOLTAGE;
|
data[5] = 0x00;
|
||||||
|
|
||||||
u16_to_u8v(vol, &data[4]);
|
chrg_pkg_encode(ID_SOURCE, SRC_CMD_GET_VOLTAGE, data, 6, frame, &len);
|
||||||
u16_to_u8v(cur, &data[6]);
|
|
||||||
|
|
||||||
data[8] = 0x00;
|
return chrg_pkg_send(IDX_TTY_SOUTH, frame, len);
|
||||||
data[9] = 0x00;
|
|
||||||
data[10] = calc_crc8(data, 10);
|
|
||||||
|
|
||||||
len = 0x0B;
|
|
||||||
|
|
||||||
chrg_north_send(data, len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void source_get_pd (void)
|
void source_get_pd (void)
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
; *** Scatter-Loading Description File generated by uVision ***
|
; *** Scatter-Loading Description File generated by uVision ***
|
||||||
; *************************************************************
|
; *************************************************************
|
||||||
|
|
||||||
LR_IROM1 0x08010000 0x00040000 { ; load region size_region
|
LR_IROM1 0x08040000 0x00040000 { ; load region size_region
|
||||||
ER_IROM1 0x08010000 0x00040000 { ; load address = execution address
|
ER_IROM1 0x08040000 0x00040000 { ; load address = execution address
|
||||||
*.o (RESET, +First)
|
*.o (RESET, +First)
|
||||||
*(InRoot$$Sections)
|
*(InRoot$$Sections)
|
||||||
.ANY (+RO)
|
.ANY (+RO)
|
||||||
|
|||||||
+230
-301
@@ -337,9 +337,9 @@
|
|||||||
<v6Rtti>0</v6Rtti>
|
<v6Rtti>0</v6Rtti>
|
||||||
<VariousControls>
|
<VariousControls>
|
||||||
<MiscControls></MiscControls>
|
<MiscControls></MiscControls>
|
||||||
<Define>STM32F405xx, __CLK_TCK=RT_TICK_PER_SECOND, __STDC_LIMIT_MACROS, RT_USING_LIBC, USE_HAL_DRIVER, RT_USING_ARMLIBC, __RTTHREAD__</Define>
|
<Define>RT_USING_LIBC, __RTTHREAD__, RT_USING_ARMLIBC, __STDC_LIMIT_MACROS, USE_HAL_DRIVER, STM32F405xx, __CLK_TCK=RT_TICK_PER_SECOND</Define>
|
||||||
<Undefine></Undefine>
|
<Undefine></Undefine>
|
||||||
<IncludePath>..\..\rt-thread\components\fal\inc;..\..\rt-thread\components\libc\compilers\common\extension;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\config;..\..\rt-thread\components\libc\compilers\common\include;board\CubeMX_Config\Inc;..\..\libs\freemodbus\modbus\tcp;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\libc\posix\io\poll;..\..\libs\stm32f4\STM32F4_HAL\Inc\Legacy;..\..\libs\freemodbus\port;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\smp_call;..\..\libs\stm32f4\STM32F4_HAL\Inc;..\..\rt-thread\components\drivers\include;.;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\libc\posix\ipc;applications\thread;..\..\rt-thread\components\drivers\include;..\..\libs\freemodbus\modbus\include;applications;..\..\rt-thread\components\libc\compilers\common\extension\fcntl\octal;applications\bsp;..\..\libs\cmsis-core\Include;..\..\libs\freemodbus\modbus\ascii;board;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\finsh;board\ports;..\..\rt-thread\components\drivers\include;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\drv_flash;applications\utils;..\..\libs\freemodbus\modbus\rtu;..\..\rt-thread\components\libc\posix\io\eventfd;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers;..\..\rt-thread\libcpu\arm\cortex-m4;..\..\rt-thread\libcpu\arm\common;..\..\rt-thread\components\libc\posix\io\epoll;..\..\libs\stm32f4\STM32F4_CMSIS\Include;..\..\rt-thread\components\drivers\phy;..\..\rt-thread\include</IncludePath>
|
<IncludePath>..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\drv_flash;applications;..\..\rt-thread\components\libc\compilers\common\extension\fcntl\octal;..\..\rt-thread\components\drivers\include;applications\thread;..\..\libs\freemodbus\modbus\tcp;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers;..\..\rt-thread\components\drivers\phy;..\..\libs\stm32f4\STM32F4_CMSIS\Include;..\..\rt-thread\components\drivers\include;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\config;..\..\rt-thread\components\drivers\include;..\..\rt-thread\include;..\..\rt-thread\components\drivers\smp_call;..\..\rt-thread\components\fal\inc;..\..\libs\cmsis-core\Include;applications\utils;..\..\rt-thread\components\libc\compilers\common\include;..\..\rt-thread\components\drivers\include;..\..\libs\stm32f4\STM32F4_HAL\Inc\Legacy;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\finsh;..\..\rt-thread\components\libc\posix\io\poll;..\..\rt-thread\components\libc\posix\ipc;..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers;..\..\libs\freemodbus\modbus\ascii;..\..\rt-thread\components\drivers\include;..\..\libs\freemodbus\modbus\rtu;..\..\rt-thread\libcpu\arm\common;board;..\..\rt-thread\components\libc\compilers\common\extension;..\..\rt-thread\components\drivers\include;..\..\libs\freemodbus\modbus\include;..\..\rt-thread\components\drivers\include;..\..\rt-thread\components\libc\posix\io\eventfd;..\..\rt-thread\components\libc\posix\io\epoll;applications\bsp;board\CubeMX_Config\Inc;.;..\..\rt-thread\components\drivers\include;..\..\rt-thread\libcpu\arm\cortex-m4;..\..\libs\stm32f4\STM32F4_HAL\Inc;..\..\libs\freemodbus\port;board\ports</IncludePath>
|
||||||
</VariousControls>
|
</VariousControls>
|
||||||
</Cads>
|
</Cads>
|
||||||
<Aads>
|
<Aads>
|
||||||
@@ -394,99 +394,89 @@
|
|||||||
<GroupName>Applications/bsp</GroupName>
|
<GroupName>Applications/bsp</GroupName>
|
||||||
<Files>
|
<Files>
|
||||||
<File>
|
<File>
|
||||||
<FileName>chrg_pin.c</FileName>
|
<FileName>chrg_i2c.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>applications\bsp\chrg_pin.c</FilePath>
|
<FilePath>applications\bsp\chrg_i2c.c</FilePath>
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>chrg_intr.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>applications\bsp\chrg_intr.c</FilePath>
|
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>chrg_can.c</FileName>
|
<FileName>chrg_can.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>applications\bsp\chrg_can.c</FilePath>
|
<FilePath>applications\bsp\chrg_can.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
|
||||||
<FileName>chrg_tmr.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>applications\bsp\chrg_tmr.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>chrg_clk.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>applications\bsp\chrg_clk.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>chrg_wdt.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>applications\bsp\chrg_wdt.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>chrg_tty.c</FileName>
|
<FileName>chrg_tty.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>applications\bsp\chrg_tty.c</FilePath>
|
<FilePath>applications\bsp\chrg_tty.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
|
||||||
<FileName>chrg_switch.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>applications\bsp\chrg_switch.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>chrg_fal.c</FileName>
|
<FileName>chrg_fal.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>applications\bsp\chrg_fal.c</FilePath>
|
<FilePath>applications\bsp\chrg_fal.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>chrg_i2c.c</FileName>
|
<FileName>chrg_intr.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>applications\bsp\chrg_i2c.c</FilePath>
|
<FilePath>applications\bsp\chrg_intr.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>chrg_wdt.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>applications\bsp\chrg_wdt.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>chrg_switch.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>applications\bsp\chrg_switch.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>chrg_clk.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>applications\bsp\chrg_clk.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>chrg_pin.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>applications\bsp\chrg_pin.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>chrg_tmr.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>applications\bsp\chrg_tmr.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>Applications/thread</GroupName>
|
<GroupName>Applications/thread</GroupName>
|
||||||
<Files>
|
<Files>
|
||||||
<File>
|
|
||||||
<FileName>chrg_lcd.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>applications\thread\chrg_lcd.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>chrg_north.c</FileName>
|
<FileName>chrg_north.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>applications\thread\chrg_north.c</FilePath>
|
<FilePath>applications\thread\chrg_north.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>chrg_south.c</FileName>
|
<FileName>chrg_lcd.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>applications\thread\chrg_south.c</FilePath>
|
<FilePath>applications\thread\chrg_lcd.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>chrg_comm.c</FileName>
|
<FileName>chrg_comm.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>applications\thread\chrg_comm.c</FilePath>
|
<FilePath>applications\thread\chrg_comm.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>chrg_south.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>applications\thread\chrg_south.c</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>Applications/utils</GroupName>
|
<GroupName>Applications/utils</GroupName>
|
||||||
<Files>
|
<Files>
|
||||||
<File>
|
<File>
|
||||||
<FileName>chrg_pkg.c</FileName>
|
<FileName>chrg_sink.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>applications\utils\chrg_pkg.c</FilePath>
|
<FilePath>applications\utils\chrg_sink.c</FilePath>
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>chrg_utils.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>applications\utils\chrg_utils.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>chrg_source.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>applications\utils\chrg_source.c</FilePath>
|
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>chrg_pcf8574.c</FileName>
|
<FileName>chrg_pcf8574.c</FileName>
|
||||||
@@ -494,9 +484,19 @@
|
|||||||
<FilePath>applications\utils\chrg_pcf8574.c</FilePath>
|
<FilePath>applications\utils\chrg_pcf8574.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>chrg_sink.c</FileName>
|
<FileName>chrg_pkg.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>applications\utils\chrg_sink.c</FilePath>
|
<FilePath>applications\utils\chrg_pkg.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>chrg_source.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>applications\utils\chrg_source.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>chrg_utils.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>applications\utils\chrg_utils.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -1444,62 +1444,6 @@
|
|||||||
</FileArmAds>
|
</FileArmAds>
|
||||||
</FileOption>
|
</FileOption>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
|
||||||
<FileName>dev_rtc.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\rt-thread\components\drivers\rtc\dev_rtc.c</FilePath>
|
|
||||||
<FileOption>
|
|
||||||
<CommonProperty>
|
|
||||||
<UseCPPCompiler>2</UseCPPCompiler>
|
|
||||||
<RVCTCodeConst>0</RVCTCodeConst>
|
|
||||||
<RVCTZI>0</RVCTZI>
|
|
||||||
<RVCTOtherData>0</RVCTOtherData>
|
|
||||||
<ModuleSelection>0</ModuleSelection>
|
|
||||||
<IncludeInBuild>1</IncludeInBuild>
|
|
||||||
<AlwaysBuild>0</AlwaysBuild>
|
|
||||||
<GenerateAssemblyFile>0</GenerateAssemblyFile>
|
|
||||||
<AssembleAssemblyFile>0</AssembleAssemblyFile>
|
|
||||||
<PublicsOnly>0</PublicsOnly>
|
|
||||||
<StopOnExitCode>3</StopOnExitCode>
|
|
||||||
<CustomArgument></CustomArgument>
|
|
||||||
<IncludeLibraryModules></IncludeLibraryModules>
|
|
||||||
<ComprImg>1</ComprImg>
|
|
||||||
</CommonProperty>
|
|
||||||
<FileArmAds>
|
|
||||||
<Cads>
|
|
||||||
<interw>2</interw>
|
|
||||||
<Optim>0</Optim>
|
|
||||||
<oTime>2</oTime>
|
|
||||||
<SplitLS>2</SplitLS>
|
|
||||||
<OneElfS>2</OneElfS>
|
|
||||||
<Strict>2</Strict>
|
|
||||||
<EnumInt>2</EnumInt>
|
|
||||||
<PlainCh>2</PlainCh>
|
|
||||||
<Ropi>2</Ropi>
|
|
||||||
<Rwpi>2</Rwpi>
|
|
||||||
<wLevel>0</wLevel>
|
|
||||||
<uThumb>2</uThumb>
|
|
||||||
<uSurpInc>2</uSurpInc>
|
|
||||||
<uC99>2</uC99>
|
|
||||||
<uGnu>2</uGnu>
|
|
||||||
<useXO>2</useXO>
|
|
||||||
<v6Lang>0</v6Lang>
|
|
||||||
<v6LangP>0</v6LangP>
|
|
||||||
<vShortEn>2</vShortEn>
|
|
||||||
<vShortWch>2</vShortWch>
|
|
||||||
<v6Lto>2</v6Lto>
|
|
||||||
<v6WtE>2</v6WtE>
|
|
||||||
<v6Rtti>2</v6Rtti>
|
|
||||||
<VariousControls>
|
|
||||||
<MiscControls> </MiscControls>
|
|
||||||
<Define>__RT_IPC_SOURCE__</Define>
|
|
||||||
<Undefine> </Undefine>
|
|
||||||
<IncludePath></IncludePath>
|
|
||||||
</VariousControls>
|
|
||||||
</Cads>
|
|
||||||
</FileArmAds>
|
|
||||||
</FileOption>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>dev_serial.c</FileName>
|
<FileName>dev_serial.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
@@ -1642,11 +1586,6 @@
|
|||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\drv_gpio.c</FilePath>
|
<FilePath>..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\drv_gpio.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
|
||||||
<FileName>drv_rtc.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\rt-thread\bsp\stm32\libraries\HAL_Drivers\drivers\drv_rtc.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>drv_soft_i2c.c</FileName>
|
<FileName>drv_soft_i2c.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
@@ -1677,11 +1616,6 @@
|
|||||||
<Group>
|
<Group>
|
||||||
<GroupName>Fal</GroupName>
|
<GroupName>Fal</GroupName>
|
||||||
<Files>
|
<Files>
|
||||||
<File>
|
|
||||||
<FileName>fal_rtt.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\rt-thread\components\fal\src\fal_rtt.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>fal_partition.c</FileName>
|
<FileName>fal_partition.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
@@ -1692,6 +1626,11 @@
|
|||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\rt-thread\components\fal\src\fal_flash.c</FilePath>
|
<FilePath>..\..\rt-thread\components\fal\src\fal_flash.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>fal_rtt.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\rt-thread\components\fal\src\fal_rtt.c</FilePath>
|
||||||
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>fal.c</FileName>
|
<FileName>fal.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
@@ -1702,16 +1641,6 @@
|
|||||||
<Group>
|
<Group>
|
||||||
<GroupName>Finsh</GroupName>
|
<GroupName>Finsh</GroupName>
|
||||||
<Files>
|
<Files>
|
||||||
<File>
|
|
||||||
<FileName>msh_parse.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\rt-thread\components\finsh\msh_parse.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>shell.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\rt-thread\components\finsh\shell.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>msh.c</FileName>
|
<FileName>msh.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
@@ -1722,90 +1651,100 @@
|
|||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\rt-thread\components\finsh\cmd.c</FilePath>
|
<FilePath>..\..\rt-thread\components\finsh\cmd.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>msh_parse.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\rt-thread\components\finsh\msh_parse.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>shell.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\rt-thread\components\finsh\shell.c</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>FreeModbus</GroupName>
|
<GroupName>FreeModbus</GroupName>
|
||||||
<Files>
|
<Files>
|
||||||
<File>
|
|
||||||
<FileName>mbfuncdiag.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncdiag.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>mbcrc.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\modbus\rtu\mbcrc.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>user_mb_app_m.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\port\user_mb_app_m.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>port.c</FileName>
|
<FileName>port.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\freemodbus\port\port.c</FilePath>
|
<FilePath>..\..\libs\freemodbus\port\port.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
|
||||||
<FileName>porttimer_m.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\port\porttimer_m.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>sample_mb_master.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\samples\sample_mb_master.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>mbfuncdisc_m.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncdisc_m.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>mbfuncinput_m.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncinput_m.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>mb_m.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\modbus\mb_m.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>mbfuncholding_m.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncholding_m.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>portevent_m.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\port\portevent_m.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>portserial_m.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\port\portserial_m.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>mbfuncother.c</FileName>
|
<FileName>mbfuncother.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncother.c</FilePath>
|
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncother.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
|
||||||
<FileName>mbfunccoils_m.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfunccoils_m.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>mbutils.c</FileName>
|
<FileName>mbutils.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\freemodbus\modbus\functions\mbutils.c</FilePath>
|
<FilePath>..\..\libs\freemodbus\modbus\functions\mbutils.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>mbrtu_m.c</FileName>
|
<FileName>mbfuncholding.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\freemodbus\modbus\rtu\mbrtu_m.c</FilePath>
|
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncholding.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>mbfuncinput.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncinput.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>mb.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\modbus\mb.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>portserial.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\port\portserial.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>user_mb_app.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\port\user_mb_app.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>mbfuncdisc.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncdisc.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>portevent.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\port\portevent.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>porttimer.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\port\porttimer.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>mbfuncdiag.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfuncdiag.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>porttcp.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\port\porttcp.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>mbrtu.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\modbus\rtu\mbrtu.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>mbfunccoils.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\modbus\functions\mbfunccoils.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>mbcrc.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\freemodbus\modbus\rtu\mbcrc.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -2658,9 +2597,14 @@
|
|||||||
<GroupName>klibc</GroupName>
|
<GroupName>klibc</GroupName>
|
||||||
<Files>
|
<Files>
|
||||||
<File>
|
<File>
|
||||||
<FileName>rt_vsscanf.c</FileName>
|
<FileName>rt_vsnprintf_tiny.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\rt-thread\src\klibc\rt_vsscanf.c</FilePath>
|
<FilePath>..\..\rt-thread\src\klibc\rt_vsnprintf_tiny.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>kstring.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\rt-thread\src\klibc\kstring.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>kstdio.c</FileName>
|
<FileName>kstdio.c</FileName>
|
||||||
@@ -2668,20 +2612,15 @@
|
|||||||
<FilePath>..\..\rt-thread\src\klibc\kstdio.c</FilePath>
|
<FilePath>..\..\rt-thread\src\klibc\kstdio.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>rt_vsnprintf_tiny.c</FileName>
|
<FileName>rt_vsscanf.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\rt-thread\src\klibc\rt_vsnprintf_tiny.c</FilePath>
|
<FilePath>..\..\rt-thread\src\klibc\rt_vsscanf.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>kerrno.c</FileName>
|
<FileName>kerrno.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\rt-thread\src\klibc\kerrno.c</FilePath>
|
<FilePath>..\..\rt-thread\src\klibc\kerrno.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
|
||||||
<FileName>kstring.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\rt-thread\src\klibc\kstring.c</FilePath>
|
|
||||||
</File>
|
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
@@ -2717,110 +2656,40 @@
|
|||||||
<Group>
|
<Group>
|
||||||
<GroupName>STM32F4-CMSIS</GroupName>
|
<GroupName>STM32F4-CMSIS</GroupName>
|
||||||
<Files>
|
<Files>
|
||||||
<File>
|
|
||||||
<FileName>system_stm32f4xx.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_CMSIS\Source\Templates\system_stm32f4xx.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>startup_stm32f405xx.s</FileName>
|
<FileName>startup_stm32f405xx.s</FileName>
|
||||||
<FileType>2</FileType>
|
<FileType>2</FileType>
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_CMSIS\Source\Templates\arm\startup_stm32f405xx.s</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_CMSIS\Source\Templates\arm\startup_stm32f405xx.s</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>system_stm32f4xx.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_CMSIS\Source\Templates\system_stm32f4xx.c</FilePath>
|
||||||
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
<Group>
|
<Group>
|
||||||
<GroupName>STM32F4-HAL</GroupName>
|
<GroupName>STM32F4-HAL</GroupName>
|
||||||
<Files>
|
<Files>
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_rtc.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rtc.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_rcc.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rcc.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_tim_ex.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_tim_ex.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_rcc_ex.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rcc_ex.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_flash.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_dma.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal_cortex.c</FileName>
|
<FileName>stm32f4xx_hal_cortex.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cortex.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cortex.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_dma_ex.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma_ex.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_gpio.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_gpio.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_tim.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_tim.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_flash_ex.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash_ex.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_usart.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_usart.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_iwdg.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_iwdg.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_lptim.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_lptim.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal_crc.c</FileName>
|
<FileName>stm32f4xx_hal_crc.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_crc.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_crc.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal_cec.c</FileName>
|
<FileName>stm32f4xx_hal_dma.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cec.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal_cryp_ex.c</FileName>
|
<FileName>stm32f4xx_hal_rcc.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp_ex.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rcc.c</FilePath>
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_rng.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rng.c</FilePath>
|
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal_pwr_ex.c</FileName>
|
<FileName>stm32f4xx_hal_pwr_ex.c</FileName>
|
||||||
@@ -2828,29 +2697,14 @@
|
|||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_pwr_ex.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_pwr_ex.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal.c</FileName>
|
<FileName>stm32f4xx_hal_pwr.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_pwr.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal_wwdg.c</FileName>
|
<FileName>stm32f4xx_hal_tim.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_wwdg.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_tim.c</FilePath>
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_rtc_ex.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rtc_ex.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_cryp.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp.c</FilePath>
|
|
||||||
</File>
|
|
||||||
<File>
|
|
||||||
<FileName>stm32f4xx_hal_uart.c</FileName>
|
|
||||||
<FileType>1</FileType>
|
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_uart.c</FilePath>
|
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal_i2c_ex.c</FileName>
|
<FileName>stm32f4xx_hal_i2c_ex.c</FileName>
|
||||||
@@ -2858,24 +2712,99 @@
|
|||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c_ex.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c_ex.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal_flash_ramfunc.c</FileName>
|
<FileName>stm32f4xx_hal_cryp.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash_ramfunc.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_rcc_ex.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rcc_ex.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_cryp_ex.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cryp_ex.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_cec.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_cec.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal_i2c.c</FileName>
|
<FileName>stm32f4xx_hal_i2c.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_i2c.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_flash.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash.c</FilePath>
|
||||||
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal_can.c</FileName>
|
<FileName>stm32f4xx_hal_can.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_can.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_can.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
<File>
|
<File>
|
||||||
<FileName>stm32f4xx_hal_pwr.c</FileName>
|
<FileName>stm32f4xx_hal_iwdg.c</FileName>
|
||||||
<FileType>1</FileType>
|
<FileType>1</FileType>
|
||||||
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_pwr.c</FilePath>
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_iwdg.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_gpio.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_gpio.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_uart.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_uart.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_rng.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_rng.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_tim_ex.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_tim_ex.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_lptim.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_lptim.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_wwdg.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_wwdg.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_usart.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_usart.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_dma_ex.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_dma_ex.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_flash_ramfunc.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash_ramfunc.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal_flash_ex.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal_flash_ex.c</FilePath>
|
||||||
|
</File>
|
||||||
|
<File>
|
||||||
|
<FileName>stm32f4xx_hal.c</FileName>
|
||||||
|
<FileType>1</FileType>
|
||||||
|
<FilePath>..\..\libs\stm32f4\STM32F4_HAL\Src\stm32f4xx_hal.c</FilePath>
|
||||||
</File>
|
</File>
|
||||||
</Files>
|
</Files>
|
||||||
</Group>
|
</Group>
|
||||||
|
|||||||
+14
-21
@@ -158,7 +158,6 @@
|
|||||||
#define RT_CANSND_MSG_TIMEOUT 100
|
#define RT_CANSND_MSG_TIMEOUT 100
|
||||||
#define RT_USING_I2C
|
#define RT_USING_I2C
|
||||||
#define RT_USING_I2C_BITOPS
|
#define RT_USING_I2C_BITOPS
|
||||||
#define RT_USING_RTC
|
|
||||||
#define RT_USING_WDT
|
#define RT_USING_WDT
|
||||||
#define RT_USING_PIN
|
#define RT_USING_PIN
|
||||||
#define RT_USING_HWTIMER
|
#define RT_USING_HWTIMER
|
||||||
@@ -211,28 +210,24 @@
|
|||||||
/* IoT - internet of things */
|
/* IoT - internet of things */
|
||||||
|
|
||||||
#define PKG_USING_FREEMODBUS
|
#define PKG_USING_FREEMODBUS
|
||||||
#define PKG_MODBUS_MASTER
|
#define PKG_MODBUS_SLAVE
|
||||||
|
|
||||||
/* advanced configuration */
|
/* advanced configuration */
|
||||||
|
|
||||||
#define RT_M_DISCRETE_INPUT_START 0
|
#define RT_S_DISCRETE_INPUT_START 0
|
||||||
#define RT_M_DISCRETE_INPUT_NDISCRETES 16
|
#define RT_S_DISCRETE_INPUT_NDISCRETES 16
|
||||||
#define RT_M_COIL_START 0
|
#define RT_S_COIL_START 0
|
||||||
#define RT_M_COIL_NCOILS 64
|
#define RT_S_COIL_NCOILS 64
|
||||||
#define RT_M_REG_INPUT_START 0
|
#define RT_S_REG_INPUT_START 0
|
||||||
#define RT_M_REG_INPUT_NREGS 100
|
#define RT_S_REG_INPUT_NREGS 100
|
||||||
#define RT_M_REG_HOLDING_START 0
|
#define RT_S_REG_HOLDING_START 0
|
||||||
#define RT_M_REG_HOLDING_NREGS 100
|
#define RT_S_REG_HOLDING_NREGS 100
|
||||||
#define RT_M_HD_RESERVE 0
|
#define RT_S_HD_RESERVE 0
|
||||||
#define RT_M_IN_RESERVE 0
|
#define RT_S_IN_RESERVE 0
|
||||||
#define RT_M_CO_RESERVE 0
|
#define RT_S_CO_RESERVE 0
|
||||||
#define RT_M_DI_RESERVE 0
|
#define RT_S_DI_RESERVE 0
|
||||||
/* end of advanced configuration */
|
/* end of advanced configuration */
|
||||||
#define PKG_MODBUS_MASTER_RTU
|
#define PKG_MODBUS_SLAVE_RTU
|
||||||
#define PKG_MODBUS_MASTER_SAMPLE
|
|
||||||
#define MB_SAMPLE_TEST_SLAVE_ADDR 1
|
|
||||||
#define MB_MASTER_USING_PORT_NUM 1
|
|
||||||
#define MB_MASTER_USING_PORT_BAUDRATE 115200
|
|
||||||
#define PKG_USING_FREEMODBUS_LATEST_VERSION
|
#define PKG_USING_FREEMODBUS_LATEST_VERSION
|
||||||
|
|
||||||
/* Wi-Fi */
|
/* Wi-Fi */
|
||||||
@@ -466,8 +461,6 @@
|
|||||||
#define BSP_USING_I2C4
|
#define BSP_USING_I2C4
|
||||||
#define BSP_USING_CAN
|
#define BSP_USING_CAN
|
||||||
#define BSP_USING_CAN1
|
#define BSP_USING_CAN1
|
||||||
#define BSP_USING_ONCHIP_RTC
|
|
||||||
#define BSP_RTC_USING_LSE
|
|
||||||
#define BSP_USING_WDT
|
#define BSP_USING_WDT
|
||||||
#define BSP_USING_ON_CHIP_FLASH
|
#define BSP_USING_ON_CHIP_FLASH
|
||||||
#define BSP_USING_TIM
|
#define BSP_USING_TIM
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#define _MB_ASCII_H
|
#define _MB_ASCII_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_BEGIN_EXTERN_C
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MB_SLAVE_ASCII_ENABLED > 0
|
#if MB_SLAVE_ASCII_ENABLED > 0
|
||||||
@@ -51,6 +51,8 @@ BOOL xMBASCIITimerT1SExpired( void );
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_END_EXTERN_C
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
#include "port.h"
|
#include "port.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_BEGIN_EXTERN_C
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "mbport.h"
|
#include "mbport.h"
|
||||||
@@ -412,6 +412,8 @@ eMBErrorCode eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress,
|
|||||||
USHORT usNDiscrete );
|
USHORT usNDiscrete );
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_END_EXTERN_C
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#define _MB_M_H
|
#define _MB_M_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_BEGIN_EXTERN_C
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*! \defgroup modbus Modbus
|
/*! \defgroup modbus Modbus
|
||||||
@@ -409,6 +409,8 @@ eMBMasterReqErrCode eMBMasterWaitRequestFinish( void );
|
|||||||
/* ----------------------- Callback -----------------------------------------*/
|
/* ----------------------- Callback -----------------------------------------*/
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_END_EXTERN_C
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#define _MB_CONFIG_H
|
#define _MB_CONFIG_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_BEGIN_EXTERN_C
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
/* ----------------------- Defines ------------------------------------------*/
|
/* ----------------------- Defines ------------------------------------------*/
|
||||||
/*! \defgroup modbus_cfg Modbus Configuration
|
/*! \defgroup modbus_cfg Modbus Configuration
|
||||||
@@ -124,7 +124,7 @@ PR_BEGIN_EXTERN_C
|
|||||||
#define MB_FUNC_READWRITE_HOLDING_ENABLED ( 1 )
|
#define MB_FUNC_READWRITE_HOLDING_ENABLED ( 1 )
|
||||||
/*! @} */
|
/*! @} */
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_END_EXTERN_C
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MB_MASTER_RTU_ENABLED > 0 || MB_MASTER_ASCII_ENABLED > 0
|
#if MB_MASTER_RTU_ENABLED > 0 || MB_MASTER_ASCII_ENABLED > 0
|
||||||
@@ -141,3 +141,5 @@ PR_BEGIN_EXTERN_C
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#define _MB_FRAME_H
|
#define _MB_FRAME_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_BEGIN_EXTERN_C
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -82,6 +82,8 @@ typedef eMBErrorCode( *peMBFrameSend ) ( UCHAR slaveAddress,
|
|||||||
typedef void( *pvMBFrameClose ) ( void );
|
typedef void( *pvMBFrameClose ) ( void );
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_END_EXTERN_C
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#define _MB_FUNC_H
|
#define _MB_FUNC_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_BEGIN_EXTERN_C
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
#if MB_FUNC_OTHER_REP_SLAVEID_BUF > 0
|
#if MB_FUNC_OTHER_REP_SLAVEID_BUF > 0
|
||||||
eMBException eMBFuncReportSlaveID( UCHAR * pucFrame, USHORT * usLen );
|
eMBException eMBFuncReportSlaveID( UCHAR * pucFrame, USHORT * usLen );
|
||||||
@@ -75,6 +75,8 @@ eMBException eMBFuncReadWriteMultipleHoldingRegister( UCHAR * pucFrame, USHOR
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_END_EXTERN_C
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
#define _MB_PORT_H
|
#define _MB_PORT_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_BEGIN_EXTERN_C
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ----------------------- Defines ------------------------------------------*/
|
/* ----------------------- Defines ------------------------------------------*/
|
||||||
@@ -200,6 +200,8 @@ BOOL xMBTCPPortGetRequest( UCHAR **ppucMBTCPFrame, USHORT * usTCPLeng
|
|||||||
BOOL xMBTCPPortSendResponse( const UCHAR *pucMBTCPFrame, USHORT usTCPLength );
|
BOOL xMBTCPPortSendResponse( const UCHAR *pucMBTCPFrame, USHORT usTCPLength );
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_END_EXTERN_C
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#define _MB_PROTO_H
|
#define _MB_PROTO_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_BEGIN_EXTERN_C
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
/* ----------------------- Defines ------------------------------------------*/
|
/* ----------------------- Defines ------------------------------------------*/
|
||||||
#define MB_ADDRESS_BROADCAST ( 0 ) /*! Modbus broadcast address. */
|
#define MB_ADDRESS_BROADCAST ( 0 ) /*! Modbus broadcast address. */
|
||||||
@@ -78,6 +78,8 @@ typedef struct
|
|||||||
} xMBFunctionHandler;
|
} xMBFunctionHandler;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_END_EXTERN_C
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#define _MB_UTILS_H
|
#define _MB_UTILS_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_BEGIN_EXTERN_C
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
/*! \defgroup modbus_utils Utilities
|
/*! \defgroup modbus_utils Utilities
|
||||||
*
|
*
|
||||||
@@ -103,6 +103,8 @@ UCHAR xMBUtilGetBits( UCHAR * ucByteBuf, USHORT usBitOffset,
|
|||||||
/*! @} */
|
/*! @} */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_END_EXTERN_C
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@
|
|||||||
/* ----------------------- Static variables ---------------------------------*/
|
/* ----------------------- Static variables ---------------------------------*/
|
||||||
|
|
||||||
static UCHAR ucMBAddress;
|
static UCHAR ucMBAddress;
|
||||||
static eMBMode eMBCurrentMode;
|
//static eMBMode eMBCurrentMode;
|
||||||
|
|
||||||
static enum
|
static enum
|
||||||
{
|
{
|
||||||
@@ -188,7 +188,7 @@ eMBInit( eMBMode eMode, UCHAR ucSlaveAddress, UCHAR ucPort, ULONG ulBaudRate, eM
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
eMBCurrentMode = eMode;
|
// eMBCurrentMode = eMode;
|
||||||
eMBState = STATE_DISABLED;
|
eMBState = STATE_DISABLED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -219,7 +219,7 @@ eMBTCPInit( USHORT ucTCPPort )
|
|||||||
peMBFrameSendCur = eMBTCPSend;
|
peMBFrameSendCur = eMBTCPSend;
|
||||||
pvMBFrameCloseCur = MB_PORT_HAS_CLOSE ? vMBTCPPortClose : NULL;
|
pvMBFrameCloseCur = MB_PORT_HAS_CLOSE ? vMBTCPPortClose : NULL;
|
||||||
ucMBAddress = MB_TCP_PSEUDO_ADDRESS;
|
ucMBAddress = MB_TCP_PSEUDO_ADDRESS;
|
||||||
eMBCurrentMode = MB_TCP;
|
// eMBCurrentMode = MB_TCP;
|
||||||
eMBState = STATE_DISABLED;
|
eMBState = STATE_DISABLED;
|
||||||
}
|
}
|
||||||
return eStatus;
|
return eStatus;
|
||||||
|
|||||||
@@ -34,7 +34,7 @@
|
|||||||
#define _MB_RTU_H
|
#define _MB_RTU_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_BEGIN_EXTERN_C
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
eMBErrorCode eMBRTUInit( UCHAR slaveAddress, UCHAR ucPort, ULONG ulBaudRate,
|
eMBErrorCode eMBRTUInit( UCHAR slaveAddress, UCHAR ucPort, ULONG ulBaudRate,
|
||||||
eMBParity eParity );
|
eMBParity eParity );
|
||||||
@@ -59,6 +59,8 @@ BOOL xMBMasterRTUTimerExpired( void );
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_END_EXTERN_C
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#define _MB_TCP_H
|
#define _MB_TCP_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_BEGIN_EXTERN_C
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ----------------------- Defines ------------------------------------------*/
|
/* ----------------------- Defines ------------------------------------------*/
|
||||||
@@ -48,6 +48,8 @@ eMBErrorCode eMBTCPSend( UCHAR _unused, const UCHAR * pucFrame,
|
|||||||
USHORT usLength );
|
USHORT usLength );
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
PR_END_EXTERN_C
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ BOOL xMBPortSerialInit(UCHAR ucPORT, ULONG ulBaudRate, UCHAR ucDataBits,
|
|||||||
/* software initialize */
|
/* software initialize */
|
||||||
rt_event_init(&event_serial, "slave event", RT_IPC_FLAG_PRIO);
|
rt_event_init(&event_serial, "slave event", RT_IPC_FLAG_PRIO);
|
||||||
rt_thread_init(&thread_serial_soft_trans_irq,
|
rt_thread_init(&thread_serial_soft_trans_irq,
|
||||||
"slave trans",
|
"thr.trans",
|
||||||
serial_soft_trans_irq,
|
serial_soft_trans_irq,
|
||||||
RT_NULL,
|
RT_NULL,
|
||||||
serial_soft_trans_irq_stack,
|
serial_soft_trans_irq_stack,
|
||||||
|
|||||||
@@ -111,4 +111,7 @@ __exit:
|
|||||||
|
|
||||||
return -RT_ERROR;
|
return -RT_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
MSH_CMD_EXPORT(mb_master_sample, run a modbus master sample);
|
MSH_CMD_EXPORT(mb_master_sample, run a modbus master sample);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user