From 6e2cb723ea2d5c9bf20581f3f841193f1bd2e910 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Fri, 20 Nov 2020 07:51:25 +0800 Subject: [PATCH] 1.1.9 spiffs firmware update seems to work --- app/build.gradle | 6 +++--- .../com/geeksville/mesh/service/SoftwareUpdateService.kt | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9e3aa28ca..8341bb9d9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -25,13 +25,13 @@ android { } } */ compileSdkVersion 29 - buildToolsVersion "30.0.1" // Note: 30.0.0.2 doesn't yet work on Github actions CI + buildToolsVersion "30.0.2" // Note: 30.0.0.2 doesn't yet work on Github actions CI defaultConfig { applicationId "com.geeksville.mesh" minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works) targetSdkVersion 29 - versionCode 20108 // format is Mmmss (where M is 1+the numeric major number - versionName "1.1.8" + versionCode 20109 // format is Mmmss (where M is 1+the numeric major number + versionName "1.1.9" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { diff --git a/app/src/main/java/com/geeksville/mesh/service/SoftwareUpdateService.kt b/app/src/main/java/com/geeksville/mesh/service/SoftwareUpdateService.kt index 88d3beb6b..5a4fe4b39 100644 --- a/app/src/main/java/com/geeksville/mesh/service/SoftwareUpdateService.kt +++ b/app/src/main/java/com/geeksville/mesh/service/SoftwareUpdateService.kt @@ -349,7 +349,11 @@ class SoftwareUpdateService : JobIntentService(), Logging { // Send all the blocks while (firmwareNumSent < firmwareSize) { - progress = firmwareNumSent * 100 / firmwareSize + // If we are doing the spiffs partition, we limit progress to a max of 50%, so that the user doesn't think we are done + // yet + val maxProgress = if(flashRegion != FLASH_REGION_APPLOAD) + 50 else 100 + progress = firmwareNumSent * maxProgress / firmwareSize debug("sending block ${progress}%") var blockSize = 512 - 3 // Max size MTU excluding framing