mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-09-02 15:02:51 +08:00
Merge upstream/main into the Spanning Tree branch
cmd_parser.c conflicted twice: main rewrote the pvid command around the new port-separator and atoi helpers, next to the line where this branch delegates "stp" to stp_parse(). Both belong, so the STP delegation keeps main's pvid body. The linker caught what the merge could not see: main changed atoi_byte() to return the digit count and leave the value in atoi_results_u8, where it used to return non-zero on failure and write through a pointer. Note the sense is inverted, so the three calls in rtl837x_stp.c are adjusted rather than just re-arranged.
This commit is contained in:
+17
-4
@@ -838,6 +838,19 @@ void print_reg(uint16_t reg)
|
||||
print_sfr_data();
|
||||
}
|
||||
|
||||
// Print the physical port of a logical port number.
|
||||
void print_phys_port(uint8_t port)
|
||||
{
|
||||
if (port < CPU_PORT)
|
||||
write_char(machine.log_to_phys_port[port] + '0');
|
||||
else if (port == CPU_PORT)
|
||||
print_string("CPU");
|
||||
else {
|
||||
print_string("UNKNOWN ");
|
||||
write_char(port + '0');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
// TODO: This uses 2 DSEG bytes and is not used!
|
||||
@@ -1276,11 +1289,11 @@ bool sfp_read_field(__xdata char *dst, uint8_t sfp, uint8_t start, uint8_t lengt
|
||||
if (!sfp_read_block(sfp, start, length))
|
||||
return false;
|
||||
|
||||
dst[length] = '\0';
|
||||
dst[length] = NUL;
|
||||
memcpy(dst, sfp_buf, length);
|
||||
|
||||
while (length > 0 && dst[--length] == ' ')
|
||||
dst[length] = '\0';
|
||||
dst[length] = NUL;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2088,7 +2101,7 @@ void check_and_flash_update_image(void)
|
||||
* because itohex() is inline and brings its own frame. */
|
||||
void set_hostname_default(void)
|
||||
{
|
||||
if (hostname[0] != '\0')
|
||||
if (hostname[0] != NUL)
|
||||
return;
|
||||
|
||||
strcpy((__xdata uint8_t *)hostname, "RTLPlayground-");
|
||||
@@ -2098,7 +2111,7 @@ void set_hostname_default(void)
|
||||
hostname[17] = hex[uip_ethaddr.addr[4] & 0xf];
|
||||
hostname[18] = hex[uip_ethaddr.addr[5] >> 4];
|
||||
hostname[19] = hex[uip_ethaddr.addr[5] & 0xf];
|
||||
hostname[20] = '\0';
|
||||
hostname[20] = NUL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user