Merge 20cb173f8ea366486e7e1c27ac97fcefe350de3e into aa52bcee8cf3998723f12557cbbc616cfccc9f3b

This commit is contained in:
Arne Schwabe 2016-11-06 14:56:29 +00:00 committed by GitHub
commit 24abe5790c
2 changed files with 10 additions and 1 deletions

View File

@ -1017,7 +1017,14 @@ static uint32_t random_id(uint16_t adress, uint8_t create_new)
return id;
}
// Generate a random ID
#if defined STM32_BOARD
#define STM32_UUID ((uint32_t *)0x1FFFF7E8)
if (!create_new)
id = STM32_UUID[0] ^ STM32_UUID[1] ^ STM32_UUID[2];
else
#else
id = random(0xfefefefe) + ((uint32_t)random(0xfefefefe) << 16);
#endif
for(uint8_t i=0;i<4;i++)
{
eeprom_write_byte((EE_ADDR)adress+i,id);

View File

@ -22,7 +22,9 @@
/********************/
//Uncomment one of the line below if you have a different module not based on the original Multi Atmega328p design which includes the 4-in-1.
//If you don't know then leave them commented.
//#define STM32_BOARD
#ifdef __arm__
#define STM32_BOARD
#endif
/*******************/