forked from nuttx/nuttx-update
sensors/fakesensor_uorb: Using different nbuffer for each topic of GNSS
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
074c494f8f
commit
5fbf377214
1 changed files with 10 additions and 1 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <nuttx/fs/fs.h>
|
||||
#include <nuttx/kmalloc.h>
|
||||
|
@ -401,6 +402,14 @@ int fakesensor_init(int type, FAR const char *file_name,
|
|||
FAR struct fakesensor_s *sensor;
|
||||
FAR char *argv[2];
|
||||
char arg1[32];
|
||||
uint32_t nbuffer[] = {
|
||||
[SENSOR_GNSS_IDX_GNSS] = batch_number,
|
||||
[SENSOR_GNSS_IDX_GNSS_SATELLITE] = batch_number,
|
||||
[SENSOR_GNSS_IDX_GNSS_MEASUREMENT] = batch_number,
|
||||
[SENSOR_GNSS_IDX_GNSS_CLOCK] = batch_number,
|
||||
[SENSOR_GNSS_IDX_GNSS_GEOFENCE] = batch_number,
|
||||
};
|
||||
|
||||
int ret;
|
||||
|
||||
/* Alloc memory for sensor */
|
||||
|
@ -436,7 +445,7 @@ int fakesensor_init(int type, FAR const char *file_name,
|
|||
if (type == SENSOR_TYPE_GNSS || type == SENSOR_TYPE_GNSS_SATELLITE)
|
||||
{
|
||||
sensor->gnss.ops = &g_fakegnss_ops;
|
||||
gnss_register(&sensor->gnss, devno, batch_number);
|
||||
gnss_register(&sensor->gnss, devno, nbuffer, nitems(nbuffer));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue