Skip to content

Commit 643e7fe

Browse files
SqwinceUltrawipf
authored andcommitted
Fix Interlacing issue with CAN Analog Axis 5-6 (#124)
1 parent f0c7db1 commit 643e7fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Firmware/FFBoard/UserExtensions/Src/CanAnalog.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ void CanAnalogBase::canRxPendCallback(CANPort* port,CAN_rx_msg& msg){
127127
if(id != this->canId+packet){
128128
continue;
129129
}
130-
for(uint8_t i = 0; i< axes-(packet*4) ; i++){
131-
this->buf[i+(packet*4)] = msg.data[i*2] | (msg.data[i*2+1] << 8);
130+
for(uint8_t i = 0; i < 4 && (i + packet*4) < axes; i++) {
131+
this->buf[i + packet*4] = msg.data[i*2] | (msg.data[i*2+1] << 8);
132132
}
133133
}
134134
}

0 commit comments

Comments
 (0)