If no "B" parameter given, get 1 byte

This commit is contained in:
Scott Lahteine 2016-05-11 15:29:54 -07:00
parent a6d594665b
commit aaeadf0cbd

View file

@ -5038,7 +5038,7 @@ inline void gcode_M121() { endstops.enable_globally(false); }
*/ */
inline void gcode_M156() { inline void gcode_M156() {
uint8_t addr = code_seen('A') ? code_value_short() : 0; uint8_t addr = code_seen('A') ? code_value_short() : 0;
int bytes = code_seen('B') ? code_value_short() : 0; int bytes = code_seen('B') ? code_value_short() : 1;
if (addr && bytes > 0 && bytes <= 32) { if (addr && bytes > 0 && bytes <= 32) {
i2c.address(addr); i2c.address(addr);