add is_ext_uart in serial_cfg for framework for nuttx

This commit is contained in:
wgz-code
2022-09-05 14:08:12 +08:00
parent 5f42111c38
commit 5759661e8c
29 changed files with 397 additions and 359 deletions
@@ -66,6 +66,10 @@ if ADD_NUTTX_FETURES
config ADAPTER_E18_DRIVER
string "E18 device extra uart driver path"
default "/dev/extuart_dev1"
config ADAPTER_E18_DRIVER_EXT_PORT
int "if E18 device using extuart, choose port"
default "1"
endif
endif
@@ -69,18 +69,6 @@ static int E18HardwareModeGet()
#endif
}
#ifdef ADD_NUTTX_FETURES
static int E18UartOpen(struct Adapter *adapter)
{
adapter->fd = PrivOpen(ADAPTER_E18_DRIVER, O_RDWR);
if (adapter->fd < 0) {
printf("E18UartSetUp get serial %s fd error\n", ADAPTER_E18_DRIVER);
return -1;
}
return adapter->fd;
}
#else
static int E18UartOpen(struct Adapter *adapter)
{
if (NULL == adapter) {
@@ -105,12 +93,13 @@ static int E18UartOpen(struct Adapter *adapter)
cfg.serial_bit_order = BIT_ORDER_LSB;
cfg.serial_invert_mode = NRZ_NORMAL;
cfg.serial_buffer_size = SERIAL_RB_BUFSZ;
cfg.is_ext_uart = 0;
/*aiit board use ch438, so it needs more serial configuration*/
#ifdef ADAPTER_E18_DRIVER_EXTUART
cfg.is_ext_uart = 1;
cfg.ext_uart_no = ADAPTER_E18_DRIVER_EXT_PORT;
cfg.port_configure = PORT_CFG_INIT;
cfg.is_ext_uart = 1;
cfg.ext_uart_no = ADAPTER_E18_DRIVER_EXT_PORT;
cfg.port_configure = PORT_CFG_INIT;
#endif
struct PrivIoctlCfg ioctl_cfg;
@@ -123,7 +112,6 @@ static int E18UartOpen(struct Adapter *adapter)
printf("Zigbee uart config ready\n");
return 0;
}
#endif
static int E18NetworkModeConfig(struct Adapter *adapter)
{