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
Only httpd.c conflicted: main added the buffered configuration upload next to the pointers this branch had moved into xdata to free internal RAM. Both belong, so the new globals sit above declarations that keep their storage class.
This commit is contained in:
+25
-14
@@ -759,18 +759,25 @@ void parse_mtu(void)
|
||||
write_char('\n');
|
||||
}
|
||||
|
||||
void sfp_print_measurements(uint8_t sfp)
|
||||
bool sfp_print_measurements(uint8_t sfp)
|
||||
{
|
||||
print_string("Options: "); print_byte(sfp_read_reg(sfp, 92)); write_char('\n');
|
||||
if (!sfp_read_block(sfp, 92, 1))
|
||||
return false;
|
||||
|
||||
print_string("Options: "); print_byte(sfp_buf[0]); write_char('\n');
|
||||
if (!(sfp_options[sfp] & 0x40))
|
||||
return;
|
||||
print_string("Temp: "); print_byte(sfp_read_reg(sfp, 224)); print_byte(sfp_read_reg(sfp, 225)); write_char('\n');
|
||||
print_string("Vcc: "); print_byte(sfp_read_reg(sfp, 226)); print_byte(sfp_read_reg(sfp, 227)); write_char('\n');
|
||||
print_string("TX Bias: "); print_byte(sfp_read_reg(sfp, 228)); print_byte(sfp_read_reg(sfp, 229)); write_char('\n');
|
||||
print_string("TX Power: "); print_byte(sfp_read_reg(sfp, 230)); print_byte(sfp_read_reg(sfp, 231)); write_char('\n');
|
||||
print_string("RX Power: "); print_byte(sfp_read_reg(sfp, 232)); print_byte(sfp_read_reg(sfp, 233)); write_char('\n');
|
||||
print_string("Laser: "); print_byte(sfp_read_reg(sfp, 234)); print_byte(sfp_read_reg(sfp, 235)); write_char('\n');
|
||||
print_string("State: "); print_byte(sfp_read_reg(sfp, 238)); write_char('\n');
|
||||
return true;
|
||||
if (!sfp_read_block(sfp, 224, 16))
|
||||
return false;
|
||||
print_string("Temp: "); print_byte(sfp_buf[0]); print_byte(sfp_buf[1]); write_char('\n');
|
||||
print_string("Vcc: "); print_byte(sfp_buf[2]); print_byte(sfp_buf[3]); write_char('\n');
|
||||
print_string("TX Bias: "); print_byte(sfp_buf[4]); print_byte(sfp_buf[5]); write_char('\n');
|
||||
print_string("TX Power: "); print_byte(sfp_buf[6]); print_byte(sfp_buf[7]); write_char('\n');
|
||||
print_string("RX Power: "); print_byte(sfp_buf[8]); print_byte(sfp_buf[9]); write_char('\n');
|
||||
print_string("Laser: "); print_byte(sfp_buf[10]); print_byte(sfp_buf[11]); write_char('\n');
|
||||
print_string("State: "); print_byte(sfp_buf[14]); write_char('\n');
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -788,11 +795,15 @@ void parse_sfp(void)
|
||||
print_string(" - empty\n");
|
||||
continue;
|
||||
}
|
||||
print_string(" - Rate: "); print_byte(sfp_read_reg(slot, 12));
|
||||
print_string(" Encoding: "); print_byte(sfp_read_reg(slot, 11));
|
||||
if (!sfp_read_block(slot, 11, 2)) {
|
||||
print_string(" - I2C read failed on this slot\n");
|
||||
continue;
|
||||
}
|
||||
print_string(" - Rate: "); print_byte(sfp_buf[1]);
|
||||
print_string(" Encoding: "); print_byte(sfp_buf[0]);
|
||||
write_char('\n');
|
||||
sfp_print_info(slot);
|
||||
sfp_print_measurements(slot);
|
||||
if (!sfp_print_info(slot) || !sfp_print_measurements(slot))
|
||||
print_string("I2C read failed on this slot\n");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user