Skip to content

Commit 38fa34a

Browse files
committed
Improved SecureDFUService performance
1 parent deb5cfc commit 38fa34a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Sources/NordicDFU/SecureDFUService.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ internal extension SecureDFUService {
129129
while self.controlPoint.checksum(for: UInt32(writtenBytes)) == nil {
130130

131131
// wait for PRN
132-
sleep(1)
132+
usleep(100)
133133
}
134134

135135
packetsSincePRN = 0
@@ -255,7 +255,7 @@ internal extension SecureDFUService {
255255
}
256256

257257
private func notification(_ notification: ErrorValue<SecureDFUControlPoint>) {
258-
258+
259259
self.notifications.append(Notification(value: notification))
260260
}
261261

@@ -307,7 +307,7 @@ internal extension SecureDFUService {
307307

308308
// get notification response
309309
guard let notification = newNotifications.first
310-
else { sleep(1); continue }
310+
else { usleep(100); continue }
311311

312312
return try notification.response()
313313

0 commit comments

Comments
 (0)