changeset 227:763120534e54

src/condat2/com/src/driver/audio.c: make buzzer tones actually work
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 26 Oct 2016 02:45:19 +0000
parents 67fe1b3f4bd7
children d2cbdbffc528
files src/condat2/com/src/driver/audio.c
diffstat 1 files changed, 40 insertions(+), 42 deletions(-) [+]
line wrap: on
line diff
--- a/src/condat2/com/src/driver/audio.c	Mon Oct 24 08:39:11 2016 +0000
+++ b/src/condat2/com/src/driver/audio.c	Wed Oct 26 02:45:19 2016 +0000
@@ -333,15 +333,13 @@
 
 #endif /* (RIV_AUDIO) */
 
-
-extern  const T_DESCR The_Ale_is_dear[111];
-extern  const T_DESCR Danza_de_Astureses[21];
-extern  const T_DESCR rising_chromatic[47];
-extern  const T_DESCR rising_cscale[27];
-extern  const T_DESCR MELODY_ONE[11];
-extern  const T_DESCR MELODY_HELLO[23];
-extern  const T_DESCR bugle[39];
-
+/* Calypso buzzer timer load values corresponding to desired frequencies */
+#define	BUZ_425		59
+#define	BUZ_800		31
+#define	BUZ_900		27
+#define	BUZ_950		26
+#define	BUZ_1400	17
+#define	BUZ_1800	13
 
 /*
  * Tone generation tables
@@ -351,36 +349,36 @@
 //ct_ring will be used for all the ringing tones.
 //When the buzzer is not available,midi ringer will be used to play the ringing tones.
 static const T_DESCR ct_ring []  =   /* command 1     command 2      length     */
-                      {    800,          0,             TDMA_12,
-                           900,          0,             TDMA_12,
-                           800,          0,             TDMA_12,
-                           900,          0,             TDMA_12,
-                           800,          0,             TDMA_12,
-                           900,          0,             TDMA_12,
-                           800,          0,             TDMA_12,
-                           900,          0,             TDMA_12,
-                           800,          0,             TDMA_12,
-                           900,          0,             TDMA_12,
-                           800,          0,             TDMA_12,
-                           900,          0,             TDMA_12,
-                           800,          0,             TDMA_12,
-                           900,          0,             TDMA_12,
-                           800,          0,             TDMA_12,
-                           900,          0,             TDMA_12,
-                           800,          0,             TDMA_12,
-                           900,          0,             TDMA_12,
-                           800,          0,             TDMA_12,
-                           900,          0,             TDMA_12,
+                      {    BUZ_800,      0,             TDMA_12,
+                           BUZ_900,      0,             TDMA_12,
+                           BUZ_800,      0,             TDMA_12,
+                           BUZ_900,      0,             TDMA_12,
+                           BUZ_800,      0,             TDMA_12,
+                           BUZ_900,      0,             TDMA_12,
+                           BUZ_800,      0,             TDMA_12,
+                           BUZ_900,      0,             TDMA_12,
+                           BUZ_800,      0,             TDMA_12,
+                           BUZ_900,      0,             TDMA_12,
+                           BUZ_800,      0,             TDMA_12,
+                           BUZ_900,      0,             TDMA_12,
+                           BUZ_800,      0,             TDMA_12,
+                           BUZ_900,      0,             TDMA_12,
+                           BUZ_800,      0,             TDMA_12,
+                           BUZ_900,      0,             TDMA_12,
+                           BUZ_800,      0,             TDMA_12,
+                           BUZ_900,      0,             TDMA_12,
+                           BUZ_800,      0,             TDMA_12,
+                           BUZ_900,      0,             TDMA_12,
                            0,            0,             TDMA_866,
                            0xFFFF,       0xFFFF,        0
                       };
 
 #endif
 static const T_DESCR ct_auth_num [] =   /* command 1     command 2      length     */
-                      {    950,          0,             TDMA_71,
-                          1400,          0,             TDMA_71,
-                          1800,          0,             TDMA_71,
-                             0,          0,             TDMA_216,
+                      {    BUZ_950,      0,             TDMA_71,
+                           BUZ_1400,     0,             TDMA_71,
+                           BUZ_1800,     0,             TDMA_71,
+                           0,            0,             TDMA_216,
                            0xFFFF,       0xFFFF,        0
                       };
 
@@ -397,23 +395,23 @@
                       };
 
 static const T_DESCR ct_congest [] = /* command 1     command 2      length     */
-                      {    425,          0,             TDMA_43,
-                             0,          0,             TDMA_43,
+                      {    BUZ_425,      0,             TDMA_43,
+                           0,            0,             TDMA_43,
                            0xFFFF,       0xFFFF,        0
                       };
 
 static const T_DESCR ct_dropped [] = /* command 1     command 2      length     */
-                      {    425,          0,             TDMA_43,
-                             0,          0,             TDMA_43,
-                           425,          0,             TDMA_43,
-                             0,          0,             TDMA_43,
-                           425,          0,             TDMA_43,
-                             0,          0,             TDMA_43,
+                      {    BUZ_425,      0,             TDMA_43,
+                           0,            0,             TDMA_43,
+                           BUZ_425,      0,             TDMA_43,
+                           0,            0,             TDMA_43,
+                           BUZ_425,      0,             TDMA_43,
+                           0,            0,             TDMA_43,
                            0xFFFF,       0xFFFF,        0
                       };
 
 static const T_DESCR ct_ack []     = /* command 1     command 2      length     */
-                      {    425,          0,             TDMA_43,
+                      {    BUZ_425,      0,             TDMA_43,
                            0xFFFF,       0xFFFF,        0
                       };