Add M136 (DEBUG) to read back PID values, add heater_print function

This commit is contained in:
Michael Moon 2011-02-20 17:30:07 +11:00
parent 8540be950a
commit 31634c6a8f
3 changed files with 38 additions and 26 deletions

View File

@ -418,6 +418,12 @@ void process_gcode_command() {
power_on(); power_on();
} }
break; break;
#ifdef DEBUG
// M136- PRINT PID settings to host
case 136:
heater_print(next_target.P);
break;
#endif
case 140: //Set heated bed temperature case 140: //Set heated bed temperature
#ifdef HEATER_BED #ifdef HEATER_BED

View File

@ -313,3 +313,7 @@ void pid_set_i_limit(heater_t index, int32_t i_limit) {
heaters_pid[index].i_limit = i_limit; heaters_pid[index].i_limit = i_limit;
#endif /* BANG_BANG */ #endif /* BANG_BANG */
} }
void heater_print(uint16_t i) {
sersendf_P(PSTR("P:%ld I:%ld D:%ld Ilim:%u crc:%u "), heaters_pid[i].p_factor, heaters_pid[i].i_factor, heaters_pid[i].d_factor, heaters_pid[i].i_limit, crc_block(&heaters_pid[i].p_factor, 14));
}

View File

@ -31,4 +31,6 @@ void pid_set_i(heater_t index, int32_t i);
void pid_set_d(heater_t index, int32_t d); void pid_set_d(heater_t index, int32_t d);
void pid_set_i_limit(heater_t index, int32_t i_limit); void pid_set_i_limit(heater_t index, int32_t i_limit);
void heater_print(uint16_t i);
#endif /* _HEATER_H */ #endif /* _HEATER_H */