Created
February 26, 2022 10:24
-
-
Save fnarfbargle/530a7e7e122d94e6ca3aa6016cc41370 to your computer and use it in GitHub Desktop.
Thermotop V reset code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[code] | |
BYTE wb_io(BYTE cmd, BYTE skip) | |
{ | |
byte error; | |
byte tries = 3; | |
do | |
{ | |
msg_send(cmd); | |
error = msg_recv(cmd, skip); | |
if (!error) return 0; | |
retries++; | |
if (error == ERROR_TMO_CHK_ADR) { | |
wait_ms(ERROR_DELAY); | |
} else if (error == ERROR_NACK) { | |
wait_ms(NACK_DELAY); | |
} else { | |
return error; | |
} | |
} while (--tries); | |
return error; | |
} | |
void Do_Errors(byte clear) { | |
byte errors; | |
BlinkPush(); | |
DoBlink(0x11,0); | |
message_length=1; | |
message_data[0]=1; // Get errors | |
if (!wb_io(0x56, 1)) { // Error Cmd | |
errors=message_in[0]; | |
if (errors && clear) { // Are there any errors? | |
message_data[0]=3; // Clear errors | |
if (!wb_io(0x56, 1)) { // Error Cmd | |
Blink_Number(errors); // We cleared errors | |
} | |
} else Blink_Number(errors); | |
} | |
BlinkPop(); | |
} | |
[/code] | |
It includes my blinky stuff so it reads any errors from the heater, and if the clear flag is set and the heater has errors it clears them. Otherwise it just flashes out the number of errors. | |
Only tested on my D3 ThermoTop V, but it works here. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment