Skip to content

Commit

Permalink
Improved SecureDFUService performance
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Dec 7, 2018
1 parent deb5cfc commit 38fa34a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/NordicDFU/SecureDFUService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ internal extension SecureDFUService {
while self.controlPoint.checksum(for: UInt32(writtenBytes)) == nil {

// wait for PRN
sleep(1)
usleep(100)
}

packetsSincePRN = 0
Expand Down Expand Up @@ -255,7 +255,7 @@ internal extension SecureDFUService {
}

private func notification(_ notification: ErrorValue<SecureDFUControlPoint>) {

self.notifications.append(Notification(value: notification))
}

Expand Down Expand Up @@ -307,7 +307,7 @@ internal extension SecureDFUService {

// get notification response
guard let notification = newNotifications.first
else { sleep(1); continue }
else { usleep(100); continue }

return try notification.response()

Expand Down

0 comments on commit 38fa34a

Please sign in to comment.