Skip to content

Instantly share code, notes, and snippets.

Created May 9, 2011 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/962970 to your computer and use it in GitHub Desktop.
Save anonymous/962970 to your computer and use it in GitHub Desktop.
Teacup reprap firmware patch: update temp_residency each 10ms instead of 250ms (when using INTERCOM).
diff -Naur a/temp.c b/temp.c
--- a/temp.c 2011-05-09 23:19:05.386655497 +0600
+++ b/temp.c 2011-05-09 23:37:36.316164309 +0600
@@ -271,8 +271,9 @@
break;
}
temp_sensors_runtime[i].last_read_temp = temp;
+ }
- if (labs((int16_t)(temp - temp_sensors_runtime[i].target_temp)) < (TEMP_HYSTERESIS*4)) {
+ if (labs((int16_t)(temp_sensors_runtime[i].last_read_temp - temp_sensors_runtime[i].target_temp)) < (TEMP_HYSTERESIS*4)) {
if (temp_sensors_runtime[i].temp_residency < (TEMP_RESIDENCY_TIME*100))
temp_sensors_runtime[i].temp_residency++;
}
@@ -283,7 +284,6 @@
if (temp_sensors[i].heater < NUM_HEATERS) {
heater_tick(temp_sensors[i].heater, i, temp_sensors_runtime[i].last_read_temp, temp_sensors_runtime[i].target_temp);
}
- }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment