Skip to content

Commit

Permalink
drivers/sensors/gnss: Add suffix to macro of geofence index
Browse files Browse the repository at this point in the history
Signed-off-by: wangjianyu3 <[email protected]>
  • Loading branch information
JianyuWang0623 committed Nov 29, 2024
1 parent a2fcd98 commit 6a22cb9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/sensors/gnss_uorb.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
#define GNSS_SATELLITE_IDX 1
#define GNSS_MEASUREMENT_IDX 2
#define GNSS_CLOCK_IDX 3
#define GNSS_GEOFENCE 4
#define GNSS_GEOFENCE_IDX 4
#define GNSS_MAX_IDX 5

#define GNSS_PARSE_BUFFERSIZE 256
Expand Down Expand Up @@ -680,7 +680,7 @@ static void gnss_push_event(FAR void *priv, FAR const void *data,
}
else if (type == SENSOR_TYPE_GNSS_GEOFENCE)
{
lower = &upper->dev[GNSS_GEOFENCE].lower;
lower = &upper->dev[GNSS_GEOFENCE_IDX].lower;
lower->push_event(lower->priv, data, bytes);
}
}
Expand Down Expand Up @@ -797,7 +797,7 @@ int gnss_register(FAR struct gnss_lowerhalf_s *lower, int devno,

/* GNSS Geofence */

dev = &upper->dev[GNSS_GEOFENCE];
dev = &upper->dev[GNSS_GEOFENCE_IDX];
dev->lower.ops = &g_gnss_sensor_ops;
dev->lower.type = SENSOR_TYPE_GNSS_GEOFENCE;
dev->lower.nbuffer = nbuffer;
Expand Down Expand Up @@ -828,7 +828,7 @@ int gnss_register(FAR struct gnss_lowerhalf_s *lower, int devno,
driver_err:
circbuf_uninit(&upper->buffer);
circ_err:
sensor_unregister(&upper->dev[GNSS_GEOFENCE].lower, devno);
sensor_unregister(&upper->dev[GNSS_GEOFENCE_IDX].lower, devno);
gnss_geofence_err:
sensor_unregister(&upper->dev[GNSS_CLOCK_IDX].lower, devno);
gnss_clock_err:
Expand Down Expand Up @@ -876,7 +876,7 @@ void gnss_unregister(FAR struct gnss_lowerhalf_s *lower, int devno)
sensor_unregister(&upper->dev[GNSS_SATELLITE_IDX].lower, devno);
sensor_unregister(&upper->dev[GNSS_MEASUREMENT_IDX].lower, devno);
sensor_unregister(&upper->dev[GNSS_CLOCK_IDX].lower, devno);
sensor_unregister(&upper->dev[GNSS_GEOFENCE].lower, devno);
sensor_unregister(&upper->dev[GNSS_GEOFENCE_IDX].lower, devno);
snprintf(path, PATH_MAX, GNSS_PATH_FMT, devno);
unregister_driver(path);
nxsem_destroy(&upper->buffersem);
Expand Down

0 comments on commit 6a22cb9

Please sign in to comment.