Skip to content

Commit

Permalink
v2.1.4
Browse files Browse the repository at this point in the history
- Fix battery cells voltage limits configuration
  • Loading branch information
mspider65 committed Sep 17, 2020
1 parent 875e27f commit 36a0016
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "spider65.ebike.tsdz2_esp32"
minSdkVersion 23
targetSdkVersion 28
versionCode 10
versionName "2.1.3"
versionCode 11
versionName "2.1.4"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ private void saveCfg() {
}
cfg.ui16_battery_voltage_reset_wh_counter_x10 = val;

if ((val = checkRange(binding.batteryCutOffET, 26*cfg.ui8_battery_cells_number, 33*cfg.ui8_battery_cells_number)) == null) {
showDialog(getString(R.string.volt_cut_off), getString(R.string.range_error, 26*cfg.ui8_battery_cells_number, 33*cfg.ui8_battery_cells_number));
if ((val = checkRange(binding.batteryCutOffET, 25*cfg.ui8_battery_cells_number, 33*cfg.ui8_battery_cells_number)) == null) {
showDialog(getString(R.string.volt_cut_off), getString(R.string.range_error, 25*cfg.ui8_battery_cells_number, 33*cfg.ui8_battery_cells_number));
return;
}
cfg.ui16_battery_low_voltage_cut_off_x10 = val;
Expand All @@ -96,26 +96,26 @@ private void saveCfg() {
}
cfg.ui16_battery_pack_resistance_x1000 = val;

if ((val = checkRange(binding.cellOvervoltET, 39*cfg.ui8_battery_cells_number, 44*cfg.ui8_battery_cells_number)) == null) {
showDialog(getString(R.string.cell_overvolt), getString(R.string.range_error, 39*cfg.ui8_battery_cells_number, 44*cfg.ui8_battery_cells_number));
if ((val = checkRange(binding.cellOvervoltET, 300, 440)) == null) {
showDialog(getString(R.string.cell_overvolt), getString(R.string.range_error, 300, 440));
return;
}
cfg.ui8_li_io_cell_overvolt_x100 = val;

if ((val = checkRange(binding.cellEmptyET, 27*cfg.ui8_battery_cells_number, 33*cfg.ui8_battery_cells_number)) == null) {
showDialog(getString(R.string.cell_empty), getString(R.string.range_error, 27*cfg.ui8_battery_cells_number, 33*cfg.ui8_battery_cells_number));
if ((val = checkRange(binding.cellEmptyET, 250, 330)) == null) {
showDialog(getString(R.string.cell_empty), getString(R.string.range_error, 250, 330));
return;
}
cfg.ui8_li_io_cell_empty_x100 = val;

if ((val = checkRange(binding.cellOneBarET, 28*cfg.ui8_battery_cells_number, 34*cfg.ui8_battery_cells_number)) == null) {
showDialog(getString(R.string.cell_one_bar), getString(R.string.range_error, 28*cfg.ui8_battery_cells_number, 34*cfg.ui8_battery_cells_number));
if ((val = checkRange(binding.cellOneBarET, 250, 340)) == null) {
showDialog(getString(R.string.cell_one_bar), getString(R.string.range_error, 250, 340));
return;
}
cfg.ui8_li_io_cell_one_bar_x100 = val;

if ((val = checkRange(binding.cellAllBarsET, 38*cfg.ui8_battery_cells_number, 43*cfg.ui8_battery_cells_number)) == null) {
showDialog(getString(R.string.cell_all_bars), getString(R.string.range_error, 38*cfg.ui8_battery_cells_number, 43*cfg.ui8_battery_cells_number));
if ((val = checkRange(binding.cellAllBarsET, 370, 430)) == null) {
showDialog(getString(R.string.cell_all_bars), getString(R.string.range_error, 370, 430));
return;
}
cfg.ui8_li_io_cell_full_bars_x100 = val;
Expand Down

0 comments on commit 36a0016

Please sign in to comment.