sensors/gps: using config to adjust gps recv size

Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
dongjiuzhu1 2024-06-19 15:33:19 +08:00 committed by Xiang Xiao
parent 84f326a66b
commit c0674b34d6
2 changed files with 11 additions and 2 deletions

View file

@ -31,6 +31,15 @@ config SENSORS_GPS
---help---
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
bool "Wtgahrs2 Sensor Support"
default n

View file

@ -44,7 +44,6 @@
#define GPS_SATELLITE_IDX 1
#define GPS_MAX_IDX 2
#define GPS_RECV_BUFFERSIZE 2048
#define GPS_PARSE_BUFFERSIZE 256
#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;
}
ret = circbuf_init(&upper->buffer, NULL, GPS_RECV_BUFFERSIZE);
ret = circbuf_init(&upper->buffer, NULL,
CONFIG_SENSORS_GPS_RECV_BUFFERSIZE);
if (ret < 0)
{
goto circ_err;