diff --git a/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna.c b/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna.c index 13e3555..6ae8428 100644 --- a/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna.c +++ b/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna.c @@ -25,7 +25,7 @@ * * \author Gabriel Mariano Marcelino * - * \version 0.2.12 + * \version 0.4.0 * * \date 20/09/2017 * @@ -51,8 +51,7 @@ void isis_antenna_arm() { debug_print_event_from_module(DEBUG_INFO, ISIS_ANTENNA_MODULE_NAME, "Arming...\n\r"); - uint8_t data = ISIS_ANTENNA_CMD_ARM; - isis_antenna_i2c_write_data(&data, 1); + isis_antenna_i2c_write_byte(ISIS_ANTENNA_CMD_ARM); debug_print_event_from_module(DEBUG_INFO, ISIS_ANTENNA_MODULE_NAME, "Arming command transmitted!\n\r"); @@ -63,8 +62,7 @@ void isis_antenna_disarm() { debug_print_event_from_module(DEBUG_INFO, ISIS_ANTENNA_MODULE_NAME, "Disarming...\n\r"); - uint8_t data = ISIS_ANTENNA_CMD_DISARM; - isis_antenna_i2c_write_data(&data, 1); + isis_antenna_i2c_write_byte(ISIS_ANTENNA_CMD_DISARM); isis_antenna_delay_ms(100); } @@ -153,8 +151,7 @@ isis_antenna_status_t isis_antenna_read_deployment_status() { uint16_t status_code = ISIS_ANTENNA_STATUS_MASK; // Initial state - uint8_t data = ISIS_ANTENNA_CMD_REPORT_DEPLOY_STATUS; - isis_antenna_i2c_write_data(&data, 1); + isis_antenna_i2c_write_byte(ISIS_ANTENNA_CMD_REPORT_DEPLOY_STATUS); isis_antenna_delay_ms(1000); diff --git a/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna_config.h b/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna_config.h index 8f58ac1..920b9c2 100644 --- a/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna_config.h +++ b/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna_config.h @@ -25,7 +25,7 @@ * * \author Gabriel Mariano Marcelino * - * \version 0.2.12 + * \version 0.4.0 * * \date 21/09/2017 * @@ -56,6 +56,7 @@ #define ISIS_ANTENNA_I2C_CLOCK UCS_getSMCLK() +#define ISIS_ANTENNA_I2C_TIMEOUT 10000 #define ISIS_ANTENNA_I2C_TIMEOUT_MS 100 #endif // ISIS_ANTENNA_CONFIG_H_ diff --git a/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna_i2c.c b/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna_i2c.c index e4e14ce..8cb391f 100644 --- a/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna_i2c.c +++ b/firmware/fsat_beacon_msp430/drivers/antenna/isis_antenna_i2c.c @@ -25,7 +25,7 @@ * * \author Gabriel Mariano Marcelino * - * \version 0.2.13 + * \version 0.4.0 * * \date 21/09/2017 * @@ -98,7 +98,7 @@ void isis_antenna_i2c_write_byte(uint8_t byte) USCI_A_I2C_setMode(ISIS_ANTENNA_I2C_BASE_ADDRESS, USCI_A_I2C_TRANSMIT_MODE); // Send single byte data - USCI_A_I2C_masterSendSingleByte(ISIS_ANTENNA_I2C_BASE_ADDRESS, byte); + USCI_A_I2C_masterSendSingleByteWithTimeout(ISIS_ANTENNA_I2C_BASE_ADDRESS, byte, ISIS_ANTENNA_I2C_TIMEOUT); // Wait until transmission completes uint16_t timeout_ms = ISIS_ANTENNA_I2C_TIMEOUT_MS; @@ -118,7 +118,7 @@ void isis_antenna_i2c_write_byte(uint8_t byte) USCI_B_I2C_setMode(ISIS_ANTENNA_I2C_BASE_ADDRESS, USCI_B_I2C_TRANSMIT_MODE); // Send single byte data - USCI_B_I2C_masterSendSingleByte(ISIS_ANTENNA_I2C_BASE_ADDRESS, byte); + USCI_B_I2C_masterSendSingleByteWithTimeout(ISIS_ANTENNA_I2C_BASE_ADDRESS, byte, ISIS_ANTENNA_I2C_TIMEOUT); // Wait until transmission completes uint16_t timeout_ms = ISIS_ANTENNA_I2C_TIMEOUT_MS; @@ -141,29 +141,29 @@ void isis_antenna_i2c_write_data(uint8_t *data, uint8_t len) #if ISIS_ANTENNA_I2C_USCI == USCI_A // Set in transmit mode USCI_A_I2C_setMode(ISIS_ANTENNA_I2C_BASE_ADDRESS, USCI_A_I2C_TRANSMIT_MODE); - - USCI_A_I2C_masterSendMultiByteStart(ISIS_ANTENNA_I2C_BASE_ADDRESS, data[0]); - + + USCI_A_I2C_masterSendMultiByteStartWithTimeout(ISIS_ANTENNA_I2C_BASE_ADDRESS, data[0], ISIS_ANTENNA_I2C_TIMEOUT); + uint8_t i = 1; for(i=1; i * - * \version 0.3.5 + * \version 0.4.0 * * \date 08/02/2019 * @@ -36,7 +36,7 @@ #ifndef VERSION_H_ #define VERSION_H_ -#define FIRMWARE_VERSION "0.3.5" +#define FIRMWARE_VERSION "0.4.0" #define FIRMWARE_STATUS "Development"