Major patch to split haptic and audio queues into separate systems.

Patch is testing and working on the sky9xboard and the stock board.  I dont have a gruvin board to test on.

Currently only events that trigger haptic alerts are WARNING1-3 and TRIM MIDDLE.  

Next step is for bertrand to use the hooks to enable a per alert option to choose enable haptic.

Also... translations are added but the menu file does not use the translation yet - as I have not got my head round how this works!
This commit is contained in:
rob@marotori.com
2012-04-13 12:22:04 +00:00
parent f59d7a3836
commit f7b1754257
12 changed files with 106 additions and 183 deletions
-39
View File
@@ -423,42 +423,3 @@ extern "C" void TWI0_IRQHandler()
}
}
//void audioDefevent(uint8_t e)
//{
// if ( g_eeGeneral.speakerMode == 0 )
// {
// buzzer_sound( 4 ) ;
// }
// else if ( g_eeGeneral.speakerMode == 1 )
// {
//// tone_start( 50 ) ;
// playTone( 2000, 60 ) ; // 2KHz, 60mS
// }
//// audio.event(e,BEEP_DEFAULT_FREQ);
//}
void hapticOff()
{
PWM->PWM_DIS = PWM_DIS_CHID2 ; // Disable channel 2
PWM->PWM_OOV &= ~0x00040000 ; // Force low
PWM->PWM_OSS |= 0x00040000 ; // Force low
}
// pwmPercent 0-100
void hapticOn( uint32_t pwmPercent )
{
register Pwm *pwmptr ;
pwmptr = PWM ;
if ( pwmPercent > 100 )
{
pwmPercent = 100 ;
}
pwmptr->PWM_CH_NUM[2].PWM_CDTYUPD = pwmPercent ; // Duty
pwmptr->PWM_ENA = PWM_ENA_CHID2 ; // Enable channel 2
pwmptr->PWM_OSC = 0x00040000 ; // Enable output
}
-2
View File
@@ -55,8 +55,6 @@ extern void init_twi( void ) ;
extern void set_volume( register uint8_t volume ) ;
extern "C" void TWI0_IRQHandler (void) ;
extern void audioDefevent( uint8_t e ) ;
extern void hapticOff(void) ;
extern void hapticOn( uint32_t pwmPercent ) ;
extern void sound_5ms( void ) ;