view src/cs/services/audio/audio_vm.c @ 629:3231dd9b38c1

armio.c: make GPIOs 8 & 13 outputs driving 1 on all "classic" targets Calypso GPIOs 8 & 13 are pinmuxed with MCUEN1 & MCUEN2, respectively, and on powerup these pins are MCUEN, i.e., outputs driving 1. TI's code for C-Sample and earlier turns them into GPIOs configured as outputs also driving 1 - so far, so good - but TI's code for BOARD 41 (which covers D-Sample, Leonardo and all real world Calypso devices derived from the latter) switches them from MCUEN to GPIOs, but then leaves them as inputs. Given that the hardware powerup state of these two pins is outputs driving 1, every Calypso board design MUST be compatible with such driving; typically these GPIO signals will be either unused and unconnected or connected as outputs driving some peripheral. Turning these pins into GPIO inputs will result in floating inputs on every reasonably-wired board, thus I am convinced that this configuration is nothing but a bug on the part of whoever wrote this code at TI. This floating input bug had already been fixed earlier for GTA modem and FCDEV3B targets; the present change makes the fix unconditional for all "classic" targets. The newly affected targets are D-Sample, Leonardo, Tango and GTM900.
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 02 Jan 2020 05:38:26 +0000
parents 838eeafb0051
children
line wrap: on
line source

/****************************************************************************/
/*                                                                          */
/*  File Name:  audio_vm.c			                                        */
/*                                                                          */
/*  Purpose:  This file contains all the functions used to manage the       */
/*            Voice Memorization .                                          */
/*                                                                          */
/*  Version   0.1                                                           */
/*                                                                          */
/*  Date        Modification                                                */
/*  ------------------------------------                                    */
/*  2 August 2001 Create                                                    */
/*                                                                          */
/*  Author                                                                  */
/*     Stephanie Gerthoux                                                   */
/*                                                                          */
/* (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved*/
/****************************************************************************/

#include "rv/rv_defined_swe.h"
#ifdef RVM_AUDIO_MAIN_SWE
  #ifndef _WINDOWS
    #include "config/swconfig.cfg"
    #include "config/sys.cfg"
    #include "config/chipset.cfg"
  #endif

  /* include the usefull L1 header */
  #include "l1_confg.h"

  #if (VOICE_MEMO)
  #include "rv/rv_general.h"
  #include "rvm/rvm_gen.h"
  #include "audio/audio_ffs_i.h"
  #include "audio/audio_api.h"
  #include "audio/audio_structs_i.h"
  #include "audio/audio_var_i.h"
  #include "audio/audio_messages_i.h"
  #include "rvf/rvf_target.h"
  #include "audio/audio_const_i.h"
  #include "audio/audio_error_hdlr_i.h"

  /* include the usefull L1 header */
  #define BOOL_FLAG
  #define CHAR_FLAG
  #include "l1_types.h"
  #include "l1audio_cust.h"
  #include "l1audio_msgty.h"
  #include "l1audio_signa.h"

  /********************************************************************************/
  /*                                                                              */
  /*    Function Name:   audio_voice_memo_message_switch	                      */
  /*                                                                              */
  /*    Purpose:  Manage the message supply between the vice memo play and the    */
  /*              voice memo record                                               */
  /*                                                                              */
  /*    Input Parameters:                                                         */
  /*        start or stop message from the voice memo features                    */
  /*                                                                              */
  /*    Output Parameters:                                                        */
  /*        index of the manager                                                  */
  /*                                                                              */
  /*    Note:                                                                     */
  /*        None.                                                                 */
  /*                                                                              */
  /*    Revision History:                                                         */
  /*        None.                                                                 */
  /*                                                                              */
  /********************************************************************************/
  UINT8 audio_voice_memo_message_switch (T_RV_HDR *p_message)
  {
    switch (p_message->msg_id)
    {
      case AUDIO_FFS_INIT_DONE:
      {
        /* The FFS message is from the voice memo play */
        if ( ((T_AUDIO_FFS_INIT *)p_message)->session_id == AUDIO_FFS_SESSION_VM_PLAY )
        {
          return(AUDIO_VM_PLAY);
        }
        /* The FFS message is from the voice memo record */
        if ( ((T_AUDIO_FFS_INIT *)p_message)->session_id == AUDIO_FFS_SESSION_VM_RECORD )
        {
          return(AUDIO_VM_RECORD);
        }
        return(AUDIO_VM_NONE);
      }
      case AUDIO_FFS_STOP_CON:
      {
        /* The FFS message is from the voice memo play*/
        if ( ((T_AUDIO_FFS_STOP_REQ *)p_message)->session_id == AUDIO_FFS_SESSION_VM_PLAY )
        {
          return(AUDIO_VM_PLAY);
        }
        /* The FFS message is from the voice memo record */
        if ( ((T_AUDIO_FFS_STOP_REQ *)p_message)->session_id == AUDIO_FFS_SESSION_VM_RECORD )
        {
          return(AUDIO_VM_RECORD);
        }
        return(AUDIO_VM_NONE);
      }
      case AUDIO_VM_PLAY_START_REQ:
      case AUDIO_VM_PLAY_STOP_REQ:
      case MMI_VM_PLAY_START_CON:
      case MMI_VM_PLAY_STOP_CON:
      {
        return(AUDIO_VM_PLAY);
      }
      case AUDIO_VM_RECORD_START_REQ:
      case AUDIO_VM_RECORD_STOP_REQ:
      case MMI_VM_RECORD_START_CON:
      case MMI_VM_RECORD_STOP_CON:
      {
        return(AUDIO_VM_RECORD);
      }
      default:
      {
        return(AUDIO_VM_NONE);
        break;
      }

    } /* switch */
  }

  #endif /* VOICE_MEMO */
#endif /* RVM_AUDIO_MAIN_SWE */