fatal: Finish StopSoundTask

This commit is contained in:
Michael Scire committed 2018-11-10 04:07:26 -08:00
1 parent f8abd2b402
commit 5d5f8ad3d5
1 file changed
+16 -1
+16 -1
View File
@@ -20,6 +20,7 @@
void StopSoundTask::StopSound() { void StopSoundTask::StopSound() {
/* Talk to the ALC5639 over I2C, and disable audio output. */ /* Talk to the ALC5639 over I2C, and disable audio output. */
{
I2cSession audio; I2cSession audio;
if (R_SUCCEEDED(i2cOpenSession(&audio, I2cDevice_AudioCodec))) { if (R_SUCCEEDED(i2cOpenSession(&audio, I2cDevice_AudioCodec))) {
struct { struct {
@@ -48,8 +49,22 @@ void StopSoundTask::StopSound() {
i2csessionClose(&audio); i2csessionClose(&audio);
} }
}
/* TODO: Talk to the ALC5639 over GPIO */ /* Talk to the ALC5639 over GPIO, and disable audio output */
{
GpioPadSession audio;
if (R_SUCCEEDED(gpioOpenSession(&audio, GpioPadName_AudioCodec))) {
/* Set direction output, sleep 200 ms so it can take effect. */
gpioPadSetDirection(&audio, GpioDirection_Output);
svcSleepThread(200000000UL);
/* Pull audio codec low. */
gpioPadSetValue(&audio, GpioValue_Low);
gpioPadClose(&audio);
}
}
} }
Result StopSoundTask::Run() { Result StopSoundTask::Run() {