changeset 105:46b4a7ae4d58

l1_func.c: l1s_increment_time() reconstructed
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Fri, 08 Apr 2016 03:32:38 +0000
parents 078763b12477
children c768c181ece8
files chipsetsw/layer1/cfile/l1_func.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/chipsetsw/layer1/cfile/l1_func.c	Fri Apr 08 03:08:34 2016 +0000
+++ b/chipsetsw/layer1/cfile/l1_func.c	Fri Apr 08 03:32:38 2016 +0000
@@ -1106,9 +1106,6 @@
     IncMod(time->t3, 1, 51);                // increment T3 % 51.
     IncMod(time->fn_mod42432, 1, 42432);    // increment FN % 42432.
     IncMod(time->fn_mod13, 1, 13);          // increment FN % 13.
-    IncMod(time->fn_mod13_mod4, 1, 4);      // increment (FN % 13) % 4.
-    if(time->fn_mod13 == 0)
-      time->fn_mod13_mod4 = 0;
 
     if(time->t3 == 0)
     // new FN is a multiple of 51.
@@ -1124,6 +1121,10 @@
       IncMod(time->fn_mod52, 1, 52);        // increment FN % 52.
       IncMod(time->fn_mod104, 1, 104);      // increment FN % 104.
 
+      IncMod(time->fn_mod13_mod4, 1, 4);      // increment (FN % 13) % 4.
+      if(time->fn_mod13 == 0)
+        time->fn_mod13_mod4 = 0;
+
       if((time->fn_mod13 == 0) || (time->fn_mod13 == 4) || (time->fn_mod13 == 8))
         IncMod(time->block_id, 1, MAX_BLOCK_ID);
     #endif
@@ -1140,7 +1141,6 @@
     time->tc = (time->fn / 51) % 8;        // TC = (FN div 51) % 8
     time->fn_mod42432 = time->fn % 42432;  // FN%42432.
     time->fn_mod13    = time->fn % 13;     // FN % 13.
-    time->fn_mod13_mod4 = time->fn_mod13 % 4; // FN % 13 % 4.
 
     #if (L1_GPRS)
       time->fn_mod104     = time->fn % 104;     // FN % 104.
@@ -1150,6 +1150,8 @@
       else
         time->fn_mod52    = time->fn_mod104;
 
+      time->fn_mod13_mod4 = time->fn_mod13 % 4; // FN % 13 % 4.
+
       time->block_id      = ((3 * (time->fn / 13)) + (time->fn_mod13 / 4));
     #endif