Fixed conflicts with master merge

This commit is contained in:
Benjamin Vedder 2020-04-04 22:35:29 +02:00
commit 2f19819d27
5 changed files with 42 additions and 4 deletions

View File

@ -7,7 +7,7 @@
ifeq ($(USE_OPT),)
USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99 -D_GNU_SOURCE
USE_OPT += -DBOARD_OTG_NOVBUSSENS $(build_args)
USE_OPT += -fsingle-precision-constant -Wdouble-promotion
USE_OPT += -fsingle-precision-constant -Wdouble-promotion -specs=nosys.specs
endif
# C specific options here (added to USE_OPT).

View File

@ -1065,6 +1065,32 @@ void commands_process_packet(unsigned char *data, unsigned int len,
reply_func(send_buffer, ind);
} break;
case COMM_SET_CAN_MODE: {
int32_t ind = 0;
bool store = data[ind++];
bool ack = data[ind++];
bool mode = data[ind++];
app_configuration *appconf = mempools_alloc_appconf();
*appconf = *app_get_configuration();
appconf->can_mode = mode;
if (store) {
conf_general_store_app_configuration(appconf);
}
app_set_configuration(appconf);
mempools_free_appconf(appconf);
if (ack) {
ind = 0;
uint8_t send_buffer[50];
send_buffer[ind++] = packet_id;
reply_func(send_buffer, ind);
}
} break;
// Blocking commands. Only one of them runs at any given time, in their
// own thread. If other blocking commands come before the previous one has
// finished, they are discarded.

View File

@ -99,7 +99,8 @@
//#define HW75_300_VEDDER_FIRST_PCB
// Second revision with separate UART for NRF51
#define HW75_300_REV_2
//#define HW75_300_REV_2
#define HW75_300_REV_3
//#define HW_SOURCE "hw_75_300.c"
//#define HW_HEADER "hw_75_300.h"

View File

@ -765,7 +765,8 @@ typedef enum {
COMM_CAN_FWD_FRAME,
COMM_SET_BATTERY_CUT,
COMM_SET_BLE_NAME,
COMM_SET_BLE_PIN
COMM_SET_BLE_PIN,
COMM_SET_CAN_MODE
} COMM_PACKET_ID;
// CAN commands

View File

@ -20,7 +20,9 @@
#ifndef HW_75_300_H_
#define HW_75_300_H_
#ifdef HW75_300_REV_2
#ifdef HW75_300_REV_3
#define HW_NAME "75_300_R3"
#elif defined(HW75_300_REV_2)
#define HW_NAME "75_300_R2"
#else
#define HW_NAME "75_300"
@ -197,6 +199,14 @@
#define HW_UART_P_RX_PIN 11
#endif
#ifdef HW75_300_REV_3
// NRF SWD
#define NRF5x_SWDIO_GPIO GPIOA
#define NRF5x_SWDIO_PIN 15
#define NRF5x_SWCLK_GPIO GPIOB
#define NRF5x_SWCLK_PIN 3
#endif
// ICU Peripheral for servo decoding
#define HW_USE_SERVO_TIM4
#define HW_ICU_TIMER TIM4