mirror of
https://github.com/thelsing/knx.git
synced 2026-02-23 13:50:35 +01:00
* generate unique serial number (#90) * see https://github.com/ricaun/ArduinoUniqueID * calculated from ESP.getEfuseMac() on ESP32 * ESP.getChipId() on ESP8266 * SERIAL_NUMBER_WORD_0-3 on SAMD * HAL_GetUIDw0-2() on STM32 * defaults to 0x01020304 on other platforms * fix variable name for ESP platform * another fix variable name for ESP platform (need more coffee...)
This commit is contained in:
@@ -20,6 +20,15 @@ Stm32Platform::~Stm32Platform()
|
||||
delete [] _eepromPtr;
|
||||
}
|
||||
|
||||
uint32_t Stm32Platform::uniqueSerialNumber()
|
||||
{
|
||||
uint32_t uniqueId = HAL_GetUIDw0() ^ HAL_GetUIDw1() ^ HAL_GetUIDw2();
|
||||
|
||||
printf("uniqueSerialNumber: %0X", uniqueId);
|
||||
|
||||
return uniqueId;
|
||||
}
|
||||
|
||||
void Stm32Platform::restart()
|
||||
{
|
||||
NVIC_SystemReset();
|
||||
|
||||
Reference in New Issue
Block a user