mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
board_uniqueid should return a negated errno value on failure
This commit is contained in:
@@ -36,23 +36,34 @@
|
||||
/************************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include "stm32_uid.h"
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
#ifndef OK
|
||||
# define OK 0
|
||||
#endif
|
||||
#define ERR_NULL 1
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(CONFIG_BOARDCTL_UNIQUEID)
|
||||
int board_uniqueid(uint8_t *uniqueid)
|
||||
{
|
||||
if(uniqueid == 0)
|
||||
return -ERR_NULL;
|
||||
if (uniqueid == 0)
|
||||
{
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
stm32_get_uniqueid(uniqueid);
|
||||
return OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user