less logspam

This commit is contained in:
Kevin Hester 2021-03-23 13:05:50 +08:00
parent 278d82e99a
commit 518241c3c9
2 changed files with 7 additions and 3 deletions

View file

@ -374,13 +374,17 @@ class SoftwareUpdateService : JobIntentService(), Logging {
throw DeviceRejectedException()
// Send all the blocks
var oldProgress = -1 // used to limit # of log spam
while (firmwareNumSent < 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
sendProgress(context, firmwareNumSent * maxProgress / firmwareSize, isAppload)
debug("sending block ${progress}%")
if(progress != oldProgress) {
debug("sending block ${progress}%")
oldProgress = progress;
}
var blockSize = 512 - 3 // Max size MTU excluding framing
if (blockSize > firmwareStream.available())