#include "headSystem.hpp"
#include "FreeRTOS.h"
#include "task.h"

STONE_STATE HeadSystem::dropSequence() {
    gpio_put(LED1_PIN, 1);
    if(!preLoad()) {
        this->stoneState = EMPTY;
        return this->stoneState;
    }

    bool prev_head_state = headUp;
    setHeadUp(false);
    STONE_STATE res = dropStone();
    setHeadUp(prev_head_state);
    this->stoneState = res;
    gpio_put(LED2_PIN, 0);
    return res;
}