Cosmetic changes from review of last PR
This commit is contained in:
parent
f2ebb6d2a0
commit
5b46ce4889
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/kinetis/kinetis_uid.c
|
||||
*
|
||||
* Copyright (C) 2016 Neil Hancock. All rights reserved.
|
||||
@ -30,11 +30,11 @@
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
@ -44,25 +44,27 @@
|
||||
|
||||
#ifdef CONFIG_BOARDCTL_UNIQUEID
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: kinetis_get_uniqueid
|
||||
****************************************************************************/
|
||||
|
||||
void kinetis_get_uniqueid(uint8_t *uniqueid)
|
||||
{
|
||||
int i;
|
||||
uint32_t *unique_u32;
|
||||
int i;
|
||||
|
||||
unique_u32 = (uint32_t *)uniqueid;
|
||||
|
||||
/*
|
||||
* Copy into buffer LS first, which in the Kinetis is the highest memory
|
||||
*/
|
||||
/* Copy into buffer LS first, which in the Kinetis is the highest memory */
|
||||
|
||||
for (i = 0; i < (KINETIS_UID_SIZE/sizeof(uint32_t)); i++)
|
||||
for (i = 0; i < (KINETIS_UID_SIZE / sizeof(uint32_t)); i++)
|
||||
{
|
||||
unique_u32[i] = *((uint32_t*)(KINETIS_SIM_UIDL)-i);
|
||||
unique_u32[i] = *((uint32_t*)(KINETIS_SIM_UIDL) - i);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BOARDCTL_UNIQUEID */
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/kinetis/kinetis_uid.h
|
||||
*
|
||||
* Copyright (C) 2016 Neil Hancock. All rights reserved.
|
||||
@ -30,20 +30,27 @@
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_KINETIS_UID_H
|
||||
#define __ARCH_ARM_SRC_KINETIS_UID_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/************************************************************************************
|
||||
* Public Function Prototypes
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define KINETIS_UID_SIZE 16
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
void kinetis_get_uniqueid(uint8_t *uniqueid);
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_KINETIS_UID_H */
|
||||
|
@ -76,4 +76,5 @@ endif
|
||||
ifeq ($(CONFIG_BOARDCTL_UNIQUEID),y)
|
||||
CSRCS += k64_uid.c
|
||||
endif
|
||||
|
||||
include $(TOPDIR)/configs/Board.mk
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* configs/freedom-k64/src/kinetis_uid.c
|
||||
*
|
||||
* Copyright (C) 2016 Neil Hancock. All rights reserved.
|
||||
@ -30,11 +30,11 @@
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
@ -45,19 +45,23 @@
|
||||
|
||||
#include <nuttx/board.h>
|
||||
|
||||
/************************************************************************************
|
||||
#if defined(CONFIG_BOARDCTL_UNIQUEID)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef OK
|
||||
# define OK 0
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_BOARDCTL_UNIQUEID)
|
||||
/****************************************************************************
|
||||
* Name: board_uniqueid
|
||||
****************************************************************************/
|
||||
|
||||
int board_uniqueid(FAR uint8_t *uniqueid)
|
||||
{
|
||||
@ -70,4 +74,4 @@ int board_uniqueid(FAR uint8_t *uniqueid)
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* CONFIG_BOARDCTL_UNIQUEID */
|
||||
|
@ -107,4 +107,5 @@ void board_userled_all(uint8_t ledset)
|
||||
kinetis_gpiowrite(GPIO_LED_G, (ledset & BOARD_LED_G_BIT) == 0);
|
||||
kinetis_gpiowrite(GPIO_LED_B, (ledset & BOARD_LED_B_BIT) == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CONFIG_ARCH_LEDS */
|
||||
|
Loading…
Reference in New Issue
Block a user