Skip to content

Commit

Permalink
PylontechCanReceiver.cpp: Cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernhard Kaszt committed Mar 12, 2023
1 parent c7f6aea commit e95acbe
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/PylontechCanReceiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ void PylontechCanReceiverClass::enable()

// Install TWAI driver
if (twai_driver_install(&g_config, &t_config, &f_config) == ESP_OK) {
MessageOutput.printf("Driver installed\n");
MessageOutput.printf("[Pylontech] Twai driver installed\n");
} else {
MessageOutput.printf("Failed to install driver\n");
MessageOutput.printf("[Pylontech] Failed to install Twai driver\n");
}

// Start TWAI driver
if (twai_start() == ESP_OK) {
MessageOutput.printf("Driver started\n");
MessageOutput.printf("[Pylontech] Twai driver started\n");
} else {
MessageOutput.printf("Failed to start driver\n");
MessageOutput.printf("[Pylontech] Failed to start Twai driver\n");
}
}

Expand Down Expand Up @@ -102,7 +102,7 @@ void PylontechCanReceiverClass::parseCanPackets()
// Check for messages. twai_recive is blocking when there is no data so we return if there are no frames in the buffer
twai_status_info_t status_info;
if (twai_get_status_info(&status_info) != ESP_OK) {
MessageOutput .printf("Failed to get status info\n");
MessageOutput.printf("[Pylontech]Failed to get Twai status info\n");
return;
}
if (status_info.msgs_to_rx == 0) {
Expand All @@ -112,7 +112,7 @@ void PylontechCanReceiverClass::parseCanPackets()
// Wait for message to be received, function is blocking
twai_message_t rx_message;
if (twai_receive(&rx_message, pdMS_TO_TICKS(100)) != ESP_OK) {
MessageOutput.printf("Failed to receive message\n");
MessageOutput.printf("[Pylontech] Failed to receive message\n");
return;
}

Expand Down Expand Up @@ -201,7 +201,6 @@ void PylontechCanReceiverClass::parseCanPackets()
}

case 0x35E: {

String manufacturer = String(rx_message.data, rx_message.data_length_code);
//CAN.readString();

Expand Down Expand Up @@ -230,7 +229,6 @@ void PylontechCanReceiverClass::parseCanPackets()
Battery.chargeImmediately);
#endif

// this->readUnsignedInt8();
break;
}
}
Expand Down

0 comments on commit e95acbe

Please sign in to comment.