예제 #1
0
/******************************************************************************
*   @name        Shell_decrease_volume
*
*   @brief       Servers the decrease volume command
*
*   @param       None
*
*   @return      None
*
******************************************************************************
* This function is used to decrease volume of the audio device
*****************************************************************************/
int32_t Shell_decrease_volume(int32_t argc,char *argv[])
{
    bool         print_usage = TRUE, shorthelp = FALSE;
    print_usage = Shell_check_help_request (argc, argv, &shorthelp);
    if (!print_usage)
    {
        if (argc > 1)
        {
            printf ("  Error: Channel parameter is too large\n");
            return (SHELL_EXIT_ERROR);
        }
        else
        {
            audio_decrease_volume_command();
        }
    }
    else
    {
        if (shorthelp)
        {
            printf("%s\n", argv[0]);
        }
        else
        {
            printf("Usage: %s\n", argv[0]);
        }
    }

    return(SHELL_EXIT_SUCCESS);
}
예제 #2
0
파일: sh_audio.c 프로젝트: BillyZhangZ/wifi
/******************************************************************************
*   @name        Shell_decrease_volume
*
*   @brief       Servers the decrease volume command
*
*   @param       None
*
*   @return      None
*
******************************************************************************
* This function is used to decrease volume of the audio device
*****************************************************************************/
int_32 Shell_decrease_volume(int_32 argc,char_ptr argv[])
{
    boolean         print_usage = TRUE, shorthelp = FALSE;
    volatile static uint_16         cur_volume, min_volume; 
    print_usage = Shell_check_help_request (argc, argv, &shorthelp);
    if (!print_usage)
    {
        if (argc > 1)
        {   
            printf ("  Error: Channel parameter is too large\n");
            return (SHELL_EXIT_ERROR);
        }  
        else
        {
            audio_decrease_volume_command();
        }
    }
    else
    {
        if (shorthelp)
        {
            printf("%s\n", argv[0]);
        }
        else
        {
            printf("Usage: %s\n", argv[0]);
        }
    }

    return(SHELL_EXIT_SUCCESS);
}
예제 #3
0
/*FUNCTION*----------------------------------------------------------------
*
* Function Name  : process_kbd_buffer
* Returned Value : None
* Comments       :
*      The way keyboard works is that it sends reports of 8 bytes of data
*      every time keys are pressed. However, it reports all the keys
*      that are pressed in a single report. The following code should
*      really be implemented by a user in the way he would like it to be.
*END*--------------------------------------------------------------------*/
void process_kbd_buffer(unsigned char *buffer)
{
    printf("\nprocess_kbd_buffer :%d\n",buffer[0]);
    if(4==buffer[0]) audio_mute_command();
    if(1==buffer[0]) audio_increase_volume_command();
    if(2==buffer[0]) audio_decrease_volume_command();
    //fflush(stdout);
}