diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-16 12:37:12 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-16 12:57:29 +0200 |
| commit | 5a4967c577ad245a2117b7b2f71c13b1212fe285 (patch) | |
| tree | 4d09343cfe757239895a0dd9b399242d2a07d7c2 /map65/libm65/ptt.c | |
| parent | 23c903a09fb1d73fd20b50323cd80cfb3aba8799 (diff) | |
Merge 2.7 changes, I had uploaded -1 from the wrong branch.debian/3.0.0_rc1+repack-2
Diffstat (limited to 'map65/libm65/ptt.c')
| -rwxr-xr-x | map65/libm65/ptt.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/map65/libm65/ptt.c b/map65/libm65/ptt.c index 0f99d1be..247bffbc 100755 --- a/map65/libm65/ptt.c +++ b/map65/libm65/ptt.c @@ -1,43 +1,43 @@ -#include <windows.h> -#include <stdio.h> - -int ptt_(int *nport, int *ntx, int *iptt) -{ - static HANDLE hFile; - static int open=0; - char s[10]; - int i3=0,i4=0,i5=0,i6=0,i9=0,i00=0; - - if(*nport==0) { - *iptt=*ntx; - return(0); - } - - if(*ntx && (!open)) { - sprintf(s,"COM%d",*nport); - hFile=CreateFile(TEXT(s),GENERIC_WRITE,0,NULL,OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL,NULL); - if(hFile==INVALID_HANDLE_VALUE) { - // printf("PTT: Cannot open COM port %d.\n",*nport); - return 1; - } - open=1; - } - - if(*ntx && open) { - EscapeCommFunction(hFile,3); - EscapeCommFunction(hFile,5); - *iptt=1; - } - - else { - EscapeCommFunction(hFile,4); - EscapeCommFunction(hFile,6); - EscapeCommFunction(hFile,9); - i00=CloseHandle(hFile); - *iptt=0; - open=0; - } - if((i00+i3+i4+i5+i6+i9)==-99) return -1; //Silence compiler warning - return 0; -} +#include <windows.h>
+#include <stdio.h>
+
+int ptt_(int *nport, int *ntx, int *iptt)
+{
+ static HANDLE hFile;
+ static int open=0;
+ char s[10];
+ int i3=0,i4=0,i5=0,i6=0,i9=0,i00=0;
+
+ if(*nport==0) {
+ *iptt=*ntx;
+ return(0);
+ }
+
+ if(*ntx && (!open)) {
+ sprintf(s,"COM%d",*nport);
+ hFile=CreateFile(TEXT(s),GENERIC_WRITE,0,NULL,OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,NULL);
+ if(hFile==INVALID_HANDLE_VALUE) {
+ // printf("PTT: Cannot open COM port %d.\n",*nport);
+ return 1;
+ }
+ open=1;
+ }
+
+ if(*ntx && open) {
+ EscapeCommFunction(hFile,3);
+ EscapeCommFunction(hFile,5);
+ *iptt=1;
+ }
+
+ else {
+ EscapeCommFunction(hFile,4);
+ EscapeCommFunction(hFile,6);
+ EscapeCommFunction(hFile,9);
+ i00=CloseHandle(hFile);
+ *iptt=0;
+ open=0;
+ }
+ if((i00+i3+i4+i5+i6+i9)==-99) return -1; //Silence compiler warning
+ return 0;
+}
|
