Skip to content

Commit

Permalink
[REFACTOR] Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
aleemont1 committed Dec 4, 2023
1 parent 6e90eae commit 18c7a0f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
25 changes: 25 additions & 0 deletions smart_bridge/src/tasks/CheckOutTask.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#ifndef __CHECK_OUT_TASK__
#define __CHECK_OUT_TASK__

#include "config/config.h"
#include "kernel/DependantTaskWithState.h"
<<<<<<< HEAD
#include "config/config.h"
#include "components/api/Sonar.h"
#include "components/api/Led.h"
=======
#include "components/api/Led.h"
#include "components/api/Sonar.h"
>>>>>>> 005e2fa ([REFACTOR] Refactoring)
#include "components/api/ServoImpl.h"
#include "BlinkTask.h"


/**
* @brief Manages the process of a car exiting the transit area.
Expand All @@ -19,6 +27,7 @@
class CheckOutTask : public DependantTaskWithState
{
public:
<<<<<<< HEAD
/**
* @brief Construct a new Exit Transit Task object
*
Expand All @@ -30,6 +39,22 @@ class CheckOutTask : public DependantTaskWithState
*
* This function is overridden from DependantTaskWithState.
*/
=======
CheckOutTask(BlinkTask *blinkTask) : DependantTaskWithState()
{
this->L2 = new Led(L2_PIN);
this->L3 = new Led(L3_PIN);
this->sonar = new Sonar(SONAR_TRIG_PIN, SONAR_ECHO_PIN, SONAR_MAX_TIME);
this->gate = new ServoImpl(SERVO_PIN);
this->blinkTask = blinkTask;
this->blinkTask->isCompleted();
this->blinkTask->setActive(false);
this->L3->switchOn();
this->init();
this->setState(OPENING_GATE);
Serial.println("CheckOutTask created");
}
>>>>>>> 005e2fa ([REFACTOR] Refactoring)
void tick() override;

/**
Expand Down
10 changes: 10 additions & 0 deletions smart_bridge/src/tasks/CountDown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,16 @@ void CountDown::endsCountDown()
{
if (getCountDown() <= 0)
{
<<<<<<< HEAD
this->setStatus(true);
this->isCompleted();
this->printsEndsCountdown();
this->resetCountDown(N3);
=======
this->isCompleted(); // NOTE: non credo serva
this->printsEndsCountdown(); // NOTE: meglio chiamare direttamente la stampa, si usa meno spazio sullo stack
this->resetCountDown(N3);
>>>>>>> 005e2fa ([REFACTOR] Refactoring)
Serial.println("CountDown::Countdown resetted");
this->setCompleted();
}
Expand Down Expand Up @@ -118,4 +124,8 @@ void CountDown::tick()
startCountDown();
printCountDown();
decreaseCountDown();
<<<<<<< HEAD
=======
endsCountDown(); // NOTE: lo chiami già in decreaseCountDown(), non serve chiamarlo qui.
>>>>>>> 005e2fa ([REFACTOR] Refactoring)
}

0 comments on commit 18c7a0f

Please sign in to comment.