apps/twr_node_tdma/src/main.c
int
uwb_config_updated_func()
{
    /* Workaround in case we're stuck waiting for ccp with the 
     * wrong radio settings */
    struct uwb_dev * udev = uwb_dev_idx_lookup(0);
    struct uwb_ccp_instance *ccp = (struct uwb_ccp_instance*)uwb_mac_find_cb_inst_ptr(udev, UWBEXT_CCP);
    if (dpl_sem_get_count(&ccp->sem) == 0) {
        uwb_phy_forcetrxoff(udev);
        uwb_mac_config(udev, NULL);
        uwb_txrf_config(udev, &udev->config.txrf);
#if MYNEWT_VAL(UWB_DEVICE_1)
        uwb_mac_config(uwb_dev_idx_lookup(1), NULL);
        uwb_txrf_config(uwb_dev_idx_lookup(1), &uwb_dev_idx_lookup(1)->config.txrf);
#endif
        uwb_start_rx(udev);
        return 0;
    }

    uwb_config_updated = true;
    return 0;
}
/**
 * @fn uwb_config_update
 * 
 * Called from the main event queue as a result of the uwbcfg packet
 * having received a commit/load of new uwb configuration.
 */


Called from the main event queue as a result of the uwbcfg packet
having received a commit/load of new uwb configuration.
Called from the main event queue as a result of the uwbcfg packet having received a commit / load of new uwb configuration .
int
uwb_config_updated_func()
{
    struct uwb_dev * udev = uwb_dev_idx_lookup(0);
    struct uwb_ccp_instance *ccp = (struct uwb_ccp_instance*)uwb_mac_find_cb_inst_ptr(udev, UWBEXT_CCP);
    if (dpl_sem_get_count(&ccp->sem) == 0) {
        uwb_phy_forcetrxoff(udev);
        uwb_mac_config(udev, NULL);
        uwb_txrf_config(udev, &udev->config.txrf);
#if MYNEWT_VAL(UWB_DEVICE_1)
        uwb_mac_config(uwb_dev_idx_lookup(1), NULL);
        uwb_txrf_config(uwb_dev_idx_lookup(1), &uwb_dev_idx_lookup(1)->config.txrf);
#endif
        uwb_start_rx(udev);
        return 0;
    }
    uwb_config_updated = true;
    return 0;
}
int uwb_config_updated_func ( ) { struct uwb_dev * udev = uwb_dev_idx_lookup ( 0 ) ; struct uwb_ccp_instance * ccp = ( struct uwb_ccp_instance * ) uwb_mac_find_cb_inst_ptr ( udev , UWBEXT_CCP ) ; if ( dpl_sem_get_count ( & ccp -> sem ) == 0 ) { uwb_phy_forcetrxoff ( udev ) ; uwb_mac_config ( udev , NULL ) ; uwb_txrf_config ( udev , & udev -> config . txrf ) ; #if MYNEWT_VAL ( UWB_DEVICE_1 ) uwb_mac_config ( uwb_dev_idx_lookup ( 1 ) , NULL ) ; uwb_txrf_config ( uwb_dev_idx_lookup ( 1 ) , & uwb_dev_idx_lookup ( 1 ) -> config . txrf ) ; #endif uwb_start_rx ( udev ) ; return 0 ; } uwb_config_updated = true ; return 0 ; }
@fn uwb_config_update
@fn uwb_config_update
/* Workaround in case we're stuck waiting for ccp with the 
     * wrong radio settings */