# HG changeset patch # User Mychaela Falconia # Date 1636773657 0 # Node ID 3dee79757ae4f2bb608ce1b62b76e8d9dda205db # Parent ee16d57b32b24f8cda8fe1f69a532b09372bdff3 UI fw: load handheld audio mode on boot We have now reached the point where use of audio mode config files should be considered mandatory. In ACI usage we can tell users that they need to perform an AT@AUL of some appropriate audio mode, but in UI-enabled fw we really need to have the firmware load audio modes on its own, so that correct audio config gets established when the handset or development board runs on its own, without a connected host computer. Once have FC Venus with both main and headset audio channels and headset plug insertion detection, our fw will need to automatically load the handheld mode or the headset mode depending on the plug insertion state. For now we load only the handheld mode, which has been tuned for FC-HDS4 on FC Luna. diff -r ee16d57b32b2 -r 3dee79757ae4 src/ui/mfw/mfw_mme.c --- a/src/ui/mfw/mfw_mme.c Tue Nov 09 02:16:59 2021 +0000 +++ b/src/ui/mfw/mfw_mme.c Sat Nov 13 03:20:57 2021 +0000 @@ -110,6 +110,7 @@ #define ENTITY_MFW #include +#include #if defined (NEW_FRAME) @@ -143,6 +144,10 @@ #include "mfw_mme.h" #include "mfw_win.h" #include "mfw_ffs.h" + +/* FreeCalypso additions */ +#include "rv/rv_general.h" +#include "audio/audio_api.h" #include "fchg/fchg_api.h" #define hCommPL _ENTITY_PREFIXED(hCommPL) @@ -225,6 +230,24 @@ /* + * The following function is a FreeCalypso addition, most likely temporary + * until we develop proper infrastructure for switching between different + * audio modes - for now we simply load the handheld mode on boot. + */ +static void +load_handheld_audio_mode(void) +{ + extern void audio_riv_audio_cb (void*); + static T_RV_RETURN_PATH const riv_audio_rp = { + 0, audio_riv_audio_cb + }; + T_AUDIO_MODE_LOAD load_param; + + strcpy(load_param.audio_mode_filename, "handheld"); + audio_mode_load(&load_param, riv_audio_rp); +} + +/* +--------------------------------------------------------------------+ | PROJECT : MMI-Framework (8417) MODULE : MFW_MME | | STATE : code ROUTINE : mmeInit | @@ -272,6 +295,7 @@ #else audio_Init(hdsCb); //audio driver #endif + load_handheld_audio_mode(); /* a hack to get the initial battery state on boot */ pwrCb(FCHG_EVENT_DISCHARGE);