Update comments

This commit is contained in:
Alex Voinea 2021-01-14 12:53:12 +02:00
parent dea3f23a69
commit 20c3f4cb77

View File

@ -1077,8 +1077,9 @@ void setup()
eeprom_update_byte((unsigned char *)EEPROM_FAN_CHECK_ENABLED,true); eeprom_update_byte((unsigned char *)EEPROM_FAN_CHECK_ENABLED,true);
} }
//saved EEPROM SN is not valid. Try to retrieve it.
if (eeprom_read_byte((uint8_t*)EEPROM_PRUSA_SN + 19)) //saved EEPROM SN is not valid. Try to retrieve it. //SN is valid only if it is NULL terminated. Any other character means either uninitialized or corrupted
if (eeprom_read_byte((uint8_t*)EEPROM_PRUSA_SN + 19))
{ {
char SN[20]; char SN[20];
if (get_PRUSA_SN(SN)) if (get_PRUSA_SN(SN))
@ -3403,14 +3404,14 @@ void gcode_M701()
* Typical format of S/N is:CZPX0917X003XC13518 * Typical format of S/N is:CZPX0917X003XC13518
* *
* Send command ;S to serial port 0 to retrieve serial number stored in 32U2 processor, * Send command ;S to serial port 0 to retrieve serial number stored in 32U2 processor,
* reply is transmitted to the selected serial port. * reply is stored in *SN.
* Operation takes typically 23 ms. If the retransmit is not finished until 100 ms, * Operation takes typically 23 ms. If the retransmit is not finished until 100 ms,
* it is interrupted, so less, or no characters are retransmitted, only newline character is send * it is interrupted, so less, or no characters are retransmitted, the function returns false
* in any case.
* The command will fail if the 32U2 processor is unpowered via USB since it is isolated from the rest of the electronics. * The command will fail if the 32U2 processor is unpowered via USB since it is isolated from the rest of the electronics.
* In that case the value that is stored in the EEPROM should be used instead. * In that case the value that is stored in the EEPROM should be used instead.
* *
* @return 1 on success * @return 1 on success
* @return 0 on general failure
*/ */
static bool get_PRUSA_SN(char* SN) static bool get_PRUSA_SN(char* SN)
{ {