mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-03 09:49:32 +02:00
Merge branch 'dalathegreat:main' into tesla-feature-bmsreset
This commit is contained in:
commit
a3b7edf6f6
5 changed files with 8 additions and 8 deletions
|
@ -10,7 +10,7 @@ ci:
|
|||
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: v17.0.4
|
||||
rev: v20.1.0
|
||||
hooks:
|
||||
- id: clang-format
|
||||
args: [-Werror] # change formatting warnings to errors, hook includes -i (Inplace edit) by default
|
||||
|
|
|
@ -101,8 +101,8 @@ struct x108_EVSE_Capabilities { // Frame byte
|
|||
uint16_t available_output_voltage = MAX_EVSE_OUTPUT_VOLTAGE; // 1,2
|
||||
uint8_t available_output_current = MAX_EVSE_OUTPUT_CURRENT; // 3
|
||||
uint16_t threshold_voltage = 297; // 4,5 voltage that EVSE will stop if car fails to
|
||||
// perhaps vehicle minus 3%, hardcoded initially to 96*2.95
|
||||
// 6,7 = unused
|
||||
// perhaps vehicle minus 3%, hardcoded initially to 96*2.95
|
||||
// 6,7 = unused
|
||||
};
|
||||
|
||||
/* Does double duty for charging and discharging */
|
||||
|
|
|
@ -177,9 +177,9 @@ void handle_incoming_can_frame_battery(CAN_frame rx_frame) {
|
|||
cycle_count = (uint16_t)(rx_frame.data.u8[7] << 8 | rx_frame.data.u8[6]);
|
||||
break;
|
||||
case 0x1876: //BMS_PackTemps
|
||||
// 0x1876 b0 bit 0 appears to be 1 when at maxsoc and BMS says charge is not allowed -
|
||||
// when at 0 indicates charge is possible - additional note there is something more to it than this,
|
||||
// it's not as straight forward - needs more testing to find what sets/unsets bit0 of byte0
|
||||
// 0x1876 b0 bit 0 appears to be 1 when at maxsoc and BMS says charge is not allowed -
|
||||
// when at 0 indicates charge is possible - additional note there is something more to it than this,
|
||||
// it's not as straight forward - needs more testing to find what sets/unsets bit0 of byte0
|
||||
if ((rx_frame.data.u8[0] & 0x01) > 0) {
|
||||
max_charge_power_dA = 0;
|
||||
charging_disabled = true;
|
||||
|
|
|
@ -469,7 +469,7 @@ void update_values_can_inverter() { //This function maps all the CAN values fet
|
|||
FOXESS_1879.data.u8[0] = (uint8_t)0; // Error codes go here, still unsure of bitmasking
|
||||
if (datalayer.battery.status.current_dA > 0) {
|
||||
FOXESS_1879.data.u8[1] = 0x35; //Charging
|
||||
} // Mappings taken from https://github.com/FozzieUK/FoxESS-Canbus-Protocol
|
||||
} // Mappings taken from https://github.com/FozzieUK/FoxESS-Canbus-Protocol
|
||||
else {
|
||||
FOXESS_1879.data.u8[1] = 0x2B; //Discharging
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ inline void printFailed(const char* message, FILE* file = stdout) {
|
|||
class AssertFailedException : public std::exception {
|
||||
public:
|
||||
AssertFailedException(std::string description, std::string filepath, int line)
|
||||
: std::exception(), description_(description), filepath_(filepath), line_(line){};
|
||||
: std::exception(), description_(description), filepath_(filepath), line_(line) {};
|
||||
|
||||
virtual const char* what() const throw() { return description_.c_str(); }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue