This commit is contained in:
Benjamin Vedder 2021-04-12 09:48:29 +02:00
parent ca8e7b4f05
commit 998bc17ba7
5 changed files with 21 additions and 19 deletions

View File

@ -97,13 +97,13 @@ void app_set_configuration(app_configuration *conf) {
break;
case APP_PPM_UART:
hw_stop_i2c();
app_ppm_start();
app_uartcomm_start(UART_PORT_COMM_HEADER);
hw_stop_i2c();
app_ppm_start();
app_uartcomm_start(UART_PORT_COMM_HEADER);
break;
case APP_ADC_UART:
hw_stop_i2c();
hw_stop_i2c();
app_adc_start(false);
app_uartcomm_start(UART_PORT_COMM_HEADER);
break;
@ -138,8 +138,8 @@ void app_set_configuration(app_configuration *conf) {
case APP_CUSTOM:
#ifdef APP_CUSTOM_TO_USE
hw_stop_i2c();
app_custom_start();
hw_stop_i2c();
app_custom_start();
#endif
break;

View File

@ -519,6 +519,7 @@ bool comm_can_ping(uint8_t controller_id, HW_TYPE *hw_type) {
return ret != 0;
#else
(void)controller_id;
(void)hw_type;
return 0;
#endif
}

View File

@ -77,10 +77,6 @@ static mutex_t terminal_mutex;
static volatile int fw_version_sent_cnt = 0;
static bool isInitialized = false;
bool commands_is_initialized(void) {
return isInitialized;
}
void commands_init(void) {
chMtxObjectInit(&print_mutex);
chMtxObjectInit(&send_buffer_mutex);
@ -89,6 +85,10 @@ void commands_init(void) {
isInitialized = true;
}
bool commands_is_initialized(void) {
return isInitialized;
}
/**
* Send a packet using the set send function.
*

View File

@ -24,6 +24,7 @@
// Functions
void commands_init(void);
bool commands_is_initialized(void);
void commands_send_packet(unsigned char *data, unsigned int len);
void commands_send_packet_can_last(unsigned char *data, unsigned int len);
void commands_send_packet_nrf(unsigned char *data, unsigned int len);
@ -48,5 +49,5 @@ void commands_set_ble_name(char* name);
void commands_set_ble_pin(char* pin);
void commands_send_plot_points(float x, float y);
int commands_get_fw_version_sent_cnt(void);
bool commands_is_initialized(void);
#endif /* COMMANDS_H_ */

View File

@ -24,7 +24,7 @@
#define FW_VERSION_MAJOR 5
#define FW_VERSION_MINOR 03
// Set to 0 for building a release and iterate during beta test builds
#define FW_TEST_VERSION_NUMBER 21
#define FW_TEST_VERSION_NUMBER 22
#include "datatypes.h"
@ -72,13 +72,13 @@
//#define HW_SOURCE "hw_60.c"
//#define HW_HEADER "hw_60.h"
#define HW_SOURCE "hw_gesc.c"
#define HW_HEADER "hw_gesc.h"
//#define HW_SOURCE "hw_gesc.c"
//#define HW_HEADER "hw_gesc.h"
// Mark3 version of HW60 with power switch and separate NRF UART.
//#define HW60_IS_MK3
//#define HW60_IS_MK4
//#define HW60_IS_MK5
#define HW60_IS_MK5
//#define HW_SOURCE "hw_60.c"
//#define HW_HEADER "hw_60.h"
@ -109,7 +109,7 @@
// Second revision with separate UART for NRF51
//#define HW75_300_REV_2
//#define HW75_300_REV_3
#define HW75_300_REV_3
//#define HW_SOURCE "hw_75_300.c"
//#define HW_HEADER "hw_75_300.h"
@ -129,8 +129,8 @@
//#define HW_SOURCE "hw_binar_v1.c"
//#define HW_HEADER "hw_binar_v1.h"
//#define HW_SOURCE "hw_hd60.c"
//#define HW_HEADER "hw_hd60.h"
#define HW_SOURCE "hw_hd60.c"
#define HW_HEADER "hw_hd60.h"
//#define HW_SOURCE "hw_hd75.c"
//#define HW_HEADER "hw_hd75.h"
@ -216,7 +216,7 @@
// CAN-plotter
//#define APP_CUSTOM_TO_USE "app_plot_can.c"
//#define APPCONF_APP_TO_USE APP_NONE
//#define APPCONF_APP_TO_USE APP_CUSTOM
//#define APPCONF_CAN_BAUD_RATE CAN_BAUD_75K
#include "hw.h"