mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-09-02 15:02:51 +08:00
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:
+1
-1
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user