void dp8390_device::set_cr(UINT8 newcr) { int ostate = ((m_regs.cr & 3) == 2); m_regs.cr = newcr; if((newcr & 1) && (ostate == 1)) return stop(); if((newcr & 3) == 2) { m_reset = 0; m_regs.isr &= ~0x80; } if(newcr & 0x20) m_rdma_active = 0; if(m_reset) return; if(newcr & 4) do_tx(); if((newcr & 0x38) == 8) { m_rdma_active = 1; check_dma_complete(); } if((newcr & 0x38) == 0x10) m_rdma_active = 2; }
int shandler(int port) { struct stty *t; int IntID, LineStatus, ModemStatus, intType, c; t = &stty[port]; /* IRQ 4 interrupt : COM1 = stty[0] */ IntID = in_byte(t->port+IIR); /* read InterruptID Reg */ LineStatus= in_byte(t->port+LSR); /* read LineStatus Reg */ ModemStatus=in_byte(t->port+MSR); /* read ModemStatus Reg */ intType = IntID & 7; /* mask out all except the lowest 3 bits */ switch(intType){ case 6 : do_errors(t); break; /* 110 = errors */ case 4 : do_rx(t); break; /* 100 = rx interrupt */ case 2 : do_tx(t); break; /* 010 = tx interrupt */ case 0 : do_modem(t); break; /* 000 = modem interrupt */ } out_byte(INT_CTL, ENABLE); /* reenable the 8259 controller */ }
static void do_control_request(int direction) { switch (USB_ControlRequest.bRequest) { case REQUEST_REGISTER: do_register(direction, USB_ControlRequest.wValue); break; case REQUEST_FREQUENCY: do_frequency(direction, USB_ControlRequest.wValue); break; case REQUEST_RXTX_MODE: do_rxtx_mode(direction, USB_ControlRequest.wValue); break; case REQUEST_MODINDEX: do_modindex(direction, USB_ControlRequest.wValue); break; case REQUEST_CSMA_RSSI: do_csma_rssi(direction, USB_ControlRequest.wValue); break; case REQUEST_POWER: do_power(direction, USB_ControlRequest.wValue); break; case REQUEST_AFC: do_acf(direction, USB_ControlRequest.wValue); break; case REQUEST_IFBW: do_ifbw(direction, USB_ControlRequest.wValue); break; case REQUEST_TRAINING: do_training(direction, USB_ControlRequest.wValue); break; case REQUEST_SYNCWORD: do_syncword(direction, USB_ControlRequest.wValue); break; case REQUEST_BITRATE: do_bitrate(direction, USB_ControlRequest.wValue); break; case REQUEST_TX: do_tx(direction, USB_ControlRequest.wValue); break; case REQUEST_RX: do_rx(direction, USB_ControlRequest.wValue); break; case REQUEST_TX_FREQUENCY: do_tx_frequency(direction, USB_ControlRequest.wValue); break; case REQUEST_RX_FREQUENCY: do_rx_frequency(direction, USB_ControlRequest.wValue); break; case REQUEST_SERIALNUMBER: do_serialnumber(direction, USB_ControlRequest.wValue); break; case REQUEST_FWREVISION: do_fw_revision(direction, USB_ControlRequest.wValue); break; case REQUEST_RESET: reboot(); break; case REQUEST_DFU: jump_to_bootloader(); break; } }
/* Semantik: Event tasks are functions, that need to be called when a signal is set. In most cases the signal is set by an IRQ handler and the event task is the bottom half. Events therefore have a higher priority than normal tasks. Before a normal task is allowed to run, all pending events are handled. TODO priority within events is not implemented and fast recurring events are not handled here. TODO we could add some functions to attach/detach a handler to/from each signal */ static void handle_events(){ if (signal_is_set(SIG_TIMER)) timer_tick(); #if 0 if (signal_is_set(SIG_NEW_TIME)) NewTimeTask(); #endif #if 0 if (signal_is_set(SIG_RTC)) RtcTask(); #endif #if 0 if (pending_tasks & (1<<5)){ RTCget_busy = 0; RTCtest(task3_dat); }; #endif if (signal_is_set(SIG_RX_PACKET)) { rfRcvPacket(); }; #if 0 if (signal_is_set(SIG_NEW_PACKET)) { signal_clr(SIG_NEW_PACKET); pkt_cnt++; packet[packet_length] = 0; process_packet((char *)packet, packet_length); }; #endif #if 0 if (signal_is_set(SIG_TX)){ do_tx(); }; #endif #if 0 if (signal_is_set(SIG_KEYSCAN)) { key_scan(); }; #endif #if 1 if (signal_is_set(SIG_KEY_CHG)) { key_change(); }; #endif #if 0 if (signal_is_set(SIG_RTC_INT)) { Task30(); }; #endif #if 0 if (signal_is_set(SIG_RTC_UNLOCK)) { rtc_unlock(); }; #endif #if 1 // SIG_NONE is used, when the API needs a signal, but no handler needs to be invoked if (signal_is_set(SIG_NONE)) { signal_clr(SIG_NONE); }; #endif }