Skip to content

Commit

Permalink
[Gate] Remove the wait period of the Gate
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-rabault committed Mar 13, 2024
1 parent d0deae6 commit 47302fe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tool_services/gate/gate.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ void Gate_Init(void)
******************************************************************************/
void Gate_Loop(void)
{
#ifndef GATE_POLLING
static uint32_t last_time = 0;
#endif

// Check the detection status.
if (Luos_IsDetected() == false)
Expand All @@ -68,11 +70,11 @@ void Gate_Loop(void)
if (gate_running == RUNNING)
{
// Manage input and output data
DataManager_Run(gate);
#ifndef GATE_POLLING
if ((Luos_GetSystick() - last_time >= TimeOD_TimeTo_ms(update_time)) && (Luos_GetSystick() > last_time))
{
last_time = Luos_GetSystick();
DataManager_Run(gate);
#ifndef GATE_POLLING
if (first_conversion == true)
{
// This is the first time we perform a convertion
Expand All @@ -95,8 +97,8 @@ void Gate_Loop(void)
DataManager_collect(gate);
first_conversion = false;
}
#endif
}
#endif
}
else
{
Expand Down

0 comments on commit 47302fe

Please sign in to comment.