nrf91: Support using different nbuffer for each topic
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
d2dd747e09
commit
074c494f8f
1 changed files with 9 additions and 1 deletions
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue