From b67d42a9d08bad7b9e4fbb027864e7bcb741d988 Mon Sep 17 00:00:00 2001 From: Mikkel-T Date: Wed, 19 Oct 2022 16:15:29 +0200 Subject: [PATCH] Fix SOS timing Changes the SOS timing to use the lengths as described here: https://en.wikipedia.org/wiki/Morse_code#Representation,_timing,_and_speeds Also change the unit to 200 instead of 250 --- .../com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt index 6ee4288..ee77902 100644 --- a/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt +++ b/app/src/main/kotlin/com/simplemobiletools/flashlight/helpers/MyCameraImpl.kt @@ -19,7 +19,9 @@ class MyCameraImpl(val context: Context) { companion object { var isFlashlightOn = false - private val SOS = arrayListOf(250L, 250L, 250L, 250L, 250L, 250L, 500L, 250L, 500L, 250L, 500L, 250L, 250L, 250L, 250L, 250L, 250L, 1000L) + + private var u = 200L // The length of one dit (Time unit) + private val SOS = arrayListOf(u, u, u, u, u, u * 3, u * 3, u, u * 3, u, u * 3, u * 3, u, u, u, u, u, u * 7) private var camera: Camera? = null private var params: Camera.Parameters? = null