smit-happens / YCP_EVOS

Development for the 2018 YCP Formula Electric Vehicle
MIT License
9 stars 1 forks source link

buttons work but not really #87

Closed smit-happens closed 6 years ago

smit-happens commented 6 years ago

End goal

fix the multiple triggering of dash task flags for button presses

Relevant Info/Links

seems as tho the task flag is not getting cleared correctly in StageManager

Your Code

uint32_t StageManager::processDash(EventTask* deviceTasks)
{
    //do Dash processing

    uint8_t localTasks = deviceTasks->getTaskFlags(DASH);

    Serial.println(localTasks);

    switch(currentStage){
        case STAGE_STANDBY:
            Serial.println("Dash - Standby stage");

            if(localTasks && TF_DASH_PRECHARGE)
            {
                Serial.println("Precharge btn press");
                deviceTasks->clearTaskFlag(DASH, TF_DASH_PRECHARGE);
            }

            if(localTasks && TF_DASH_WAYNE_WORLD)
            {
                Serial.println("WAYNE WORLD btn press");
                deviceTasks->clearTaskFlag(DASH, TF_DASH_WAYNE_WORLD);
            }

        break;

Screenshot/Media

image