Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vedderb committed Apr 12, 2021
1 parent ca8e7b4 commit 998bc17
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
12 changes: 6 additions & 6 deletions applications/app.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
1 change: 1 addition & 0 deletions comm_can.c
Expand Up @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions commands.c
Expand Up @@ -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);
Expand All @@ -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.
*
Expand Down
3 changes: 2 additions & 1 deletion commands.h
Expand Up @@ -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);
Expand All @@ -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_ */
16 changes: 8 additions & 8 deletions conf_general.h
Expand Up @@ -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"

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 998bc17

Please sign in to comment.