src/occ_405/pss/avsbus.c
// Wait for operation to complete (clear ongoing)
Wait for operation to complete (clear ongoing)
Wait for operation to complete ( clear ongoing )
uint32_t wait_for_complete(const uint8_t i_bus)
{
    uint32_t l_status = in32(OCB_O2SSTxB[i_bus]);
    DEBUG_IN32(OCB_O2SSTxB[i_bus], l_status, "OCB_O2SSTxB");
    unsigned int loops = 0;
    while ((l_status & AVSBUS_STATUS_ONGOING) && (loops < 500))
    {
        l_status = in32(OCB_O2SSTxB[i_bus]);
        ++loops;
    }
    DEBUG_IN32(OCB_O2SSTxB[i_bus], l_status, "OCB_O2SSTxB");
    if (0 != (l_status & AVSBUS_STATUS_ERRORS))
    {
        TRAC_ERR("wait_for_complete(): error in status register: 0x%08X", l_status);
    }
    else if (l_status & AVSBUS_STATUS_ONGOING) 
    {
        TRAC_ERR("wait_for_complete(): timeout waiting for ongoing bit to clear (%d loops) 0x%08X", loops, l_status);
    }
    return l_status;
}
uint32_t wait_for_complete ( const uint8_t i_bus ) { uint32_t l_status = in32 ( OCB_O2SSTxB [ i_bus ] ) ; DEBUG_IN32 ( OCB_O2SSTxB [ i_bus ] , l_status , " " ) ; unsigned int loops = 0 ; while ( ( l_status & AVSBUS_STATUS_ONGOING ) && ( loops < 500 ) ) { l_status = in32 ( OCB_O2SSTxB [ i_bus ] ) ; ++ loops ; } DEBUG_IN32 ( OCB_O2SSTxB [ i_bus ] , l_status , " " ) ; if ( 0 != ( l_status & AVSBUS_STATUS_ERRORS ) ) { TRAC_ERR ( " " , l_status ) ; } else if ( l_status & AVSBUS_STATUS_ONGOING ) { TRAC_ERR ( " " , loops , l_status ) ; } return l_status ; }
Wait for operation to complete (clear ongoing)
Wait for operation to complete ( clear ongoing )
// o2s_ongoing bit was still set (operation did not complete) // o2s_ongoing