mirror of
https://github.com/apache/nuttx.git
synced 2025-01-12 19:48:33 +08:00
drivers/sensors/gnss: Macro UINT8_MAX
for maximum value of uint8_t crefs
libs/libc/gnssutils/minmea/minmea.h:17:#include <stdint.h> Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
428c2bfb91
commit
8282ed9ab0
1 changed files with 3 additions and 2 deletions
|
@ -168,7 +168,8 @@ static int gnss_activate(FAR struct sensor_lowerhalf_s *lower,
|
|||
int ret = OK;
|
||||
|
||||
nxmutex_lock(&upper->lock);
|
||||
if ((upper->crefs == 255 && enable) || (upper->crefs == 0 && !enable))
|
||||
if ((upper->crefs == UINT8_MAX && enable) ||
|
||||
(upper->crefs == 0 && !enable))
|
||||
{
|
||||
ret = -EINVAL;
|
||||
}
|
||||
|
@ -233,7 +234,7 @@ static int gnss_open(FAR struct file *filep)
|
|||
}
|
||||
|
||||
nxmutex_lock(&upper->lock);
|
||||
if (upper->crefs >= 255)
|
||||
if (upper->crefs >= UINT8_MAX)
|
||||
{
|
||||
ret = -EMFILE;
|
||||
kmm_free(user);
|
||||
|
|
Loading…
Reference in a new issue