changeset 268:67b777cee725

l1audio_sync.c: l1s_audio_manager() reconstructed
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 13 Mar 2017 05:53:30 +0000
parents 8d577190e377
children b6aef2688d6c
files chipsetsw/layer1/audio_cfile/l1audio_sync.c
diffstat 1 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/audio_cfile/l1audio_sync.c	Mon Mar 13 04:48:37 2017 +0000
+++ b/chipsetsw/layer1/audio_cfile/l1audio_sync.c	Mon Mar 13 05:53:30 2017 +0000
@@ -386,6 +386,8 @@
     #endif
 
     #if (MELODY_E1)
+    /* FreeCalypso: reconstructed from TCS211 object */
+    if (l1s.melody_e2.dsp_task == FALSE) {
       // the melody0 task is activated?
       if ((l1a_l1s_com.melody0_task.command.start) ||
           (l1s.audio_state[L1S_MELODY0_STATE] != 0))
@@ -400,6 +402,7 @@
         l1s_melody1_manager();
         l1_audio_it_com = TRUE;
       }
+    }
     #endif
     #if (VOICE_MEMO)
       // the voicememo playing task is activated?
@@ -593,13 +596,18 @@
         {
           // The 2 melodies are stopped therefore the DSP must be
           // stopped so the bit B_MELO must be reset.
-          l1s_dsp_com.dsp_ndb_ptr->d_melody_selection = MELODY_E2_SELECTED;
-          l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (B_MELO | B_TONE);
-
-          // Reset the flag to know if the DSP melody E2 task runs
-          l1s.melody_e2.dsp_task = FALSE;
-
-          l1_audio_it_com = TRUE;
+
+	  /* FreeCalypso TCS211 reconstruction from disassembly */
+	  if (l1s_dsp_com.dsp_ndb_ptr->d_toneskb_status & (B_MELO | B_TONE)) {
+	    if (!(l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init & (B_MELO|B_TONE))) {
+              l1s_dsp_com.dsp_ndb_ptr->d_melody_selection = MELODY_E2_SELECTED;
+              l1s_dsp_com.dsp_ndb_ptr->d_toneskb_init |= (B_MELO | B_TONE);
+	    }
+            l1_audio_it_com = TRUE;
+	  } else {
+            l1s.melody_e2.dsp_task = FALSE;
+	  }
+	  /* end of reconstructed section */
         }
       }