From 8a34c2d51ef47b4a3ea92ba0a18e2b0f3d038b79 Mon Sep 17 00:00:00 2001 From: bsongis Date: Tue, 26 Jun 2012 12:39:22 +0000 Subject: [PATCH] companion9x compilation --- src/ersky9x/haptic_driver.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/ersky9x/haptic_driver.cpp b/src/ersky9x/haptic_driver.cpp index 419d201cc..3a5d2b92e 100644 --- a/src/ersky9x/haptic_driver.cpp +++ b/src/ersky9x/haptic_driver.cpp @@ -35,27 +35,22 @@ void hapticOff() { -#ifndef SIMU PWM->PWM_DIS = PWM_DIS_CHID2 ; // Disable channel 2 PWM->PWM_OOV &= ~0x00040000 ; // Force low PWM->PWM_OSS |= 0x00040000 ; // Force low -#endif } // pwmPercent 0-100 void hapticOn( uint32_t pwmPercent ) { -#ifndef SIMU register Pwm *pwmptr ; pwmptr = PWM ; - if ( pwmPercent > 100 ) - { + 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 -#endif }