modify sensor framework extuart path configure
This commit is contained in:
@@ -13,13 +13,24 @@ config SENSOR_D124
|
||||
default "voice_1"
|
||||
|
||||
if ADD_XIUOS_FETURES
|
||||
config SENSOR_D124_DRIVER_EXTUART
|
||||
bool "Using extra uart to support D124"
|
||||
default y
|
||||
|
||||
config SENSOR_DEVICE_D124_DEV
|
||||
string "D124 device name"
|
||||
default "/dev/extuart_dev4"
|
||||
default "/dev/uart2_dev2"
|
||||
depends on !SENSOR_D124_DRIVER_EXTUART
|
||||
|
||||
config SENSOR_DEVICE_D124_DEV_EXT_PORT
|
||||
int "if D124 device using extuart, choose port"
|
||||
default "4"
|
||||
if SENSOR_D124_DRIVER_EXTUART
|
||||
config SENSOR_DEVICE_D124_DEV
|
||||
string "D124 device extra uart path"
|
||||
default "/dev/extuart_dev4"
|
||||
|
||||
config SENSOR_DEVICE_D124_DEV_EXT_PORT
|
||||
int "if D124 device using extuart, choose port"
|
||||
default "4"
|
||||
endif
|
||||
endif
|
||||
|
||||
if ADD_NUTTX_FETURES
|
||||
|
||||
@@ -52,7 +52,7 @@ static void ReadTask(struct SensorDevice *sdev)
|
||||
*/
|
||||
static int SensorDeviceOpen(struct SensorDevice *sdev)
|
||||
{
|
||||
int result = 1;
|
||||
int result = 0;
|
||||
|
||||
buff_lock = UserMutexCreate();
|
||||
|
||||
@@ -66,8 +66,10 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
|
||||
cfg.serial_parity_mode = PARITY_NONE;
|
||||
cfg.serial_bit_order = 0;
|
||||
cfg.serial_invert_mode = 0;
|
||||
#ifdef SENSOR_D124_DRIVER_EXTUART
|
||||
cfg.ext_uart_no = SENSOR_DEVICE_D124_DEV_EXT_PORT;
|
||||
cfg.port_configure = PORT_CFG_INIT;
|
||||
#endif
|
||||
|
||||
struct PrivIoctlCfg ioctl_cfg;
|
||||
ioctl_cfg.ioctl_driver_type = SERIAL_TYPE;
|
||||
@@ -98,7 +100,7 @@ static int SensorDeviceClose(struct SensorDevice *sdev)
|
||||
{
|
||||
UserTaskDelete(active_task_id);
|
||||
UserMutexDelete(buff_lock);
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user