Skip to content

Commit

Permalink
Merge pull request #339 from spacelab-ufsc/aldebaran_mission
Browse files Browse the repository at this point in the history
Merge pull request from aldebaran_mission, closes #334, fix #331
  • Loading branch information
mgm8 authored Sep 19, 2023
2 parents 774487b + 93d9c1d commit 57ba054
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 18 deletions.
9 changes: 6 additions & 3 deletions firmware/app/tasks/antenna_deployment.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.8.39
* \version 0.10.7
*
* \date 2021/11/17
*
Expand Down Expand Up @@ -55,7 +55,7 @@ void vTaskAntennaDeployment(void)

for(i = initial_hib_time_counter; i < CONFIG_ANTENNA_DEPLOYMENT_HIBERNATION_MIN; i++)
{
vTaskDelay(pdMS_TO_TICKS(60*1000));
vTaskDelay(pdMS_TO_TICKS(60000U));

sat_data_buf.obdh.data.initial_hib_time_count++;
}
Expand Down Expand Up @@ -84,7 +84,7 @@ void vTaskAntennaDeployment(void)
sys_log_new_line();
}

sat_data_buf.obdh.data.ant_deployment_counter = true;
sat_data_buf.obdh.data.ant_deployment_executed = true;

sat_data_buf.obdh.data.ant_deployment_counter++;
}
Expand All @@ -95,6 +95,9 @@ void vTaskAntennaDeployment(void)
sys_log_print_msg(")");
sys_log_new_line();
}

/* Startup task status = Done */
vTaskSuspend(xTaskAntennaDeploymentHandle);
}

/** \} End of antenna_deployment group */
6 changes: 3 additions & 3 deletions firmware/app/tasks/system_reset.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* system_reset.c
*
* Copyright (C) 2021, SpaceLab.
* Copyright The OBDH 2.0 Contributors.
*
* This file is part of OBDH 2.0.
*
Expand All @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.7.47
* \version 0.10.7
*
* \date 2020/01/12
*
Expand All @@ -44,7 +44,7 @@ void vTaskSystemReset(void)
{
while(1)
{
vTaskDelay(pdMS_TO_TICKS(TASK_SYSTEM_RESET_PERIOD_MS));
vTaskDelay(pdMS_TO_TICKS_64(TASK_SYSTEM_RESET_PERIOD_MS));

sys_log_print_event_from_module(SYS_LOG_INFO, TASK_SYSTEM_RESET_NAME, "Restarting the system...");
sys_log_new_line();
Expand Down
6 changes: 4 additions & 2 deletions firmware/app/tasks/system_reset.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* system_reset.h
*
* Copyright (C) 2021, SpaceLab.
* Copyright The OBDH 2.0 Contributors.
*
* This file is part of OBDH 2.0.
*
Expand All @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.7.48
* \version 0.10.7
*
* \date 2020/01/12
*
Expand All @@ -45,6 +45,8 @@
#define TASK_SYSTEM_RESET_PRIORITY 2 /**< Task priority. */
#define TASK_SYSTEM_RESET_PERIOD_MS (1000UL*60U*60U*10U) /**< Task period in milliseconds. */

#define pdMS_TO_TICKS_64( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )

/**
* \brief Periodic system reset handle.
*/
Expand Down
3 changes: 2 additions & 1 deletion firmware/app/tasks/tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.9.18
* \version 0.10.7
*
* \date 2019/11/02
*
Expand All @@ -39,6 +39,7 @@
#include <config/config.h>

#include "tasks.h"
#include "antenna_deployment.h"
#include "startup.h"
#include "watchdog_reset.h"
#include "heartbeat.h"
Expand Down
5 changes: 2 additions & 3 deletions firmware/devices/antenna/antenna.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.10.2
* \version 0.10.7
*
* \date 2019/11/01
*
Expand Down Expand Up @@ -201,7 +201,7 @@ int antenna_deploy(uint32_t timeout_ms)
}

/* Sequential deployment */
sys_log_print_event_from_module(SYS_LOG_INFO, ANTENNA_MODULE_NAME, "Trying an sequential deploy...");
sys_log_print_event_from_module(SYS_LOG_INFO, ANTENNA_MODULE_NAME, "Trying a sequential deploy...");
sys_log_new_line();

if (isis_antenna_start_sequential_deploy(ANTENNA_SEQUENTIAL_DEPLOY_BURN_TIME_SEC) != 0)
Expand Down Expand Up @@ -240,7 +240,6 @@ int antenna_deploy(uint32_t timeout_ms)
err++;
}

return err;
#else
sys_log_print_event_from_module(SYS_LOG_ERROR, ANTENNA_MODULE_NAME, "No driver to read the status!");
sys_log_new_line();
Expand Down
6 changes: 3 additions & 3 deletions firmware/drivers/isis_antenna/isis_antenna_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.10.2
* \version 0.10.7
*
* \date 2021/10/10
*
Expand Down Expand Up @@ -93,7 +93,7 @@ int isis_antenna_i2c_write(uint8_t *data, uint16_t len)
{
isis_antenna_delay_ms(1);

if (tca4311a_disable(ants_config) == TCA4311A_NOT_READY)
if (tca4311a_disable(ants_config) == TCA4311A_READY)
{
err = 0;

Expand Down Expand Up @@ -148,7 +148,7 @@ int isis_antenna_i2c_read(uint8_t *data, uint16_t len)
{
isis_antenna_delay_ms(1);

if (tca4311a_disable(ants_config) == TCA4311A_NOT_READY)
if (tca4311a_disable(ants_config) == TCA4311A_READY)
{
err = 0;

Expand Down
6 changes: 3 additions & 3 deletions firmware/tests/drivers/isis_antenna_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <gabriel.mm8@gmail.com>
*
* \version 0.10.2
* \version 0.10.7
*
* \date 2021/09/01
*
Expand Down Expand Up @@ -611,7 +611,7 @@ void write_test(uint8_t *wd, uint16_t wd_len)
expect_value(__wrap_tca4311a_disable, config.en_pin, ISIS_ANTENNA_IIC_EN_PIN);
expect_value(__wrap_tca4311a_disable, config.ready_pin, ISIS_ANTENNA_IIC_RDY_PIN);

will_return(__wrap_tca4311a_disable, 1);
will_return(__wrap_tca4311a_disable, 0);
}

void read_test(uint8_t *rd, uint16_t rd_len)
Expand Down Expand Up @@ -644,7 +644,7 @@ void read_test(uint8_t *rd, uint16_t rd_len)
expect_value(__wrap_tca4311a_disable, config.en_pin, ISIS_ANTENNA_IIC_EN_PIN);
expect_value(__wrap_tca4311a_disable, config.ready_pin, ISIS_ANTENNA_IIC_RDY_PIN);

will_return(__wrap_tca4311a_disable, 1);
will_return(__wrap_tca4311a_disable, 0);
}

/** \} End of isis_antenna_test group */

0 comments on commit 57ba054

Please sign in to comment.