124
//koodailar add for mingw 2005.12.18 ----------------------------------------
127
ep9312_io_do_cycle (ARMul_State * state)
130
mingw_start_thread(skyeye_config.uart.fd_in);
131
/* We must implement TC1, TC2 and TC4 */
132
for (i = 0; i < 2; i++) {
133
if (io.tc[i].value == 0) {
134
if (io.tc[i].ctl & TC_CTL_MODE)
135
io.tc[i].value = io.tc[i].load;
137
io.tc[i].value = io.tc[i].mod_value;
138
io.intsr[0] |= TCOI[i];
139
ep9312_update_int (state);
147
if (!(io.intsr[0] & (UART_RXINTR[iConsole]))
148
&& io.uart[iConsole].dr == 0) {
149
if (SDL_SemTryWait(get_mingw_read_sem())==0)
151
if(get_mingw_sem_first_time() != 1 && get_mingw_readed() == 1)
156
buf = get_mingw_char_read();
160
io.uart[iConsole].dr = (int) buf;
161
io.intsr[0] |= UART_RXINTR[iConsole];
162
io.intmr[0] |= UART_RXINTR[iConsole];
163
io.intsr[1] |= INT_UART[iConsole];
164
io.intmr[1] |= INT_UART[iConsole];
165
io.uart[iConsole].iir |= UART_IIR_RIS;
166
io.uart[iConsole].fr &= ~UART_FR_RXFE;
167
ep9312_update_int (state);
170
SDL_SemPost(get_mingw_read_sem());
174
} //if (!(io.intsr & URXINT))
179
ep9312_io_do_cycle (ARMul_State * state)
183
/* We must implement TC1, TC2 and TC4 */
184
for (i = 0; i < 2; i++) {
185
if (io.tc[i].value == 0) {
186
if (io.tc[i].ctl & TC_CTL_MODE)
187
io.tc[i].value = io.tc[i].load;
189
io.tc[i].value = io.tc[i].mod_value;
190
io.intsr[0] |= TCOI[i];
191
ep9312_update_int (state);
199
if (!(io.intsr[0] & (UART_RXINTR[iConsole]))
200
&& io.uart[iConsole].dr == 0) {
122
ep9312_io_do_cycle (ARMul_State * state)
126
/* We must implement TC1, TC2 and TC4 */
127
for (i = 0; i < 2; i++) {
128
if (io.tc[i].value == 0) {
129
if (io.tc[i].ctl & TC_CTL_MODE)
130
io.tc[i].value = io.tc[i].load;
132
io.tc[i].value = io.tc[i].mod_value;
133
io.intsr[0] |= TCOI[i];
134
ep9312_update_int (state);
142
if (!(io.intsr[0] & (UART_RXINTR[iConsole]))
143
&& io.uart[iConsole].dr == 0) {
144
/* 2007-01-18 modified by Anthony Lee : for new uart device frame */
202
145
struct timeval tv;
205
FD_SET (skyeye_config.uart.fd_in, &rfds);
210
(skyeye_config.uart.fd_in + 1, &rfds, NULL, NULL,
214
n = read (skyeye_config.uart.fd_in, &buf, 1);
217
io.uart[iConsole].dr = (int) buf;
218
io.intsr[0] |= UART_RXINTR[iConsole];
219
io.intmr[0] |= UART_RXINTR[iConsole];
220
io.intsr[1] |= INT_UART[iConsole];
221
io.intmr[1] |= INT_UART[iConsole];
222
io.uart[iConsole].iir |= UART_IIR_RIS;
223
io.uart[iConsole].fr &= ~UART_FR_RXFE;
224
ep9312_update_int (state);
151
if(skyeye_uart_read(-1, &buf, 1, &tv, NULL) > 0)
153
io.uart[iConsole].dr = (int) buf;
154
io.intsr[0] |= UART_RXINTR[iConsole];
155
io.intmr[0] |= UART_RXINTR[iConsole];
156
io.intsr[1] |= INT_UART[iConsole];
157
io.intmr[1] |= INT_UART[iConsole];
158
io.uart[iConsole].iir |= UART_IIR_RIS;
159
io.uart[iConsole].fr &= ~UART_FR_RXFE;
160
ep9312_update_int (state);
227
162
} //if (!(io.intsr & URXINT))
230
// end ----------------------------------------------------------------------
233
167
ep9312_uart_read (ARMul_State * state, u32 offset, u32 * data, int index)