State call seems to be ignored - SOLVED

Update - Finally figured out my own error.

Working on coding for an Ironman helmet with lights and servos.

Goal is to have two buttons. First button will either close faceplate, blinks the LEDs twice, and then fades them on OR fade the LEDs off and then open the faceplate.

Second button will turn the LEDs immediately off or on (depending on their current state) but ONLY if the faceplate is already closed.

Having a problem with the very first part. Quick summary is: button press calls S_FACEPLATECLOSE. That moves the servos and calls S_SERVOWAIT. That delays a short period of time and calls S_BLINKON. That blinks the LEDs twice and calls S_FADEON. S_FADEON sets the LEDs to a PWM variable and then calls S_WAITON. S_WAITON checks the time to introduce a delay. Once the delay has passed it checks the current PWM variable and if were still under the max, it increments the variable and calls back to S_FADEON. That should set the LEDs to the new PWM and kick it back to S_WAITON.

Problem is, it’s never returning to S_FADEON. I know for sure the conditional statement is executing because I tested a serial print just before the state = S_FADEON call.

Full code below:

// IronMan Helmet: eye blink sequence_v1.0
// created by: xl97


//import servo lib
#include <Servo.h>

//servo object names
Servo myservo1; // create servo object to control a servo
Servo myservo2; // create servo object to control a servo

const int FaceplateButtonPin = 2; // the pin that the pushbutton is attached to
int FaceplateButtonState = 0; // current state of the button
int lastFaceplateButtonState = 0; // previous state of the button

const int EyeButtonPin = 6; // the pin that the pushbutton is attached to
int EyeButtonState = 0; // current state of the button
int lastEyeButtonState = 0; // previous state of the button

// led control pins (need to be PWM enabled pins for fading)
const int rightEye =  3;  // the number of the right eye/pcb LEDs
const int leftEye = 4;

unsigned long fadeDelay = .5; //speed of the eye 'fade'
unsigned long fadeDelayOn = .2;
unsigned long callDelay = 700; //length to wait to start eye flicker after face plate comes down
unsigned long blinkSpeed = 100; //delay between init blink on/off
unsigned long currentPWM = 0;
boolean EyeLEDsOn = false; // current state of the eye LEDs
boolean FaceplateOpen = true; // current state of the faceplate

#define S_IDLE 1
#define S_EYESLEDON 2
#define S_WAITON 3
#define S_EYESLEDOFF 4
#define S_WAITOFF 5
#define S_INITON 6
#define S_INITWAIT 7
#define S_BLINKON 8
#define S_FACEPLATEOPEN 9
#define S_SERVOWAIT 10
#define S_SERVOUP 11
#define S_FADEON 12
#define S_FACEPLATECLOSE 0



//FSM init vars
static int state = S_IDLE; // initial state is 1, the "idle" state.
static unsigned long lastTime;  // To store the "current" time in for delays.


void setup() {
  // Set up serial port
  Serial.begin(9600);  
  //start it off
  //state = S_BLINKON; 
  Serial.print("INTIT STATE: ");
  Serial.println(state);

  myservo1.attach(9); // attaches the servo on pin 9 to the servo object
  myservo2.attach(8); // attaches the servo on pin 9 to the servo object
  pinMode(FaceplateButtonPin, INPUT); // initialize the button pin as a input
  digitalWrite(FaceplateButtonPin, HIGH); //use interal pull up resistors
  pinMode(EyeButtonPin, INPUT); //initialize the eye button pin as input
  digitalWrite(EyeButtonPin, HIGH); //use internal pull up resistors
}

void loop() { 
  switch(state)
  {
  case S_IDLE:
    // We don't need to do anything here, waiting for a forced state change...like button press.
    //check main button state
    FaceplateButtonState = digitalRead(FaceplateButtonPin);
    EyeButtonState = digitalRead(EyeButtonPin);

    if (FaceplateButtonState != lastFaceplateButtonState) {
      //if FaceplateButton pressed/down
      if (FaceplateButtonState == LOW){
        //ie: pressed   
          if(FaceplateOpen == true) {
            state = S_FACEPLATECLOSE;
        }
        else{
            state = S_FACEPLATEOPEN;
        }
      } 
    }
    
    // compare EyeButtonState to previous state
    if (EyeButtonState != lastEyeButtonState) {
      //if EyeButton pressed down and faceplate is down
      if (EyeButtonState == LOW and FaceplateOpen == false) { 
        //if eyes are lit, turn them off
        if (EyeLEDsOn == true) {
          state = S_EYESLEDOFF;          
        }
        else {
          state = S_EYESLEDON;
        }
      }
      else {
        if (EyeButtonState == LOW and FaceplateOpen == true) {
          Serial.println("Eye button pressed but faceplate is open");
        }
      }
    }
 
    lastFaceplateButtonState = FaceplateButtonState;
    lastEyeButtonState = EyeButtonState;
    break;

  case S_FADEON:
    Serial.println("Fade on LEDs");
    lastTime = millis();  // Remember the current time
    analogWrite(leftEye, currentPWM);
    analogWrite(rightEye, currentPWM);
    state = S_WAITON;
  break;

  case S_WAITON:
    Serial.println("Delay to determine speed of fading LEDs on");
    if(millis() > (lastTime + fadeDelay)){
      if(currentPWM < 255){
        currentPWM += 5;
        Serial.println("Call the damn fade routine you piece of crap.");
        state = S_FADEON;        
      }
      else{
        Serial.println("@ 255 done........");
        state = S_IDLE;
        //state = S_LEDOFF; //no auto turn off.. set to idle state
      }
    }
    EyeLEDsOn = true;
    state = S_IDLE;
  break;

  case S_EYESLEDOFF:
    Serial.println("Immediate off for eyes");
    analogWrite(leftEye, 0);
    analogWrite(rightEye, 0);
    EyeLEDsOn = false;
    state = S_IDLE;
  break;
    
  case S_EYESLEDON:
    Serial.println("Immediate on for eyes");
    analogWrite(leftEye, 155);
    analogWrite(rightEye, 155);
    EyeLEDsOn = true;
    state = S_IDLE;
  break;


  case S_WAITOFF:
    Serial.println("Delay while fading LEDs off");
    EyeLEDsOn = false;
    state = S_SERVOUP;
  break;

  case S_SERVOUP:
    Serial.println("Raise faceplate");
    FaceplateOpen = true;
    state = S_IDLE;
  break;

  case S_BLINKON:
    Serial.println("Blink LEDs before fading on");
    //do blink routine here
    //one blink
    analogWrite(leftEye, 155);
    analogWrite(rightEye, 155);
    delay(blinkSpeed);
    analogWrite(leftEye, 0);
    analogWrite(rightEye, 0);
    delay(10);
    //two blinks
    analogWrite(leftEye, 155);
    analogWrite(rightEye, 155);
    delay(blinkSpeed);
    analogWrite(leftEye, 0);
    analogWrite(rightEye, 0);
    delay(10);
    state = S_FADEON;
  break;

  case S_FACEPLATEOPEN:
    Serial.println("Fade LEDs off");
    state = S_WAITOFF;
  break;
  
  case S_SERVOWAIT:
    // If enough time has passed, call the eye flicker routine
    if(millis() > (lastTime + callDelay)){   
      Serial.println("Delay after closing helmet before turning on lights");
      state = S_BLINKON;        
    }
    else{
      Serial.println("waiting........");
    }
  break;

  case S_FACEPLATECLOSE:
    lastTime = millis();  // Remember the current time
    Serial.println("Close faceplate");
    myservo1.write(0);
    myservo2.write(0);
    FaceplateOpen = false;
    state = S_SERVOWAIT;
  break;

  default:
    state = S_IDLE;
   break;
  }
}