mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
POSIX: ifdef getreg32() calls in mcu_unique_id()
mcu_unique_id() reads registers at an invalid address in non-nuttx builds. Added ifdef to return a dummy value for non-nuttx builds. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
committed by
Lorenz Meier
parent
7254f04f68
commit
c6b36073fe
@@ -62,9 +62,15 @@
|
||||
/** Copy the 96bit MCU Unique ID into the provided pointer */
|
||||
void mcu_unique_id(uint32_t *uid_96_bit)
|
||||
{
|
||||
#ifdef __PX4_NUTTX
|
||||
uid_96_bit[0] = getreg32(UNIQUE_ID);
|
||||
uid_96_bit[1] = getreg32(UNIQUE_ID+4);
|
||||
uid_96_bit[2] = getreg32(UNIQUE_ID+8);
|
||||
#else
|
||||
uid_96_bit[0] = 0;
|
||||
uid_96_bit[1] = 1;
|
||||
uid_96_bit[2] = 2;
|
||||
#endif
|
||||
}
|
||||
|
||||
int mcu_version(char* rev, char** revstr)
|
||||
|
||||
Reference in New Issue
Block a user