-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from floripasat/dev
Version 0.5.0
- Loading branch information
Showing
5 changed files
with
69 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.3.4 | ||
* \version 0.4.13 | ||
* | ||
* \date 23/09/2016 | ||
* | ||
|
@@ -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"); | ||
|
@@ -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() | ||
|
@@ -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; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.3.3 | ||
* \version 0.4.14 | ||
* | ||
* \date 23/03/2017 | ||
* | ||
|
@@ -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"); | ||
|
@@ -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() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.4.6 | ||
* \version 0.4.15 | ||
* | ||
* \date 09/06/2017 | ||
* | ||
|
@@ -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"); | ||
|
@@ -80,6 +82,9 @@ bool radio_init() | |
if (init_status == STATUS_SUCCESS) | ||
{ | ||
rf4463_enter_standby_mode(); | ||
|
||
radio_mode = RADIO_MODE_STANDBY; | ||
|
||
return true; | ||
} | ||
else | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.4.6 | ||
* \version 0.4.15 | ||
* | ||
* \date 09/06/2017 | ||
* | ||
|
@@ -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. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.4.12 | ||
* \version 0.5.0 | ||
* | ||
* \date 08/02/2019 | ||
* | ||
|
@@ -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]" | ||
|