/**************************************************************************** NAME configManagerButtonPatterns DESCRIPTION Read and configure any buttonpattern matches that exist RETURNS */ static void configManagerButtonPatterns( void ) { /* Allocate enough memory to hold event configuration */ button_pattern_config_type* config = (button_pattern_config_type*) mallocPanic(BM_NUM_BUTTON_MATCH_PATTERNS * sizeof(button_pattern_config_type)); CONF_DEBUG(("Co: No Button Patterns - %d\n", BM_NUM_BUTTON_MATCH_PATTERNS)); /* Now read in event configuration */ if(config) { if(ConfigRetrieve(theSink.config_id , PSKEY_BUTTON_PATTERN_CONFIG, config, BM_NUM_BUTTON_MATCH_PATTERNS * sizeof(button_pattern_config_type))) { uint16 n; /* Now we have the event configuration, map required events to system events */ for(n = 0; n < BM_NUM_BUTTON_MATCH_PATTERNS ; n++) { CONF_DEBUG(("Co : AddPattern Ev[%x]\n", config[n].event )) ; /* Map PIO button event to system events in specified states */ buttonManagerAddPatternMapping ( theSink.theButtonsTask , config[n].event , config[n].pattern, n ) ; } } else { CONF_DEBUG(("Co: !EvLen\n")) ; } freePanic(config) ; } }
/**************************************************************************** NAME configManagerButtonPatterns DESCRIPTION Read and configure any buttonpattern matches that exist RETURNS */ static void configManagerButtonPatterns( uint16 pConfigID ) { /* Allocate enough memory to hold event configuration */ button_pattern_config_type* config = (button_pattern_config_type*) mallocPanic(BM_NUM_BUTTON_MATCH_PATTERNS * sizeof(button_pattern_config_type)); CONF_DEBUG(("Co: No Button Patterns - %d\n", BM_NUM_BUTTON_MATCH_PATTERNS)); /* Now read in event configuration */ if(config) { if(ConfigRetrieve(pConfigID , PSKEY_BUTTON_PATTERN_CONFIG, config, BM_NUM_BUTTON_MATCH_PATTERNS * sizeof(button_pattern_config_type))) { uint16 n; /* Now we have the event configuration, map required events to system events */ for(n = 0; n < BM_NUM_BUTTON_MATCH_PATTERNS ; n++) { CONF_DEBUG(("Co : AddPattern Ev[%x]\n", config[n].event )) ; #ifdef BHC612 if(n == 0) { config[0].event = 0x6000; config[0].pattern[0] = 2;/*Vol - */ config[0].pattern[1] = 4;/*Talk*/ config[0].pattern[2] = 1;/*Vol +*/ config[0].pattern[3] = 6;/*Vol - & Talk*/ config[0].pattern[4] = 5;/*Vol + & Talk*/ config[0].pattern[5] = 2;/*Vol -*/ } #endif /* Map PIO button event to system events in specified states */ buttonManagerAddPatternMapping ( theHeadset.theButtonsTask , config[n].event , config[n].pattern, n ) ; } } else { CONF_DEBUG(("Co: !EvLen\n")) ; } free (config) ; } }