Add COMM_GET_MCCONF_TEMP command

This commit is contained in:
Peemouse 2020-05-01 15:22:09 +02:00
parent 4be557c72b
commit f6d7ed1fd2
41 changed files with 30 additions and 3 deletions

View File

@ -1,5 +1,6 @@
=== FW 5.02 <dev> === === FW 5.02 <dev> ===
* IMU calibration improvement. * IMU calibration improvement.
* Add COMM_GET_MCCONF_TEMP command
=== FW 5.01 === === FW 5.01 ===
* Fixed PPM bug in previous release. * Fixed PPM bug in previous release.
@ -480,4 +481,3 @@
* Hardware specific default configuration support. * Hardware specific default configuration support.
* Stop functionality for apps so that reboots are not required anymore when changing app. * Stop functionality for apps so that reboots are not required anymore when changing app.
* EEPROM emulation bug fix: https://github.com/vedderb/bldc/issues/27 * EEPROM emulation bug fix: https://github.com/vedderb/bldc/issues/27

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -881,6 +881,32 @@ void commands_process_packet(unsigned char *data, unsigned int len,
mempools_free_mcconf(mcconf); mempools_free_mcconf(mcconf);
} break; } break;
case COMM_GET_MCCONF_TEMP: {
mc_configuration *mcconf = mempools_alloc_mcconf();
*mcconf = *mc_interface_get_configuration();
int32_t ind = 0;
uint8_t *send_buffer = send_buffer_global;
send_buffer[ind++] = packet_id;
buffer_append_float32_auto(send_buffer, mcconf->l_current_min_scale, &ind);
buffer_append_float32_auto(send_buffer, mcconf->l_current_max_scale, &ind);
buffer_append_float32_auto(send_buffer, mcconf->l_min_erpm, &ind);
buffer_append_float32_auto(send_buffer, mcconf->l_max_erpm, &ind);
buffer_append_float32_auto(send_buffer, mcconf->l_min_duty, &ind);
buffer_append_float32_auto(send_buffer, mcconf->l_max_duty, &ind);
buffer_append_float32_auto(send_buffer, mcconf->l_watt_min, &ind);
buffer_append_float32_auto(send_buffer, mcconf->l_watt_max, &ind);
buffer_append_float32_auto(send_buffer, mcconf->l_in_current_min, &ind);
buffer_append_float32_auto(send_buffer, mcconf->l_in_current_max, &ind);
//Setup config needed for speed calculation
send_buffer[ind++] = (uint8_t)mcconf->si_motor_poles;
buffer_append_float32_auto(send_buffer, mcconf->si_gear_ratio, &ind);
buffer_append_float32_auto(send_buffer, mcconf->si_wheel_diameter, &ind);
reply_func(send_buffer, ind);
mempools_free_mcconf(mcconf);
} break;
case COMM_EXT_NRF_PRESENT: { case COMM_EXT_NRF_PRESENT: {
if (!conf_general_permanent_nrf_found) { if (!conf_general_permanent_nrf_found) {
nrf_driver_init_ext_nrf(); nrf_driver_init_ext_nrf();

View File

@ -24,7 +24,7 @@
#define FW_VERSION_MAJOR 5 #define FW_VERSION_MAJOR 5
#define FW_VERSION_MINOR 02 #define FW_VERSION_MINOR 02
// Set to 0 for building a release and iterate during beta test builds // Set to 0 for building a release and iterate during beta test builds
#define FW_TEST_VERSION_NUMBER 1 #define FW_TEST_VERSION_NUMBER 2
#include "datatypes.h" #include "datatypes.h"

View File

@ -768,7 +768,8 @@ typedef enum {
COMM_SET_BLE_NAME, COMM_SET_BLE_NAME,
COMM_SET_BLE_PIN, COMM_SET_BLE_PIN,
COMM_SET_CAN_MODE, COMM_SET_CAN_MODE,
COMM_GET_IMU_CALIBRATION COMM_GET_IMU_CALIBRATION,
COMM_GET_MCCONF_TEMP
} COMM_PACKET_ID; } COMM_PACKET_ID;
// CAN commands // CAN commands