FreeCalypso > hg > fc-tourmaline
comparison src/ui/mfw/mfw_mme.c @ 287:3dee79757ae4
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.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Sat, 13 Nov 2021 03:20:57 +0000 |
parents | 3edd1a600218 |
children |
comparison
equal
deleted
inserted
replaced
286:ee16d57b32b2 | 287:3dee79757ae4 |
---|---|
108 */ | 108 */ |
109 | 109 |
110 #define ENTITY_MFW | 110 #define ENTITY_MFW |
111 | 111 |
112 #include <stdio.h> | 112 #include <stdio.h> |
113 #include <string.h> | |
113 | 114 |
114 #if defined (NEW_FRAME) | 115 #if defined (NEW_FRAME) |
115 | 116 |
116 #include "typedefs.h" | 117 #include "typedefs.h" |
117 #include "vsi.h" | 118 #include "vsi.h" |
141 #include "light.h" | 142 #include "light.h" |
142 #include "mfw_acie.h" | 143 #include "mfw_acie.h" |
143 #include "mfw_mme.h" | 144 #include "mfw_mme.h" |
144 #include "mfw_win.h" | 145 #include "mfw_win.h" |
145 #include "mfw_ffs.h" | 146 #include "mfw_ffs.h" |
147 | |
148 /* FreeCalypso additions */ | |
149 #include "rv/rv_general.h" | |
150 #include "audio/audio_api.h" | |
146 #include "fchg/fchg_api.h" | 151 #include "fchg/fchg_api.h" |
147 | 152 |
148 #define hCommPL _ENTITY_PREFIXED(hCommPL) | 153 #define hCommPL _ENTITY_PREFIXED(hCommPL) |
149 #define hCommACI _ENTITY_PREFIXED(hCommACI) | 154 #define hCommACI _ENTITY_PREFIXED(hCommACI) |
150 | 155 |
223 char aud_cg_file[5][15] = {"handheld","handheld","handfree","headset","carkit"}; | 228 char aud_cg_file[5][15] = {"handheld","handheld","handfree","headset","carkit"}; |
224 #endif | 229 #endif |
225 | 230 |
226 | 231 |
227 /* | 232 /* |
233 * The following function is a FreeCalypso addition, most likely temporary | |
234 * until we develop proper infrastructure for switching between different | |
235 * audio modes - for now we simply load the handheld mode on boot. | |
236 */ | |
237 static void | |
238 load_handheld_audio_mode(void) | |
239 { | |
240 extern void audio_riv_audio_cb (void*); | |
241 static T_RV_RETURN_PATH const riv_audio_rp = { | |
242 0, audio_riv_audio_cb | |
243 }; | |
244 T_AUDIO_MODE_LOAD load_param; | |
245 | |
246 strcpy(load_param.audio_mode_filename, "handheld"); | |
247 audio_mode_load(&load_param, riv_audio_rp); | |
248 } | |
249 | |
250 /* | |
228 +--------------------------------------------------------------------+ | 251 +--------------------------------------------------------------------+ |
229 | PROJECT : MMI-Framework (8417) MODULE : MFW_MME | | 252 | PROJECT : MMI-Framework (8417) MODULE : MFW_MME | |
230 | STATE : code ROUTINE : mmeInit | | 253 | STATE : code ROUTINE : mmeInit | |
231 +--------------------------------------------------------------------+ | 254 +--------------------------------------------------------------------+ |
232 PURPOSE : initialize equipment handler | 255 PURPOSE : initialize equipment handler |
270 #ifdef FF_MMI_AUDIO_PROFILE | 293 #ifdef FF_MMI_AUDIO_PROFILE |
271 audio_Init(audio_device_config); | 294 audio_Init(audio_device_config); |
272 #else | 295 #else |
273 audio_Init(hdsCb); //audio driver | 296 audio_Init(hdsCb); //audio driver |
274 #endif | 297 #endif |
298 load_handheld_audio_mode(); | |
275 | 299 |
276 /* a hack to get the initial battery state on boot */ | 300 /* a hack to get the initial battery state on boot */ |
277 pwrCb(FCHG_EVENT_DISCHARGE); | 301 pwrCb(FCHG_EVENT_DISCHARGE); |
278 | 302 |
279 mmeRxInfo(5,0); | 303 mmeRxInfo(5,0); |