From 245e91bca168d12cd6d26f5c30da97785486608d Mon Sep 17 00:00:00 2001 From: Luca Toniolo <10792599+grandixximo@users.noreply.github.com> Date: Sun, 3 May 2026 08:43:01 +0800 Subject: [PATCH] state-tags: replace M_PI_2 with M_PI/2 for RTAI build M_PI_2 is a glibc extension and is not exposed by RTAI's rtapi_math.h, so the RTAI build fails with 'M_PI_2 undeclared' at control.c:2283. M_PI is available in both, so use M_PI/2.0 instead. --- src/emc/motion/control.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emc/motion/control.c b/src/emc/motion/control.c index 5b0a592b990..bf88b09ef08 100644 --- a/src/emc/motion/control.c +++ b/src/emc/motion/control.c @@ -2280,11 +2280,11 @@ static void update_status(void) // G3 (CCW): Heading is Radial Angle + 90 degrees if (motion_type == 30) { - heading_deg = (angle_rad + M_PI_2) * (180.0 / M_PI); - } + heading_deg = (angle_rad + (M_PI / 2.0)) * (180.0 / M_PI); + } // G2 (CW): Heading is Radial Angle - 90 degrees else { - heading_deg = (angle_rad - M_PI_2) * (180.0 / M_PI); + heading_deg = (angle_rad - (M_PI / 2.0)) * (180.0 / M_PI); } // 0-360 Normalization while (heading_deg < 0) heading_deg += 360.0;