stp: take the review notes on types and register reads

stp_enabled is a flag, so say bool. cmpBytes() returns a comparison
result, so say int8_t. The three busy waits this branch adds read the
status straight out of the SFR instead of copying four bytes to xdata
first.
This commit is contained in:
d00f
2026-08-31 21:50:19 +02:00
parent bd06f7f5e5
commit c0d9bf7f0d
5 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -254,7 +254,7 @@ static void stp_record_designated(uint8_t port) __reentrant
/* Lexicographic compare of n bytes. A MAC is 6 of them; a Bridge Identifier
* is 8, the two priority octets ahead of the MAC, compared as one unsigned
* number per 802.1D. */
signed char cmpBytes(__xdata uint8_t *m1, __xdata uint8_t *m2, uint8_t n) __reentrant
int8_t cmpBytes(__xdata uint8_t *m1, __xdata uint8_t *m2, uint8_t n) __reentrant
{
for (uint8_t i = 0; i < n; i++) {
if (m1[i] == m2[i])