Skip to content

Commit

Permalink
Account for bad reading
Browse files Browse the repository at this point in the history
  • Loading branch information
nwdepatie committed Jun 4, 2024
1 parent 6e1dc7e commit aa15305
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CM7/Core/Src/encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ void vEncoderObserver(void *pv_params)
for (;;)
{
/* Retrieve SSI position */
encoder_get_angle_ssi(encoder, &ssi_position);
if (encoder_get_angle_ssi(encoder, &ssi_position));
continue;

/* Fuse SSI position with incremental position */
msg.payload.rotor_position = (ssi_position + encoder_get_angle_incr(encoder)) / 2;
Expand Down

0 comments on commit aa15305

Please sign in to comment.