From 36b6b5f0d38aed64f8d6f3fc9a7da8fdf5982787 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 30 Dec 2022 22:36:18 -0500 Subject: [PATCH 1/3] damn lua --- B6-temp.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/B6-temp.md b/B6-temp.md index ab3ef40e..6c4857dc 100644 --- a/B6-temp.md +++ b/B6-temp.md @@ -172,7 +172,8 @@ function onMotor2(bus, id, dlc, data) brakeBit = rpm < 2000 and 1 or 0 setBitRange(motor2Data, 16, 1, brakeBit) - motor2Data[1] = motor2mux[math.floor(motor2counter / 4)] + index = math.floor(motor2counter / 4) + motor2Data[1] = motor2mux[1 + index] -- txCan(TCU_BUS, id, 0, data) txCan(TCU_BUS, id, 0, motor2Data) From 6cd183dde0108f31eaed14e203b056956b1ecc93 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 30 Dec 2022 22:40:45 -0500 Subject: [PATCH 2/3] better? --- B6-temp.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/B6-temp.md b/B6-temp.md index 6c4857dc..2a2e599a 100644 --- a/B6-temp.md +++ b/B6-temp.md @@ -236,9 +236,9 @@ end canMotorInfoCounter = 0 function onMotorInfo(bus, id, dlc, data) canMotorInfoCounter = (canMotorInfoCounter + 1) % 16 - canMotorInfo[1] = 0x90 + (canMotorInfoCounter) - canMotorInfo1[1] = 0x90 + (canMotorInfoCounter) - canMotorInfo3[1] = 0x90 + (canMotorInfoCounter) + canMotorInfo[1] = 0x80 + (canMotorInfoCounter) + canMotorInfo1[1] = 0x80 + (canMotorInfoCounter) + canMotorInfo3[1] = 0x80 + (canMotorInfoCounter) mod4 = canMotorInfoCounter % 4 @@ -246,8 +246,8 @@ function onMotorInfo(bus, id, dlc, data) -- txCan(1, MOTOR_INFO, 0, canMotorInfo) txCan(TCU_BUS, id, 0, data) elseif (mod4 == 1) then --- txCan(1, MOTOR_INFO, 0, canMotorInfo1) - txCan(TCU_BUS, id, 0, data) + txCan(1, MOTOR_INFO, 0, canMotorInfo1) +-- txCan(TCU_BUS, id, 0, data) else -- txCan(1, MOTOR_INFO, 0, canMotorInfo3) txCan(TCU_BUS, id, 0, data) From 674da2458cbf59575c862f3632ccca92cc3bba7b Mon Sep 17 00:00:00 2001 From: rusefillc Date: Fri, 30 Dec 2022 22:42:30 -0500 Subject: [PATCH 3/3] still OK --- B6-temp.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/B6-temp.md b/B6-temp.md index 2a2e599a..ce84d849 100644 --- a/B6-temp.md +++ b/B6-temp.md @@ -249,8 +249,8 @@ function onMotorInfo(bus, id, dlc, data) txCan(1, MOTOR_INFO, 0, canMotorInfo1) -- txCan(TCU_BUS, id, 0, data) else --- txCan(1, MOTOR_INFO, 0, canMotorInfo3) - txCan(TCU_BUS, id, 0, data) + txCan(1, MOTOR_INFO, 0, canMotorInfo3) +-- txCan(TCU_BUS, id, 0, data) end end