Changeset 1287 for trunk/csctapi/pps.c


Ignore:
Timestamp:
01/19/10 12:33:23 (11 years ago)
Author:
dingo35
Message:

Small optimizations in T1 timing parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/csctapi/pps.c

    r1286 r1287  
    499499    unsigned long baudrate;
    500500    double work_etu;
    501     int i;
    502501
    503502    // Set IFSC
     
    527526        {
    528527            cwi = tb & 0x0F;
    529             bwi = (tb & 0xF0) >> 4;
     528            bwi = tb >> 4;
    530529        }
    531530#endif
     
    536535
    537536    // Set CWT = (2^CWI + 11) work etu
    538     cwt = 1;
    539 
    540     for (i = 0; i < cwi ; i++)
    541         cwt *= 2;
    542 
    543     cwt = (unsigned short) ((cwt + 11) * work_etu);
     537    cwt = (unsigned short) (((1<<cwi) + 11) * work_etu);
    544538
    545539    // Set BWT = (2^BWI * 960 + 11) work etu
    546     bwt = 1;
    547     for (i = 0; i < bwi; i++)
    548         bwt *= 2;
    549 
    550     bwt = (unsigned short) ((bwt * 960 + 11) * work_etu);
     540    bwt = (unsigned short) (((1<<bwi) * 960 + 11) * work_etu);
    551541
    552542    // Set BGT = 22 * work etu
Note: See TracChangeset for help on using the changeset viewer.