Commit a568793
committed
This should fix a dangeerous situation when paths
/Debug/BatteryOperationalLimits/SolarVoltageOffset
/Debug/BatteryOperationalLimits/VebusVoltageOffset
/Debug/BatteryOperationalLimits/CurrentOffset
were not handled correctly and as a writable paths allowed to enter any
value.
These values are used in _adjust_battery_operational_limits and
_update_solarchargers_and_vecan
Setting a large positive voltage offset could cause overcharging
of batteries, potentially leading to thermal runaway, fire, or explosion
in lithium battery systems. Setting a large negative current offset could
prevent charging entirely. These debug paths override BMS safety limits
which exist specifically to prevent dangerous conditions.
Implemented sort of a limit, applied to all three values and based on
tests I found.
Unfortunately there's no deployment code to exclude these paths from
production releases.1 parent a250f7a commit a568793
2 files changed
+72
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1043 | 1043 | | |
1044 | 1044 | | |
1045 | 1045 | | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
1049 | 1068 | | |
1050 | 1069 | | |
1051 | 1070 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
924 | 924 | | |
925 | 925 | | |
926 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
927 | 976 | | |
928 | 977 | | |
929 | 978 | | |
| |||
1258 | 1307 | | |
1259 | 1308 | | |
1260 | 1309 | | |
1261 | | - | |
1262 | 1310 | | |
1263 | 1311 | | |
1264 | 1312 | | |
| |||
1307 | 1355 | | |
1308 | 1356 | | |
1309 | 1357 | | |
1310 | | - | |
| 1358 | + | |
1311 | 1359 | | |
1312 | 1360 | | |
1313 | 1361 | | |
| |||
0 commit comments