mirror of
https://github.com/g4klx/MMDVM.git
synced 2026-05-07 13:37:48 +00:00
Add UDID support.
This commit is contained in:
parent
81518bf74c
commit
99d2a0d822
6 changed files with 74 additions and 4 deletions
20
IODue.cpp
20
IODue.cpp
|
|
@ -291,4 +291,24 @@ void CIO::delayInt(unsigned int dly)
|
|||
delay(dly);
|
||||
}
|
||||
|
||||
uint8_t CIO::getCPU() const
|
||||
{
|
||||
return 0U;
|
||||
}
|
||||
|
||||
// Code taken from https://github.com/emagii/at91sam3s/blob/master/examples/eefc_uniqueid/main.c
|
||||
void CIO::getUDID(uint8_t* buffer)
|
||||
{
|
||||
EFC->EEFC_FCR = (0x5A << 24) | EFC_FCMD_STUI;
|
||||
|
||||
::memcpy(buffer, (void *)IFLASH_ADDR, 16U);
|
||||
|
||||
EFC->EEFC_FCR = (0x5A << 24) | EFC_FCMD_SPUI;
|
||||
|
||||
do {
|
||||
status = EFC->EEFC_FSR ;
|
||||
} while ((status & EEFC_FSR_FRDY) != EEFC_FSR_FRDY);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue