void update_derivs(const vector<int>& toCoords) { const vector<int>* fromCoords = add_delay(toCoords); if (fromCoords) { outer(this->from->out_acts(*fromCoords), derivs().begin(), this->to->inputErrors[toCoords]); } }
void feed_back(const vector<int>& toCoords) { const vector<int>* fromCoords = add_delay(toCoords); if (fromCoords) { dot_transpose(this->to->inputErrors[toCoords], weights().begin(), this->from->out_errs(*fromCoords)); } }
void feed_forward(const vector<int>& toCoords) { const vector<int>* fromCoords = add_delay(toCoords); if (fromCoords) { dot(this->from->out_acts(*fromCoords), weights().begin(), this->to->inputActivations[toCoords]); } }
void p2p_send_go_neg_cnf(UWORD8 status) { UWORD8 grp_cap = 0; UWORD8 *frm_ptr = 0; UWORD16 index = 0; UWORD16 ie_len_offset = 0; TROUT_FUNC_ENTER; frm_ptr = (UWORD8*)mem_alloc(g_shared_pkt_mem_handle, MANAGEMENT_FRAME_LEN); if(frm_ptr == NULL) { TROUT_FUNC_EXIT; return; } TROUT_DBG4("P2P: send a P2P frame..."); add_p2p_mgmt_frame_hdr(frm_ptr, g_p2p_join_req.dev_dscr.dev_addr); index = add_p2p_pub_act_hdr(frm_ptr, g_p2p_dialog_token, P2P_GO_NEG_CNF); /* Store the P2P IE length offset */ ie_len_offset = MAC_HDR_LEN + P2P_PUB_ACT_TAG_PARAM_OFF + 1; /*************************************************************************/ /* The following P2P attributes are added as per the P2P v1.1 spec */ /* Table 53—P2P attributes in the GO Negotiation Confirmation frame */ /* - Status shall be present */ /* - P2P Capability shall be present */ /* - Operating Channel shall be present */ /* - Channel List shall be present */ /* - P2P Group ID shall be present if the P2P Device sending the GO */ /* Negotiation Confirmation frame will become P2P */ /* Group Owner following Group Owner Negotiation. */ /*************************************************************************/ index += add_status_attr(frm_ptr, index, (P2P_STATUS_CODE_T)status); if(BTRUE == g_p2p_GO_role) { /* If we will be a GO then the grp_cap is our capability else it is */ /* reserved */ grp_cap = get_p2p_grp_cap(); } index += add_p2p_capability_attr(frm_ptr, index, get_p2p_dev_cap(), grp_cap); index += add_p2p_oper_chan_attr(frm_ptr, index, mget_p2p_oper_chan()); index += add_p2p_chan_list_attr(frm_ptr, index); if(BTRUE == g_p2p_GO_role) { /* If we will be a GO then the P2P Group ID has to be added */ index += add_p2p_grp_id_attr(frm_ptr, index, mget_p2p_dev_addr(), (UWORD8 *)(mget_DesiredSSID())); } /* Update the P2P IE length */ frm_ptr[ie_len_offset] = index - ie_len_offset - 1; /* Transmit the management frame */ tx_mgmt_frame(frm_ptr, index + FCS_LEN, HIGH_PRI_Q, 0); /* Wait for the confirmation to get transmitted */ while(BFALSE == is_machw_q_null(HIGH_PRI_Q)) { add_delay(0xFFF); } TROUT_FUNC_EXIT; }
int main(int argc, char** argv) { if (argc < 3) { error("Usage: ./program [sourceFile] [subtitleOffset]\n"); } char *subtitleFileName = argv[1]; size_t subtitleOfcet = atoi(argv[2]); if (subtitleOfcet == 0) { error("There is nothing to change!"); } FILE *subtitleFile = fopen(subtitleFileName, "r+"); if (!subtitleFile) { error(subtitleFileName); } size_t readBytes = 0; char *buffer = NULL; size_t bufferSize = 0; while (!feof(subtitleFile) || !ferror(subtitleFile)) { long fileIndex = set_to_subtitle_timnig(&buffer, &bufferSize, subtitleFile); if (fileIndex == EOF) { break; } readBytes = read_line(&buffer, &bufferSize, subtitleFile); char temp[readBytes]; strcpy(temp, buffer); char *firstTime = strtok(temp, " --> "); char *secondTime = strtok(NULL, " --> "); Times first, second; add_delay(&first, firstTime, subtitleOfcet); add_delay(&second, secondTime, subtitleOfcet); sprintf(temp, "%02d:%02d:%02d,%03d --> %02d:%02d:%02d,%03d\n", first.hours, first.minutes, first.seconds, first.milliseconds, second.hours, second.minutes, second.seconds, second.milliseconds); strncpy(buffer, temp, readBytes); fseek(subtitleFile, fileIndex, SEEK_SET); fwrite(buffer, 1, readBytes, subtitleFile); } fclose(subtitleFile); free(buffer); return (EXIT_SUCCESS); }
UWORD32 mac_isr(UWORD32 vector, UWORD32 data) { led_display(0x0F); if(get_machw_hprx_comp_int() == BTRUE) { rx_complete_isr(HIGH_PRI_RXQ); reset_machw_hprx_comp_int(); g_test_stats.hprxci++; } else if(get_machw_rx_comp_int() == BTRUE) { rx_complete_isr(NORMAL_PRI_RXQ); reset_machw_rx_comp_int(); g_test_stats.rxci++; } else if(get_machw_tx_comp_int() == BTRUE) { tx_complete_isr(); reset_machw_tx_comp_int(); g_test_stats.txci++; } else if(get_machw_tbtt_int() == BTRUE) { tbtt_isr(); reset_machw_tbtt_int(); g_test_stats.tbtti++; } else if(get_machw_error_int() == BTRUE) { error_isr(); reset_machw_error_int(); g_test_stats.erri++; } else if(get_machw_deauth_int() == BTRUE) { deauth_isr(); reset_machw_deauth_int(); g_test_stats.deauthi++; } else if(get_machw_txsus_int() == BTRUE) { reset_machw_txsus_int(); g_test_stats.txsusi++; } else if(get_machw_radar_det_int() == BTRUE) { radar_detect_isr(); reset_machw_radar_det_int(); g_test_stats.radardeti++; } else if(get_machw_cap_end_int() == BTRUE) { reset_machw_cap_end_int(); g_test_stats.capei++; } else { g_test_stats.uki++; } acknowledge_interrupt(vector); /* Kill time after interrupt is Acked */ add_delay(10); #ifndef PHY_TEST_CODE led_display(0xF0); #endif /* PHY_TEST_CODE */ return OS_ISR_HANDLED; }