WIP
This commit is contained in:
@@ -8,7 +8,6 @@ const byte HardwareVersionLow = 0;
|
||||
const uint32_t HELP_PACKAGE_CAN_ID = 0xFFFF;
|
||||
const uint32_t SWITCH_TRIGGERED_CAN_ID = 0x050;
|
||||
const uint32_t TRIGGER_SWITCH_CAN_ID = 0x055;
|
||||
const uint32_t HELP_PACKAGE_ID = 0xFFFF;
|
||||
|
||||
struct can_frame _frame;
|
||||
|
||||
@@ -166,7 +165,6 @@ void setup() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
@@ -175,6 +173,21 @@ bool debugState = false;
|
||||
|
||||
void loop() {
|
||||
|
||||
|
||||
SendSerialPackage(mcp2515_0);
|
||||
SendSerialPackage(mcp2515_1);
|
||||
SendSerialPackage(mcp2515_2);
|
||||
SendSerialPackage(mcp2515_3);
|
||||
|
||||
debugState = !debugState;
|
||||
if (debugState)
|
||||
digitalWrite(PIN_PC7, HIGH);
|
||||
else
|
||||
digitalWrite(PIN_PC7, LOW);
|
||||
|
||||
delay(1000);
|
||||
return;
|
||||
|
||||
if (mcp2515_0.readMessage(&_frame) == MCP2515::ERROR_OK)
|
||||
{
|
||||
mcp2515_1.sendMessage(MCP2515::TXB1, &_frame);
|
||||
@@ -269,7 +282,7 @@ uint32_t CreateCanId(uint32_t commandId)
|
||||
}
|
||||
|
||||
|
||||
void SendSerialPackage()
|
||||
void SendSerialPackage(MCP2515 ss)
|
||||
{
|
||||
_frame.can_id = CreateCanId(HELP_PACKAGE_CAN_ID);
|
||||
_frame.can_dlc = 4;
|
||||
@@ -278,7 +291,7 @@ void SendSerialPackage()
|
||||
_frame.data[1] = SoftwareVersionLow;
|
||||
_frame.data[2] = HardwareVersionHigh;
|
||||
_frame.data[3] = HardwareVersionLow;
|
||||
mcp2515_1.sendMessage(MCP2515::TXB1, &_frame);
|
||||
mcp2515_0.sendMessage(MCP2515::TXB1, &_frame);
|
||||
}
|
||||
|
||||
void SendSwitchedTriggeredCanPackage(byte pinId, int state)
|
||||
|
||||
Reference in New Issue
Block a user