From 7d9cd8c869efc4c68cd4cf448065a35f19cb9b82 Mon Sep 17 00:00:00 2001 From: bsongis Date: Tue, 14 Jul 2015 19:15:53 +0200 Subject: [PATCH] [Taranis X9E] A little vibration on startup / shutdown to wake the user up --- radio/src/opentx.cpp | 1 + radio/src/targets/sky9x/haptic_driver.cpp | 3 ++- radio/src/targets/taranis/board_taranis.cpp | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 5811c76a5..67e6d501f 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -2664,6 +2664,7 @@ uint32_t pwrCheck() } } #else + haptic.play(15, 3, PLAY_NOW); pwr_check_state = PWR_CHECK_OFF; return e_power_off; #endif diff --git a/radio/src/targets/sky9x/haptic_driver.cpp b/radio/src/targets/sky9x/haptic_driver.cpp index 729feec11..753948ffb 100644 --- a/radio/src/targets/sky9x/haptic_driver.cpp +++ b/radio/src/targets/sky9x/haptic_driver.cpp @@ -50,8 +50,9 @@ void hapticOn( uint32_t pwmPercent ) 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 diff --git a/radio/src/targets/taranis/board_taranis.cpp b/radio/src/targets/taranis/board_taranis.cpp index 500297a4a..518e466ee 100644 --- a/radio/src/targets/taranis/board_taranis.cpp +++ b/radio/src/targets/taranis/board_taranis.cpp @@ -183,8 +183,9 @@ void boardInit() } else { if (pwr_on != 1) { - backlightInit(); pwr_on = 1; + backlightInit(); + haptic.play(15, 3, PLAY_NOW); } } lcdRefresh();