|
|
|
@ -40,14 +40,14 @@ object SoundUtils {
|
|
|
|
|
if (soundPlaying) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
GPIOUtils.setGpioDirection(152, "out")
|
|
|
|
|
GPIOUtils.setGpioDirection(140, "out")
|
|
|
|
|
var gpioValue = 0
|
|
|
|
|
soundPlaying = true
|
|
|
|
|
GlobalScope.launch(Dispatchers.IO) {
|
|
|
|
|
while (soundPlaying) {
|
|
|
|
|
gpioValue = if (gpioValue > 0) 0 else 1
|
|
|
|
|
LogUtils.w("cyy gpioValue ${gpioValue}")
|
|
|
|
|
GPIOUtils.setGpioValue(152, gpioValue)
|
|
|
|
|
GPIOUtils.setGpioValue(140, gpioValue)
|
|
|
|
|
delay(500)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -55,6 +55,6 @@ object SoundUtils {
|
|
|
|
|
|
|
|
|
|
fun stopSoundIo() {
|
|
|
|
|
soundPlaying = false
|
|
|
|
|
GPIOUtils.setGpioValue(152, 0)
|
|
|
|
|
GPIOUtils.setGpioValue(140, 0)
|
|
|
|
|
}
|
|
|
|
|
}
|