Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check sentinel before copying LUID from factory block #45

Open
wants to merge 1 commit into
base: hamilton-board
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions boards/hamilton/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ extern "C" {
#define STIMER_HZ 1000000UL

#if (XTIMER_HZ < 1000000ul) && (STIMER_HZ >= 1000000ul)
#define XTIMER_BACKOFF 30 /* ticks: Threshold to determine spin or not
#define XTIMER_BACKOFF 30 /* ticks: Threshold to determine spin or not
It takes 150~200us to get the current time */
#define XTIMER_OVERHEAD 6 /* ticks: How much earlier does a timer expires? */
#define XTIMER_ISR_BACKOFF 20
#define XTIMER_ISR_BACKOFF 20
#define XTIMER_PERIODIC_RELATIVE 100
#endif

Expand Down
10 changes: 6 additions & 4 deletions sys/luid/luid.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,12 @@ void luid_base(void *buf, size_t len)
memset(buf, LUID_BACKUP_SEED, len);

#ifdef HAS_FACTORY_BLOCK
memcpy(buf, fb_eui64, 8);
#else
#if CPUID_LEN
if (HAS_FACTORY_BLOCK) {
memcpy(buf, fb_eui64, 8);
return;
}
#endif
#ifdef CPUID_LEN
uint8_t *out = (uint8_t *)buf;
uint8_t cid[CPUID_LEN];

Expand All @@ -63,5 +66,4 @@ void luid_base(void *buf, size_t len)
out[i % len] ^= cid[i];
}
#endif
#endif
}