void m2comm_device::check_vint_irq() { #ifndef M2COMM_SIMULATION #else comm_tick(); #endif }
void s32comm_device::check_vint_irq() { #ifndef __S32COMM_SIMULATION__ #else comm_tick(); #endif }
void m1comm_device::check_vint_irq() { #ifndef __M1COMM_SIMULATION__ if (m_syn & 0x02) { m_commcpu->set_input_line_and_vector(0, HOLD_LINE, 0xef); #ifdef __M1COMM_VERBOSE__ printf("m1comm-INT5\n"); #endif } #else comm_tick(); #endif }
static void *COMM_UDP_thread_func(void *arg) { DBG(D_COMM, D_DEBUG, "COMM UDP eth rx thread started\n"); time last_tick = SYS_get_time_ms(); while (TRUE) { u16_t len; while (ETH_SPI_state() != ETH_UP) { DBG(D_COMM, D_DEBUG, "COMM UDP eth not up, sleep\n"); OS_thread_sleep(1000); } if (ETH_SPI_state() == ETH_UP) { bool pkt = ETH_SPI_read(ecomm.rx_frame, &len, 100); if (ETH_SPI_state() != ETH_UP) { DBG(D_COMM, D_DEBUG, "COMM UDP eth down while waiting for frame\n"); continue; } else { if (pkt) { // got packet, handle it bool fin = FALSE; int res = R_COMM_OK; int i = 0; DBG(D_COMM, D_DEBUG, "COMM UDP rx frame, len %i\n", len); while (i < len - UDP_DATA_P && !fin && res == R_COMM_OK) { res = ecomm.driver.phy.up_rx_f(&ecomm.driver, ecomm.rx_frame[i + UDP_DATA_P], (unsigned char*)&fin); i++; } DBG(D_COMM, D_DEBUG, "COMM UDP rx frame comm stack res:%i fin:%i\n", res, fin); } // check if tick is needed if (SYS_get_time_ms() - last_tick >= COMM_RESEND_TICK(0) / 2) { last_tick = SYS_get_time_ms(); //DBG(D_COMM, D_DEBUG, "COMM UDP eth rx tmo, tick\n"); comm_tick(&ecomm.driver, COMM_cb_get_tick_count()); } } // if eth still is up } // if eth is up } // while true return NULL ; }