Named indices for Temperature class (#14479)

This commit is contained in:
Scott Lahteine
2019-07-02 08:39:55 -05:00
committed by GitHub
parent 274809aced
commit 720bc7c00b
3 changed files with 132 additions and 131 deletions

View File

@ -36,19 +36,18 @@
* U<bool> with a non-zero value will apply the result to current settings
*/
void GcodeSuite::M303() {
const int8_t e = parser.intval('E');
if (!WITHIN(e, 0
#if ENABLED(PIDTEMPBED)
-1
#endif
,
#if ENABLED(PIDTEMP)
HOTENDS
#endif
-1
)) {
#if ENABLED(PIDTEMPBED)
#define SI H_BED
#else
#define SI H_E0
#endif
#if ENABLED(PIDTEMP)
#define EI HOTENDS - 1
#else
#define EI H_BED
#endif
const heater_ind_t e = (heater_ind_t)parser.intval('E');
if (!WITHIN(e, SI, EI)) {
SERIAL_ECHOLNPGM(MSG_PID_BAD_EXTRUDER_NUM);
return;
}