Commit d6ed19b6 authored by pnr's avatar pnr
Browse files

Update fujprog.c

parent ba2bc368
...@@ -4180,6 +4180,10 @@ term_emul(void) ...@@ -4180,6 +4180,10 @@ term_emul(void)
reload = 1; reload = 1;
res = 0; res = 0;
goto done; goto done;
case 'a':
txbuf[tx_cnt] = c = 1;
break;
case 'k':
case '.': case '.':
res = 1; res = 1;
goto done; goto done;
...@@ -4239,6 +4243,14 @@ term_emul(void) ...@@ -4239,6 +4243,14 @@ term_emul(void)
break; break;
} }
} }
if (c == 1) {
if (key_phase < 2) {
key_phase = 2;
continue;
} else {
key_phase = 0;
}
}
if (key_phase == 1 && c == '~') { if (key_phase == 1 && c == '~') {
key_phase = 2; key_phase = 2;
continue; continue;
...@@ -4256,7 +4268,11 @@ term_emul(void) ...@@ -4256,7 +4268,11 @@ term_emul(void)
#ifdef WIN32 #ifdef WIN32
FT_Write(ftHandle, txbuf, tx_cnt, &sent); FT_Write(ftHandle, txbuf, tx_cnt, &sent);
#else #else
sent = ftdi_write_data(&fc, txbuf, tx_cnt); sent = 0;
for(int i=0; i<tx_cnt; i++) {
sent += ftdi_write_data(&fc, txbuf+i, 1);
ms_sleep(txfu_ms);
}
#endif #endif
} else {/* cable_hw == CABLE_HW_COM */ } else {/* cable_hw == CABLE_HW_COM */
#ifdef WIN32 #ifdef WIN32
...@@ -4264,7 +4280,11 @@ term_emul(void) ...@@ -4264,7 +4280,11 @@ term_emul(void)
(DWORD *) &sent, NULL); (DWORD *) &sent, NULL);
#else #else
fcntl(com_port, F_SETFL, 0); fcntl(com_port, F_SETFL, 0);
sent = write(com_port, txbuf, tx_cnt); sent = 0;
for(int i=0; i<tx_cnt; i++) {
sent += write(com_port, txbuf+i, 1);
ms_sleep(txfu_ms);
}
fcntl(com_port, F_SETFL, O_NONBLOCK); fcntl(com_port, F_SETFL, O_NONBLOCK);
#endif #endif
} }
...@@ -4740,4 +4760,4 @@ main(int argc, char *argv[]) ...@@ -4740,4 +4760,4 @@ main(int argc, char *argv[])
#endif #endif
return (res); return (res);
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment