Skip to content

Commit 1702ec0

Browse files
LPC11: Fixed unique ID reading
1 parent 0a07f5c commit 1702ec0

File tree

1 file changed

+2
-2
lines changed
  • libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys

1 file changed

+2
-2
lines changed

libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/board.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ __attribute__((optimize(0))) // Optimization must be disabled lest it hardfa
154154
#endif
155155
void readUniqueID(std::uint8_t out_uid[UniqueIDSize])
156156
{
157-
unsigned aligned_array[4] = {}; // out_uid may be unaligned, so we need to use temp array
157+
unsigned aligned_array[5] = {}; // out_uid may be unaligned, so we need to use temp array
158158
unsigned iap_command = 58;
159159
reinterpret_cast<void(*)(void*, void*)>(0x1FFF1FF1)(&iap_command, aligned_array);
160-
std::memcpy(out_uid, aligned_array, 16);
160+
std::memcpy(out_uid, &aligned_array[1], 16);
161161
}
162162

163163
void setStatusLed(bool state)

0 commit comments

Comments
 (0)