Skip to content

Commit

Permalink
Use proper Arduino MAC Adress
Browse files Browse the repository at this point in the history
  • Loading branch information
facchinm committed Sep 6, 2018
1 parent 9e2094f commit f043f68
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Projects/Multi/Applications/LoRa/AT_Slave/src/mlm32l0xx_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,19 +350,22 @@ uint32_t HW_GetRandomSeed(void)

void HW_GetUniqueId(uint8_t *id)
{
// First 3 bytes are Arduino OUI A8-61-0A
// Other 5 bytes are derived by STM32 internal ID registers

uint32_t id1 = *((uint32_t *)ID1);
uint32_t id2 = *((uint32_t *)ID2);
uint32_t id3 = *((uint32_t *)ID3);
uint32_t id13 = id1 + id3;

id[7] = id13 >> 24;
id[6] = id13 >> 16;
id[5] = id13 >> 8;
id[4] = id13;
id[3] = id2 >> 24;
id[2] = id2 >> 16;
id[1] = id2 >> 8;
id[0] = id2;
id[5] = id3 & 0xFF;
id[4] = id2 & 0xFF;
id[3] = id1 & 0xFF;
id[2] = 0x0A;
id[1] = 0x61;
id[0] = 0xA8;
}

uint8_t HW_GetBatteryLevel(void)
Expand Down

0 comments on commit f043f68

Please sign in to comment.