mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 16:51:21 -06:00
Firmware updater: rework cancelling
This commit is contained in:
parent
4f4649d046
commit
a43e72f696
10 changed files with 101 additions and 45 deletions
|
|
@ -415,6 +415,8 @@ static int ser_send(union filedescriptor *fd, const unsigned char * buf, size_t
|
|||
DWORD written;
|
||||
const unsigned char * b = buf;
|
||||
|
||||
RETURN_IF_CANCEL();
|
||||
|
||||
HANDLE hComPort=(HANDLE)fd->pfd;
|
||||
|
||||
if (hComPort == INVALID_HANDLE_VALUE) {
|
||||
|
|
@ -571,6 +573,8 @@ static int ser_recv(union filedescriptor *fd, unsigned char * buf, size_t buflen
|
|||
unsigned char * p = buf;
|
||||
DWORD read;
|
||||
|
||||
RETURN_IF_CANCEL();
|
||||
|
||||
HANDLE hComPort=(HANDLE)fd->pfd;
|
||||
|
||||
if (hComPort == INVALID_HANDLE_VALUE) {
|
||||
|
|
@ -653,6 +657,8 @@ static int ser_drain(union filedescriptor *fd, int display)
|
|||
}
|
||||
|
||||
while (1) {
|
||||
RETURN_IF_CANCEL();
|
||||
|
||||
readres=ReadFile(hComPort, buf, 1, &read, NULL);
|
||||
if (!readres) {
|
||||
LPVOID lpMsgBuf;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue