From 72c28d34627b985ed093932d8cf0e963c74aabd1 Mon Sep 17 00:00:00 2001
From: Elton Law <eltonlaw296@gmail.com>
Date: Wed, 12 May 2021 03:21:55 -0400
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20G5=20IJ=20with=20Motion=20?=
 =?UTF-8?q?Mode=20(#21858)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Marlin/src/gcode/parser.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/Marlin/src/gcode/parser.cpp b/Marlin/src/gcode/parser.cpp
index 7e75783b7a6..896ff273cd2 100644
--- a/Marlin/src/gcode/parser.cpp
+++ b/Marlin/src/gcode/parser.cpp
@@ -216,10 +216,9 @@ void GCodeParser::parse(char *p) {
       break;
 
     #if ENABLED(GCODE_MOTION_MODES)
-      #if ENABLED(ARC_SUPPORT)
-        case 'I' ... 'J':
-          if (motion_mode_codenum != 2 && motion_mode_codenum != 3) return;
-      #endif
+      case 'I' ... 'J':
+        if (motion_mode_codenum != 5 && \
+            TERN1(ARC_SUPPORT, motion_mode_codenum != 2 && motion_mode_codenum != 3)) return;
       case 'Q':
         if (motion_mode_codenum != 5) return;
       case 'X' ... 'Z': case 'E' ... 'F':