nrf91: Support using different nbuffer for each topic

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
wangjianyu3 2024-11-30 08:20:22 +08:00 committed by Xiang Xiao
parent d2dd747e09
commit 074c494f8f

View file

@ -28,6 +28,7 @@
#include <debug.h>
#include <string.h>
#include <sys/param.h>
#include <time.h>
#include <nuttx/sensors/gnss.h>
@ -689,6 +690,13 @@ static int nrf91_gnss_thread(int argc, char** argv)
int nrf91_gnss_register(int devno, uint32_t batch_number)
{
int ret = OK;
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,
};
if (!nrf_modem_is_initialized())
{
@ -728,5 +736,5 @@ int nrf91_gnss_register(int devno, uint32_t batch_number)
g_nrf91_gnss.lower.ops = &g_nrf91_gnss_ops;
return gnss_register(&g_nrf91_gnss.lower, devno, batch_number);
return gnss_register(&g_nrf91_gnss.lower, devno, nbuffer, nitems(nbuffer));
}