Skip to content

Commit

Permalink
Update USERSIG.h
Browse files Browse the repository at this point in the history
left in debug code
  • Loading branch information
SpenceKonde authored Aug 15, 2024
1 parent b400368 commit 4b0b506
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions megaavr/libraries/USERSIG/src/USERSIG.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,8 @@ int8_t __USigload() {
}
for (byte i = 0; i < USER_SIGNATURES_SIZE; i++) {
__USigBuffer[i] = *((volatile uint8_t *) USER_SIGNATURES_START + i);

GPIOR1 |= 8;
}

__USigLoaded = 1;
GPIOR1 |= 16;
return 0;
}
uint8_t __USigread(uint8_t idx) {
Expand All @@ -222,25 +218,19 @@ uint8_t __USigreadraw(uint8_t idx) {

int8_t __USigwrite(uint8_t idx, uint8_t data) {
if (NVMCTRL.STATUS & 0x70) {
GPIOR1 |= 32;
NVMCTRL.STATUS = 0;
}
if (CPUINT.STATUS != 0) {
return -16;
}
idx &= (USER_SIGNATURES_SIZE - 1);
if (!__USigLoaded) {
GPIOR1 |= 1;
if ((__USigreadraw(idx) & data) != data) {
GPIOR1 |= 2;
__USigload();
} else {
GPIOR1 |= 4;
return __USigwriteraw(idx, data);
}
}
GPIOR2 = idx;
GPIOR1 |= 128;
__USigBuffer[idx] = data;
return 0;
}
Expand Down

0 comments on commit 4b0b506

Please sign in to comment.