Skip to content

Commit

Permalink
fix: use maximum brightness level for morse
Browse files Browse the repository at this point in the history
  • Loading branch information
cyb3rko authored and Niko Diamadis committed Nov 7, 2024
1 parent 861d666 commit 58b4a70
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,15 @@ class MainActivity : AppCompatActivity() {
lifecycleScope.launch(morseExceptionHandler) {
var lastLetter = Char.MIN_VALUE
val handler = MorseHandler { letter, code, delay, on ->
camera.setTorchMode(on)
if (on) {
if (maxLevel > 1) {
camera.sendLightLevel(this@MainActivity, -1, maxLevel)
} else {
camera.setTorchMode(true)
}
} else {
camera.setTorchMode(false)
}
if (vibrateMorse && on) Vibrator.vibrate(delay)

if (lastLetter != letter) {
Expand Down

0 comments on commit 58b4a70

Please sign in to comment.