moonglow / FlashForge_Marlin

:shark: Marlin firmware for FlashForge Dreamer/Dreamer NX/Inventor, Bosch Dremel 3D20 3D, PowerSpec Ultra 3D and Monoprice Inventor 1
84 stars 26 forks source link

M149 ( set temperature unit ) not working #112

Closed OneMonkeyArmy closed 2 years ago

OneMonkeyArmy commented 2 years ago

To use M149, TEMPERATURE_UNITS_SUPPORT must be define in Configuration.h

When using M149, it reports the current unit correctly..

But when trying to change to C K or F, using M149 C, M149 K or M149 F , it dosen't work, like the parser does not see only a letter, but if I use M149 and add a number after the UNIT Letter like: M149 F8 OR M149 K22, IT WORKS!!!

Probably a bug inside marlin directly, and not form this fork, but if anyone can try and let me know !!!

Thanks in advance...

moonglow commented 2 years ago

@OneMonkeyArmy thanx ! As you already says this is Marlin bug, because they use such code:

void GcodeSuite::M149() {
       if (parser.seenval('C')) parser.set_input_temp_units(TEMPUNIT_C);
  else if (parser.seenval('K')) parser.set_input_temp_units(TEMPUNIT_K);
  else if (parser.seenval('F')) parser.set_input_temp_units(TEMPUNIT_F);
  else M149_report();
}

and seenval needs to have a value:

static bool seenval(const char c) { return seen(c) && has_value(); }

you can report it to official Marlin repo ^_^ Nice catch anyway !