Skip to content

Commit

Permalink
Fix set_vel_setpoint (0x00D) data decoding (#59)
Browse files Browse the repository at this point in the history
* fix endpoint data decoding

* bump version

* update readme

* update gitignore

* fix patch
  • Loading branch information
yconst authored Oct 10, 2020
1 parent 6c80bc4 commit e688737
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Tinymovr is an affordable motor controller for precise control of 3-phase brushl

The repository is organized as follows:

[firmware](./firmware/): Firmware for the PAC5527 MCU in Tinymovr(to be added)
[firmware](./firmware/): Firmware for the PAC5527 MCU in Tinymovr

[studio](./studio/): Tinymovr Studio client software and library

Expand Down
5 changes: 4 additions & 1 deletion firmware/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
Release
*.pdf
cser
build
build

# Ignore modifications to pac55xx_sdk
pac55xx_sdk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff --git a/original.c b/modified.c
diff --git pac5xxx_driver_tile_socbridge.c pac5xxx_driver_tile_socbridge.c
index f99ced2..630212e 100644
--- a/original.c
+++ b/modified.c
--- pac5xxx_driver_tile_socbridge.c
+++ pac5xxx_driver_tile_socbridge.c
@@ -27,7 +27,8 @@ RAMFUNC_TILE void pac5xxx_tile_socbridge_config(int enable, int int_enable)
}

Expand Down
7 changes: 3 additions & 4 deletions firmware/src/can/can_endpoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,11 @@ uint8_t CAN_SetPosSetpoint(uint8_t buffer[])
uint8_t CAN_SetVelSetpoint(uint8_t buffer[])
{
float vel;
int16_t Iq_ff;
float Iq_ff;
memcpy(&vel, &buffer[0], sizeof(float));
memcpy(&Iq_ff, &buffer[4], sizeof(int16_t));
float iqFF_float = Iq_ff * 0.01f;
memcpy(&Iq_ff, &buffer[4], sizeof(float));
Controller_SetVelSetpoint(vel);
Controller_SetIqSetpoint(iqFF_float);
Controller_SetIqSetpoint(Iq_ff);
return CANRP_Write;
}

Expand Down
2 changes: 1 addition & 1 deletion firmware/src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#define VERSION_MAJOR (0u)
#define VERSION_MINOR (7u)
#define VERSION_PATCH (1u)
#define VERSION_PATCH (2u)

/// TINYMOVR CONFIGURATION OPTIONS ///

Expand Down

0 comments on commit e688737

Please sign in to comment.