forked from len0rd/rockbox
Onda VX747:
* Add speaker en-/disable driver * Add apps/ setting to en-/disable the speaker git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20174 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
69ffd7c84f
commit
6c252a6751
8 changed files with 87 additions and 0 deletions
|
@ -12401,3 +12401,17 @@
|
|||
*: "As whole numbers"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_ENABLE_SPEAKER
|
||||
desc: in Settings -> Sound Settings
|
||||
user:
|
||||
<source>
|
||||
*: "Enable Speaker"
|
||||
</source>
|
||||
<dest>
|
||||
*: "Enable Speaker"
|
||||
</dest>
|
||||
<voice>
|
||||
*: "Enable Speaker"
|
||||
</voice>
|
||||
</phrase>
|
||||
|
|
|
@ -12288,3 +12288,17 @@
|
|||
serial_port: "Automatisch"
|
||||
</voice>
|
||||
</phrase>
|
||||
<phrase>
|
||||
id: LANG_ENABLE_SPEAKER
|
||||
desc: in Settings -> Sound Settings
|
||||
user:
|
||||
<source>
|
||||
*: "Enable Speaker"
|
||||
</source>
|
||||
<dest>
|
||||
*: "Luidspreker inschakelen"
|
||||
</dest>
|
||||
<voice>
|
||||
*: "Luidspreker inschakelen"
|
||||
</voice>
|
||||
</phrase>
|
||||
|
|
|
@ -102,6 +102,10 @@ MENUITEM_SETTING(stereo_width, &global_settings.stereo_width,
|
|||
MENUITEM_SETTING(mdb_shape, &global_settings.mdb_shape, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SPEAKER
|
||||
MENUITEM_SETTING(speaker_enabled, &global_settings.speaker_enabled, NULL);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
|
||||
|
@ -121,6 +125,9 @@ MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
|
|||
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
|
||||
,&loudness,&avc,&superbass,&mdb_enable,&mdb_strength
|
||||
,&mdb_harmonics,&mdb_center,&mdb_shape
|
||||
#endif
|
||||
#ifdef HAVE_SPEAKER
|
||||
,&speaker_enabled
|
||||
#endif
|
||||
);
|
||||
|
||||
|
|
|
@ -806,6 +806,10 @@ void settings_apply(bool read_disk)
|
|||
global_settings.peak_meter_clip_hold);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SPEAKER
|
||||
audiohw_enable_speaker(global_settings.speaker_enabled);
|
||||
#endif
|
||||
|
||||
if (read_disk)
|
||||
{
|
||||
|
||||
|
|
|
@ -730,6 +730,10 @@ struct user_settings
|
|||
bool accessory_supply; /* 0=off 1=on, accessory power supply for iPod */
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SPEAKER
|
||||
bool speaker_enabled;
|
||||
#endif
|
||||
|
||||
/* If values are just added to the end, no need to bump plugin API
|
||||
version. */
|
||||
/* new stuff to be added at the end */
|
||||
|
|
|
@ -1458,6 +1458,10 @@ const struct settings_list settings[] = {
|
|||
qs_load_from_cfg, qs_write_to_cfg,
|
||||
qs_is_changed, qs_set_default),
|
||||
#endif
|
||||
#ifdef HAVE_SPEAKER
|
||||
OFFON_SETTING(0, speaker_enabled, LANG_ENABLE_SPEAKER, false, "speaker",
|
||||
audiohw_enable_speaker),
|
||||
#endif
|
||||
};
|
||||
|
||||
const int nb_settings = sizeof(settings)/sizeof(*settings);
|
||||
|
|
|
@ -305,4 +305,10 @@ void audiohw_set_stereo_width(int val);
|
|||
|
||||
#endif /* CONFIG_CODEC != SWCODEC */
|
||||
|
||||
#ifdef HAVE_SPEAKER
|
||||
|
||||
void audiohw_enable_speaker(bool on);
|
||||
|
||||
#endif /* HAVE_SPEAKER */
|
||||
|
||||
#endif /* _AUDIOHW_H_ */
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2009 by Maurus Cuelenaere
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#include "config.h"
|
||||
#include "jz4740.h"
|
||||
#include "audiohw.h"
|
||||
|
||||
#define SPEAKER_PIN (32*2 + 27)
|
||||
|
||||
void audiohw_enable_speaker(bool on)
|
||||
{
|
||||
__gpio_as_output(SPEAKER_PIN);
|
||||
if(on)
|
||||
__gpio_set_pin(SPEAKER_PIN);
|
||||
else
|
||||
__gpio_clear_pin(SPEAKER_PIN);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue