Skip to content

Commit

Permalink
Merge pull request #11 from floripasat/dev
Browse files Browse the repository at this point in the history
Version 0.5.0
  • Loading branch information
mgm8 authored Aug 21, 2019
2 parents 754e0c3 + 211b2a8 commit 5fe131b
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 23 deletions.
26 changes: 19 additions & 7 deletions firmware/fsat_beacon_msp430/hal/eps/eps_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <[email protected]>
*
* \version 0.3.4
* \version 0.4.13
*
* \date 23/09/2016
*
Expand All @@ -40,6 +40,8 @@

Queue eps_queue;

bool eps_is_enabled = false;

bool eps_init()
{
debug_print_event_from_module(DEBUG_INFO, EPS_HAL_MODULE_NAME, "Initializing communication bus...\n\r");
Expand All @@ -59,17 +61,27 @@ bool eps_init()

void eps_enable()
{
debug_print_event_from_module(DEBUG_INFO, EPS_HAL_MODULE_NAME, "Enabling reception...\n\r");
if (!eps_is_enabled)
{
debug_print_event_from_module(DEBUG_INFO, EPS_HAL_MODULE_NAME, "Enabling reception...\n\r");

USCI_A_UART_clearInterrupt(EPS_UART_BASE_ADDRESS, USCI_A_UART_RECEIVE_INTERRUPT);
USCI_A_UART_enableInterrupt(EPS_UART_BASE_ADDRESS, USCI_A_UART_RECEIVE_INTERRUPT);
USCI_A_UART_clearInterrupt(EPS_UART_BASE_ADDRESS, USCI_A_UART_RECEIVE_INTERRUPT);
USCI_A_UART_enableInterrupt(EPS_UART_BASE_ADDRESS, USCI_A_UART_RECEIVE_INTERRUPT);

eps_is_enabled = true;
}
}

void eps_disable()
{
debug_print_event_from_module(DEBUG_WARNING, EPS_HAL_MODULE_NAME, "Disabling reception...\n\r");
if (eps_is_enabled)
{
debug_print_event_from_module(DEBUG_WARNING, EPS_HAL_MODULE_NAME, "Disabling reception...\n\r");

USCI_A_UART_disableInterrupt(EPS_UART_BASE_ADDRESS, USCI_A_UART_RECEIVE_INTERRUPT);

USCI_A_UART_disableInterrupt(EPS_UART_BASE_ADDRESS, USCI_A_UART_RECEIVE_INTERRUPT);
eps_is_enabled = false;
}
}

uint8_t eps_available()
Expand Down Expand Up @@ -130,7 +142,7 @@ static bool eps_hal_uart_init()
}
else
{
debug_print_event_from_module(DEBUG_ERROR, EPS_HAL_MODULE_NAME, "Error initializing the UART bus!");
debug_print_event_from_module(DEBUG_ERROR, EPS_HAL_MODULE_NAME, "Error initializing the UART bus!\n\r");

return false;
}
Expand Down
24 changes: 18 additions & 6 deletions firmware/fsat_beacon_msp430/hal/obdh/obdh_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <[email protected]>
*
* \version 0.3.3
* \version 0.4.14
*
* \date 23/03/2017
*
Expand All @@ -43,6 +43,8 @@

Queue obdh_queue;

bool obdh_is_enabled = false;

bool obdh_init()
{
debug_print_event_from_module(DEBUG_INFO, OBDH_COM_MODULE_NAME, "Initializing communication...\n\r");
Expand Down Expand Up @@ -91,17 +93,27 @@ static bool obdh_hal_spi_init()

void obdh_enable()
{
debug_print_event_from_module(DEBUG_INFO, OBDH_COM_MODULE_NAME, "Enabling reception...\n\r");
if (!obdh_is_enabled)
{
debug_print_event_from_module(DEBUG_INFO, OBDH_COM_MODULE_NAME, "Enabling reception...\n\r");

USCI_A_SPI_clearInterrupt(OBDH_SPI_BASE_ADDRESS, USCI_A_SPI_RECEIVE_INTERRUPT);
USCI_A_SPI_enableInterrupt(OBDH_SPI_BASE_ADDRESS, USCI_A_SPI_RECEIVE_INTERRUPT);
USCI_A_SPI_clearInterrupt(OBDH_SPI_BASE_ADDRESS, USCI_A_SPI_RECEIVE_INTERRUPT);
USCI_A_SPI_enableInterrupt(OBDH_SPI_BASE_ADDRESS, USCI_A_SPI_RECEIVE_INTERRUPT);

obdh_is_enabled = true;
}
}

void obdh_disable()
{
debug_print_event_from_module(DEBUG_WARNING, OBDH_COM_MODULE_NAME, "Disabling reception...\n\r");
if (obdh_is_enabled)
{
debug_print_event_from_module(DEBUG_WARNING, OBDH_COM_MODULE_NAME, "Disabling reception...\n\r");

USCI_A_UART_disableInterrupt(OBDH_SPI_BASE_ADDRESS, USCI_A_SPI_RECEIVE_INTERRUPT);

USCI_A_UART_disableInterrupt(OBDH_SPI_BASE_ADDRESS, USCI_A_SPI_RECEIVE_INTERRUPT);
obdh_is_enabled = false;
}
}

uint8_t obdh_available()
Expand Down
24 changes: 18 additions & 6 deletions firmware/fsat_beacon_msp430/hal/radio/radio_hal.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <[email protected]>
*
* \version 0.4.6
* \version 0.4.15
*
* \date 09/06/2017
*
Expand Down Expand Up @@ -57,6 +57,8 @@
#include "radio_hal.h"
#include "radio_hal_config.h"

uint8_t radio_mode = RADIO_MODE_STANDBY;

bool radio_init()
{
debug_print_event_from_module(DEBUG_INFO, RADIO_HAL_MODULE_NAME, "Initializing device...\n\r");
Expand All @@ -80,6 +82,9 @@ bool radio_init()
if (init_status == STATUS_SUCCESS)
{
rf4463_enter_standby_mode();

radio_mode = RADIO_MODE_STANDBY;

return true;
}
else
Expand Down Expand Up @@ -136,6 +141,7 @@ void radio_write(uint8_t *data, uint16_t len)
#elif BEACON_RADIO == RF4463F30
rf4463_tx_long_packet(data, len);
rf4463_enter_standby_mode();
radio_mode = RADIO_MODE_STANDBY;
#elif BEACON_RADIO == UART_SIM
uart_radio_sim_send_data(data, len);
#endif // BEACON_RADIO
Expand Down Expand Up @@ -178,6 +184,7 @@ void radio_sleep()
#elif BEACON_RADIO == RF4463F30
GPIO_disableInterrupt(RADIO_GPIO_nIRQ_PORT, RADIO_GPIO_nIRQ_PIN);
rf4463_enter_standby_mode();
radio_mode = RADIO_MODE_STANDBY;
#elif BEACON_RADIO == UART_SIM
return;
#endif // BEACON_RADIO
Expand All @@ -198,17 +205,22 @@ void radio_wake_up()

void radio_enable_rx()
{
debug_print_event_from_module(DEBUG_INFO, RADIO_HAL_MODULE_NAME, "Enabling RX...\n\r");
if (radio_mode != RADIO_MODE_RX)
{
debug_print_event_from_module(DEBUG_INFO, RADIO_HAL_MODULE_NAME, "Enabling RX...\n\r");

#if BEACON_RADIO == CC1175 || BEACON_RADIO == CC1125
return;
return;
#elif BEACON_RADIO == SI4063
return;
return;
#elif BEACON_RADIO == RF4463F30
rf4463_enter_rx_mode();
rf4463_enter_rx_mode();
#elif BEACON_RADIO == UART_SIM
return;
return;
#endif // BEACON_RADIO

radio_mode = RADIO_MODE_RX;
}
}

void radio_disable_rx()
Expand Down
12 changes: 11 additions & 1 deletion firmware/fsat_beacon_msp430/hal/radio/radio_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <[email protected]>
*
* \version 0.4.6
* \version 0.4.15
*
* \date 09/06/2017
*
Expand All @@ -40,6 +40,16 @@
#include <stdint.h>
#include <stdbool.h>

/**
* \brief Radio modes.
*/
typedef enum
{
RADIO_MODE_STANDBY = 0, /**< Standby mode. */
RADIO_MODE_TX, /**< TX mode. */
RADIO_MODE_RX /**< RX mode. */
} radio_modes_e;

/**
* \brief Initialization of the radio module.
*
Expand Down
6 changes: 3 additions & 3 deletions firmware/fsat_beacon_msp430/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* \author Gabriel Mariano Marcelino <[email protected]>
*
* \version 0.4.12
* \version 0.5.0
*
* \date 08/02/2019
*
Expand All @@ -36,9 +36,9 @@
#ifndef VERSION_H_
#define VERSION_H_

#define FIRMWARE_VERSION "0.4.12"
#define FIRMWARE_VERSION "0.5.0"

#define FIRMWARE_STATUS "Development"
#define FIRMWARE_STATUS "Testing"

#define FIRMWARE_AUTHOR_NAME "Gabriel Mariano Marcelino"
#define FIRMWARE_AUTHOR_EMAIL "[email protected]"
Expand Down

0 comments on commit 5fe131b

Please sign in to comment.