mirror of https://github.com/rusefi/bldc.git
Added COMM_SET_CAN_MODE and added support for HW75_300_R3
This commit is contained in:
parent
5ab7bc9ba6
commit
76fd7a3917
23
commands.c
23
commands.c
|
@ -989,6 +989,29 @@ void commands_process_packet(unsigned char *data, unsigned int len,
|
|||
}
|
||||
} break;
|
||||
|
||||
case COMM_SET_CAN_MODE: {
|
||||
int32_t ind = 0;
|
||||
bool store = data[ind++];
|
||||
bool ack = data[ind++];
|
||||
bool mode = data[ind++];
|
||||
|
||||
appconf = *app_get_configuration();
|
||||
appconf.can_mode = mode;
|
||||
|
||||
if (store) {
|
||||
conf_general_store_app_configuration(&appconf);
|
||||
}
|
||||
|
||||
app_set_configuration(&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.
|
||||
|
|
|
@ -98,7 +98,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"
|
||||
|
|
|
@ -756,7 +756,11 @@ typedef enum {
|
|||
COMM_WRITE_NEW_APP_DATA_ALL_CAN_LZO,
|
||||
COMM_BM_WRITE_FLASH_LZO,
|
||||
COMM_SET_CURRENT_REL,
|
||||
COMM_CAN_FWD_FRAME
|
||||
COMM_CAN_FWD_FRAME,
|
||||
COMM_SET_BATTERY_CUT,
|
||||
COMM_SET_BLE_NAME,
|
||||
COMM_SET_BLE_PIN,
|
||||
COMM_SET_CAN_MODE
|
||||
} COMM_PACKET_ID;
|
||||
|
||||
// CAN commands
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue