Skip to content

Commit

Permalink
BREAKING CHANGE: huawei grid charger with MCP2515 requires IRQ pin
Browse files Browse the repository at this point in the history
it is likely that the previous implementation for the MCP2515 CAN
controller and transceiver communicating with the Huawei charger did
work even without the IRQ pin in use. the new implementation will miss
CAN messages if the IRQ pin is not connected or not defined, because it
is event-driven, rather than polling with maximum frequency.

to avoid people yelling at us because their insane setup worked before
but not does not any more, we mark this to be a breaking change.
  • Loading branch information
schlimmchen committed Jan 6, 2025
1 parent f178a14 commit f435c3c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gridcharger/huawei/MCP2515.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bool MCP2515::init()
MessageOutput.printf("[Huawei::MCP2515] clk = %d, miso = %d, mosi = %d, cs = %d, irq = %d\r\n",
pin.huawei_clk, pin.huawei_miso, pin.huawei_mosi, pin.huawei_cs, pin.huawei_irq);

if (pin.huawei_clk < 0 || pin.huawei_miso < 0 || pin.huawei_mosi < 0 || pin.huawei_cs < 0) {
if (pin.huawei_clk < 0 || pin.huawei_miso < 0 || pin.huawei_mosi < 0 || pin.huawei_cs < 0 || pin.huawei_irq < 0) {
MessageOutput.printf("[Huawei::MCP2515] invalid pin config\r\n");
return false;
}
Expand Down

0 comments on commit f435c3c

Please sign in to comment.