Skip to content

Commit

Permalink
Disable speaker when not used
Browse files Browse the repository at this point in the history
  • Loading branch information
AEFeinstein committed Oct 28, 2024
1 parent 9c76c37 commit 289884a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions main/modes/games/ultimateTTT/ultimateTTT.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ ultimateTTT_t* ttt;
*/
static void tttEnterMode(void)
{
// TODO enable speaker if BGM is added
setDacShutdown(true);

// Allocate memory for the mode
ttt = calloc(1, sizeof(ultimateTTT_t));

Expand Down
3 changes: 3 additions & 0 deletions main/modes/utilities/dance/dance.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ danceMode_t* danceState;
*/
void danceEnterMode(void)
{
// No speaker output for LEDs!
setDacShutdown(true);

danceState = calloc(1, sizeof(danceMode_t));

danceState->danceIdx = 0;
Expand Down
3 changes: 3 additions & 0 deletions main/modes/utilities/gamepad/gamepad.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ static const tinyusb_config_t ns_tusb_cfg = {
*/
void gamepadEnterMode(void)
{
// Disable speaker for gamepad
setDacShutdown(true);

// Allocate and zero memory
gamepad = (gamepad_t*)calloc(1, sizeof(gamepad_t));

Expand Down
3 changes: 3 additions & 0 deletions main/modes/utilities/timer/modeTimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ static timerMode_t* timerData = NULL;

static void timerEnterMode(void)
{
// Disable speaker for timer
setDacShutdown(true);

timerData = calloc(1, sizeof(timerMode_t));

loadFont("ibm_vga8.font", &timerData->textFont, false);
Expand Down

0 comments on commit 289884a

Please sign in to comment.