comparison src/cs/drivers/drv_app/buzzer/buzzer.c @ 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
comparison
equal deleted inserted replaced
271:d478d9ed1c3e 272:edd8482a6576
15 #include "armio/armio.h" 15 #include "armio/armio.h"
16 #include "buzzer.h" 16 #include "buzzer.h"
17 #include "timer/timer.h" 17 #include "timer/timer.h"
18 18
19 #include "board.cfg" 19 #include "board.cfg"
20 #include "fc-target.h"
20 21
21 /* 22 /*
22 * Initialize buzzer 23 * Initialize buzzer
23 * 24 *
24 */ 25 */
52 * 53 *
53 * 54 *
54 */ 55 */
55 void BZ_Tone(int f) 56 void BZ_Tone(int f)
56 { 57 {
58 #ifdef CONFIG_TARGET_PIRELLI
59 f = 0; /* vibrator instead of buzzer */
60 #else
57 if (f > 255) 61 if (f > 255)
58 { 62 {
59 f = 255; 63 f = 255;
60 } 64 }
65 #endif
61 *((volatile SYS_UWORD16 *) ARMIO_LOAD_TIM) = f; 66 *((volatile SYS_UWORD16 *) ARMIO_LOAD_TIM) = f;
62 } 67 }
63 68
64 /* 69 /*
65 * BZ_Volume 70 * BZ_Volume