mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
sensors/gps: using config to adjust gps recv size
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
@@ -31,6 +31,15 @@ config SENSORS_GPS
|
|||||||
---help---
|
---help---
|
||||||
Allow application to use gps by /dev/uorb/gps or /dev/ttyGPS
|
Allow application to use gps by /dev/uorb/gps or /dev/ttyGPS
|
||||||
|
|
||||||
|
config SENSORS_GPS_RECV_BUFFERSIZE
|
||||||
|
int "The size of recvive buffer for nmea message in gps driver"
|
||||||
|
default 2048
|
||||||
|
depends on SENSORS_GPS
|
||||||
|
---help---
|
||||||
|
The size of recvive buffer for nmea message in gps driver, if
|
||||||
|
the nmea message happen overwrite when driver push, you can increase
|
||||||
|
the size.
|
||||||
|
|
||||||
config SENSORS_WTGAHRS2
|
config SENSORS_WTGAHRS2
|
||||||
bool "Wtgahrs2 Sensor Support"
|
bool "Wtgahrs2 Sensor Support"
|
||||||
default n
|
default n
|
||||||
|
|||||||
@@ -44,7 +44,6 @@
|
|||||||
#define GPS_SATELLITE_IDX 1
|
#define GPS_SATELLITE_IDX 1
|
||||||
#define GPS_MAX_IDX 2
|
#define GPS_MAX_IDX 2
|
||||||
|
|
||||||
#define GPS_RECV_BUFFERSIZE 2048
|
|
||||||
#define GPS_PARSE_BUFFERSIZE 256
|
#define GPS_PARSE_BUFFERSIZE 256
|
||||||
|
|
||||||
#define GPS_KNOT_TO_KMH 1.852f
|
#define GPS_KNOT_TO_KMH 1.852f
|
||||||
@@ -685,7 +684,8 @@ int gps_register(FAR struct gps_lowerhalf_s *lower, int devno,
|
|||||||
goto satellite_err;
|
goto satellite_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = circbuf_init(&upper->buffer, NULL, GPS_RECV_BUFFERSIZE);
|
ret = circbuf_init(&upper->buffer, NULL,
|
||||||
|
CONFIG_SENSORS_GPS_RECV_BUFFERSIZE);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
goto circ_err;
|
goto circ_err;
|
||||||
|
|||||||
Reference in New Issue
Block a user