Merge pull request #465 from dalathegreat/bugfix/contactor-closing-egmp

Feature: Contactor closing for eGMP
This commit is contained in:
Daniel Öster 2024-09-23 16:18:47 +03:00 committed by GitHub
commit c53ebf1366
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 579 additions and 192 deletions

View file

@ -54,6 +54,7 @@ unsigned long previousMillisUpdateVal = 0;
// CAN parameters
CAN_device_t CAN_cfg; // CAN Config
const int rx_queue_size = 10; // Receive Queue size
volatile bool send_ok = 0;
#ifdef DUAL_CAN
#include "src/lib/pierremolinaro-acan2515/ACAN2515.h"
@ -944,7 +945,10 @@ void transmit_can(CAN_frame* tx_frame, int interface) {
for (uint8_t i = 0; i < MCP2518Frame.len; i++) {
MCP2518Frame.data[i] = tx_frame->data.u8[i];
}
canfd.tryToSend(MCP2518Frame);
send_ok = canfd.tryToSend(MCP2518Frame);
if (!send_ok) {
set_event(EVENT_CANFD_BUFFER_FULL, interface);
}
#else // Interface not compiled, and settings try to use it
set_event(EVENT_INTERFACE_MISSING, interface);
#endif //CAN_FD