Enabled in
This commit is contained in:
28
kx.py
28
kx.py
@@ -48,9 +48,8 @@ class KX:
|
||||
|
||||
|
||||
def writeToFlashK(self):
|
||||
msg = protocol_kx.CANMsgK(self.sbl_id, 0, protocol_kx.KX_FLAG_WRITE_REQ, K)
|
||||
messageK = can.Message(arbitration_id=0x2BB, data=[self.sbl_id, 0, 0,
|
||||
protocol_kx.KX_FLAG_WRITE_REQ], is_extended_id=False)
|
||||
protocol_kx.KX_FLAG_SEND], is_extended_id=False)
|
||||
try:
|
||||
self.can0.send(messageK)
|
||||
time.sleep(0.01)
|
||||
@@ -59,19 +58,12 @@ class KX:
|
||||
print("Flash NOT sent")
|
||||
|
||||
|
||||
def send_test_source_enable(self, x, y, xVel, yVel):
|
||||
resetMsg = can.Message(
|
||||
arbitration_id=0xA,
|
||||
data=[
|
||||
0x53,
|
||||
0xFF,
|
||||
struct.pack('b', int(x))[0],
|
||||
struct.pack('B', int(y))[0],
|
||||
struct.pack('b', int(xVel))[0],
|
||||
struct.pack('b', int(yVel))[0],
|
||||
0x68,
|
||||
0xA4
|
||||
],
|
||||
is_extended_id=False
|
||||
)
|
||||
self.can0.send(resetMsg)
|
||||
def send_test_source_enable(self, enabaled):
|
||||
msg = protocol_kx.CANMsgK(self.sbl_id, 0, protocol_kx.KX_FLAG_WRITE_REQ, K)
|
||||
messageK = can.Message(arbitration_id=0x2BB, data=[self.sbl_id, protocol_kx.KDescription.K_TEST_SOURCES_ENABLED, 0,
|
||||
protocol_kx.KX_FLAG_WRITE_REQ, 0, 0, 0, enabaled], is_extended_id=False)
|
||||
self.can0.send(messageK)
|
||||
self.sendK()
|
||||
self.writeToFlashK()
|
||||
time.sleep(0.1)
|
||||
self.reset()
|
||||
Reference in New Issue
Block a user