Am I trying to do the impossible here? Checking the MSB ( bit 15) of an integer to set a boolean - the compiler gets very upset and generates a huge amount of verbiage.
"X_control" is generated correctly from X_pro, and I am trying to separate out magnitude and direction for a coil drive current in the last half dozen lines.
if (X_control)bit(15) = true
X_positive = false ; // Save control demand polarity
else X_positive = true ;
X_control = abs(X_control); // Process further to generate PWM to coil driver