FreeCalypso > hg > tcs211-l1-reconst
comparison chipsetsw/layer1/cfile/l1_func.c @ 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 |
comparison
equal
deleted
inserted
replaced
104:078763b12477 | 105:46b4a7ae4d58 |
---|---|
1104 { | 1104 { |
1105 IncMod(time->t2, 1, 26); // increment T2 % 26. | 1105 IncMod(time->t2, 1, 26); // increment T2 % 26. |
1106 IncMod(time->t3, 1, 51); // increment T3 % 51. | 1106 IncMod(time->t3, 1, 51); // increment T3 % 51. |
1107 IncMod(time->fn_mod42432, 1, 42432); // increment FN % 42432. | 1107 IncMod(time->fn_mod42432, 1, 42432); // increment FN % 42432. |
1108 IncMod(time->fn_mod13, 1, 13); // increment FN % 13. | 1108 IncMod(time->fn_mod13, 1, 13); // increment FN % 13. |
1109 IncMod(time->fn_mod13_mod4, 1, 4); // increment (FN % 13) % 4. | |
1110 if(time->fn_mod13 == 0) | |
1111 time->fn_mod13_mod4 = 0; | |
1112 | 1109 |
1113 if(time->t3 == 0) | 1110 if(time->t3 == 0) |
1114 // new FN is a multiple of 51. | 1111 // new FN is a multiple of 51. |
1115 { | 1112 { |
1116 // Increment TC ((FN/51) % 8). | 1113 // Increment TC ((FN/51) % 8). |
1121 } | 1118 } |
1122 | 1119 |
1123 #if (L1_GPRS) | 1120 #if (L1_GPRS) |
1124 IncMod(time->fn_mod52, 1, 52); // increment FN % 52. | 1121 IncMod(time->fn_mod52, 1, 52); // increment FN % 52. |
1125 IncMod(time->fn_mod104, 1, 104); // increment FN % 104. | 1122 IncMod(time->fn_mod104, 1, 104); // increment FN % 104. |
1123 | |
1124 IncMod(time->fn_mod13_mod4, 1, 4); // increment (FN % 13) % 4. | |
1125 if(time->fn_mod13 == 0) | |
1126 time->fn_mod13_mod4 = 0; | |
1126 | 1127 |
1127 if((time->fn_mod13 == 0) || (time->fn_mod13 == 4) || (time->fn_mod13 == 8)) | 1128 if((time->fn_mod13 == 0) || (time->fn_mod13 == 4) || (time->fn_mod13 == 8)) |
1128 IncMod(time->block_id, 1, MAX_BLOCK_ID); | 1129 IncMod(time->block_id, 1, MAX_BLOCK_ID); |
1129 #endif | 1130 #endif |
1130 | 1131 |
1138 time->t3 = time->fn % 51; // T3 = FN % 51. | 1139 time->t3 = time->fn % 51; // T3 = FN % 51. |
1139 time->t1 = time->fn / (26L*51L); // T1 = FN div 26*51 | 1140 time->t1 = time->fn / (26L*51L); // T1 = FN div 26*51 |
1140 time->tc = (time->fn / 51) % 8; // TC = (FN div 51) % 8 | 1141 time->tc = (time->fn / 51) % 8; // TC = (FN div 51) % 8 |
1141 time->fn_mod42432 = time->fn % 42432; // FN%42432. | 1142 time->fn_mod42432 = time->fn % 42432; // FN%42432. |
1142 time->fn_mod13 = time->fn % 13; // FN % 13. | 1143 time->fn_mod13 = time->fn % 13; // FN % 13. |
1143 time->fn_mod13_mod4 = time->fn_mod13 % 4; // FN % 13 % 4. | |
1144 | 1144 |
1145 #if (L1_GPRS) | 1145 #if (L1_GPRS) |
1146 time->fn_mod104 = time->fn % 104; // FN % 104. | 1146 time->fn_mod104 = time->fn % 104; // FN % 104. |
1147 | 1147 |
1148 if(time->fn_mod104 >= 52) // FN % 52. | 1148 if(time->fn_mod104 >= 52) // FN % 52. |
1149 time->fn_mod52 = time->fn_mod104 - 52; | 1149 time->fn_mod52 = time->fn_mod104 - 52; |
1150 else | 1150 else |
1151 time->fn_mod52 = time->fn_mod104; | 1151 time->fn_mod52 = time->fn_mod104; |
1152 | |
1153 time->fn_mod13_mod4 = time->fn_mod13 % 4; // FN % 13 % 4. | |
1152 | 1154 |
1153 time->block_id = ((3 * (time->fn / 13)) + (time->fn_mod13 / 4)); | 1155 time->block_id = ((3 * (time->fn / 13)) + (time->fn_mod13 / 4)); |
1154 #endif | 1156 #endif |
1155 | 1157 |
1156 } | 1158 } |