Fix error state for stroboscope and SOS

This commit is contained in:
Ensar Sarajčić 2023-10-17 13:03:08 +02:00
parent b0ea8d8ef2
commit 18c8bf3c7a

View File

@ -272,12 +272,12 @@ class MyCameraImpl private constructor(private val context: Context, private var
handleCameraSetup()
while (!shouldStroboscopeStop) {
try {
cameraFlash.runOrToast {
cameraFlash!!.run {
toggleFlashlight(true)
}
val onDuration = if (isStroboSOS) SOS[sosIndex++ % SOS.size] else stroboFrequency
Thread.sleep(onDuration)
cameraFlash.runOrToast {
cameraFlash!!.run {
toggleFlashlight(false)
}
val offDuration = if (isStroboSOS) SOS[sosIndex++ % SOS.size] else stroboFrequency