companion9x compilation
This commit is contained in:
@@ -35,27 +35,22 @@
|
|||||||
|
|
||||||
void hapticOff()
|
void hapticOff()
|
||||||
{
|
{
|
||||||
#ifndef SIMU
|
|
||||||
PWM->PWM_DIS = PWM_DIS_CHID2 ; // Disable channel 2
|
PWM->PWM_DIS = PWM_DIS_CHID2 ; // Disable channel 2
|
||||||
PWM->PWM_OOV &= ~0x00040000 ; // Force low
|
PWM->PWM_OOV &= ~0x00040000 ; // Force low
|
||||||
PWM->PWM_OSS |= 0x00040000 ; // Force low
|
PWM->PWM_OSS |= 0x00040000 ; // Force low
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// pwmPercent 0-100
|
// pwmPercent 0-100
|
||||||
void hapticOn( uint32_t pwmPercent )
|
void hapticOn( uint32_t pwmPercent )
|
||||||
{
|
{
|
||||||
#ifndef SIMU
|
|
||||||
register Pwm *pwmptr ;
|
register Pwm *pwmptr ;
|
||||||
|
|
||||||
pwmptr = PWM ;
|
pwmptr = PWM ;
|
||||||
|
|
||||||
if ( pwmPercent > 100 )
|
if (pwmPercent > 100)
|
||||||
{
|
|
||||||
pwmPercent = 100 ;
|
pwmPercent = 100 ;
|
||||||
}
|
|
||||||
pwmptr->PWM_CH_NUM[2].PWM_CDTYUPD = pwmPercent ; // Duty
|
pwmptr->PWM_CH_NUM[2].PWM_CDTYUPD = pwmPercent ; // Duty
|
||||||
pwmptr->PWM_ENA = PWM_ENA_CHID2 ; // Enable channel 2
|
pwmptr->PWM_ENA = PWM_ENA_CHID2 ; // Enable channel 2
|
||||||
pwmptr->PWM_OSC = 0x00040000 ; // Enable output
|
pwmptr->PWM_OSC = 0x00040000 ; // Enable output
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user