Changeset 894

Show
Ignore:
Timestamp:
02/24/08 12:37:04 (13 years ago)
Author:
ppalmers
Message:

fix initialization issue

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libieee1394/CycleTimerHelper.cpp

    r882 r894  
    120120{ 
    121121    debugOutput( DEBUG_LEVEL_VERBOSE, "Start %p...\n", this); 
     122 
     123    // initialize the 'prev ctr' values 
     124    uint64_t local_time; 
     125    int maxtries2 = 10; 
     126    do { 
     127        if(!m_Parent.readCycleTimerReg(&m_cycle_timer_prev, &local_time)) { 
     128            debugError("Could not read cycle timer register\n"); 
     129            return false; 
     130        } 
     131        if (m_cycle_timer_prev == 0) { 
     132            debugOutput(DEBUG_LEVEL_VERBOSE, 
     133                        "Bogus CTR: %08X on try %02d\n", 
     134                        m_cycle_timer_prev, maxtries2); 
     135        } 
     136    } while (m_cycle_timer_prev == 0 && maxtries2--); 
     137    m_cycle_timer_ticks_prev = CYCLE_TIMER_TO_TICKS(m_cycle_timer_prev); 
     138 
    122139#if IEEE1394SERVICE_USE_CYCLETIMER_DLL 
    123140    m_high_bw_updates = UPDATES_WITH_HIGH_BANDWIDTH; 
     
    141158    debugOutput( DEBUG_LEVEL_VERBOSE, "Initialize %p...\n", this); 
    142159    pthread_mutex_init(&m_compute_vars_lock, NULL); 
    143      
    144     // initialize the 'prev ctr' values 
    145     uint64_t local_time; 
    146     int maxtries2 = 10; 
    147     do { 
    148         if(!m_Parent.readCycleTimerReg(&m_cycle_timer_prev, &local_time)) { 
    149             debugError("Could not read cycle timer register\n"); 
    150             return false; 
    151         } 
    152         if (m_cycle_timer_prev == 0) { 
    153             debugOutput(DEBUG_LEVEL_VERBOSE, 
    154                         "Bogus CTR: %08X on try %02d\n", 
    155                         m_cycle_timer_prev, maxtries2); 
    156         } 
    157     } while (m_cycle_timer_prev == 0 && maxtries2--); 
    158     m_cycle_timer_ticks_prev = CYCLE_TIMER_TO_TICKS(m_cycle_timer_prev); 
    159160    return true; 
    160161}