changeset 272:edd8482a6576

buzzer driver: set ARMIO_LOAD_TIM to 0 on Pirelli target The Pirelli phone has its vibrator connected to Calypso BU output (no buzzer), and we need to set ARMIO_LOAD_TIM to 0 (instead of a tone frequency divisor for the buzzer) for correct operation of the vibrator.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 13 Jun 2021 18:43:36 +0000
parents d478d9ed1c3e
children 5caa86ee2cfa
files src/cs/drivers/drv_app/buzzer/buzzer.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/cs/drivers/drv_app/buzzer/buzzer.c	Sun Jun 13 18:35:26 2021 +0000
+++ b/src/cs/drivers/drv_app/buzzer/buzzer.c	Sun Jun 13 18:43:36 2021 +0000
@@ -17,6 +17,7 @@
 #include "timer/timer.h"
 
 #include "board.cfg"
+#include "fc-target.h"
 
 /*
  * Initialize buzzer
@@ -54,10 +55,14 @@
  */
 void BZ_Tone(int f)
 {
+  #ifdef CONFIG_TARGET_PIRELLI
+    f = 0;	/* vibrator instead of buzzer */
+  #else
     if (f > 255)
     {
         f = 255;
     }
+  #endif
   *((volatile SYS_UWORD16 *) ARMIO_LOAD_TIM) = f;
 }