Skip to content

Commit

Permalink
Merge branch 'master' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidGeek authored May 4, 2022
2 parents 5307366 + a0b040b commit dee6550
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/VescUart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ bool VescUart::processReadPacket(uint8_t * message) {

switch (packetId){
case COMM_GET_VALUES: // Structure defined here: https://github.com/vedderb/bldc/blob/43c3bbaf91f5052a35b75c2ff17b5fe99fad94d1/commands.c#L164

data.tempMosfet = buffer_get_float16(message, 10.0, &ind); // 2 bytes - mc_interface_temp_fet_filtered()
data.tempMotor = buffer_get_float16(message, 10.0, &ind); // 2 bytes - mc_interface_temp_motor_filtered()
data.avgMotorCurrent = buffer_get_float32(message, 100.0, &ind); // 4 bytes - mc_interface_read_reset_avg_motor_current()
Expand All @@ -207,7 +207,7 @@ bool VescUart::processReadPacket(uint8_t * message) {
data.error = message[ind++]; // 1 byte - mc_interface_get_fault()
data.pidPos = buffer_get_float32(message, 1000000.0, &ind); // 4 bytes - mc_interface_get_pid_pos_now()
data.id = message[ind++]; // 1 byte - app_get_configuration()->controller_id

return true;

break;
Expand Down Expand Up @@ -346,4 +346,4 @@ void VescUart::printVescValues() {
debugPort->print("tempMotor: "); debugPort->println(data.tempMotor);
debugPort->print("error: "); debugPort->println(data.error);
}
}
}
2 changes: 2 additions & 0 deletions src/VescUart.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ class VescUart
{
/** Struct to store the telemetry data returned by the VESC */
struct dataPackage {
float tempFET;
float tempMotor;
float avgMotorCurrent;
float avgInputCurrent;
float dutyCycleNow;
Expand Down

0 comments on commit dee6550

Please sign in to comment.