03 March 2021, 17:30 | #21 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
- Mark and Space parity implemented (I don't know why I missed that)
- io_length = -1 CMD_WRITE support. https://www.winuae.net/files/b/winuae.7z Quote:
|
|
03 March 2021, 19:11 | #22 |
Registered User
Join Date: Aug 2018
Location: Germany
Posts: 46
|
Wow - thanks Toni!
Do you actually still have to think while coding or are your hands typing autonomously? Will test tonight. |
03 March 2021, 21:17 | #23 |
Registered User
Join Date: Aug 2018
Location: Germany
Posts: 46
|
OK - parity tested.
Two things: - parity Space works, Mark doesn't - it's opened as space as well. - for enabling mark and space you currently have to set not only the io_ExtFlags but also io_SerFlags |= SERF_PARTY_ON. According to "serial.doc" from the NDKs (1.3 to 3.5) this shouldn't be necessary: serial.device/SDCMD_SETPARAMS: 7. If you select mark or space parity (see io_ExtFlags in serial.h), this will cause the SERB_PARTY_ON bit to be set, and the setting of SERB_PARTY_ODD to be ignored. Can't test this on real hardware though. EDIT: io_Length = -1 tested ok - transmission stops at first occurance of 0x00 :-) Last edited by amiga_amigo; 03 March 2021 at 21:41. |
04 March 2021, 18:10 | #24 | |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
- Space/Mark parity fixed.
- EOFMODE implemented. (Which no one needs?) Quote:
|
|
04 March 2021, 20:30 | #25 |
Registered User
Join Date: Aug 2018
Location: Germany
Posts: 46
|
Sorry Toni - but it's not working.
This time it's parity Odd and Space that seem to be wrong. Odd opens the port as N (both my own program and term4.8). Space opens the port as N (my program) or E (term4.8) => ? Don't know why this differs but this is how i understood the docs and set the flags: Code:
SerialIO->io_SerFlags = SERF_XDISABLED; // disable XON/XOFF, clear all other bits switch(parity) { case PAR_O: SerialIO->io_SerFlags |= SERF_PARTY_ODD; // fall-through to PAR_E! case PAR_E: SerialIO->io_SerFlags |= SERF_PARTY_ON; break; case PAR_M: SerialIO->io_ExtFlags |= SEXTF_MARK; // fall-through to PAR_S! case PAR_S: SerialIO->io_ExtFlags |= SEXTF_MSPON; break; } PAR_N sets no flags PAR_O sets SERF_PARTY_ODD and SERF_PARTY_ON, PAR_E sets SERF_PARTY_ON, PAR_M sets SEXTF_MARK and SEXTF_MSPON (and automatically SERF_PARTY_ON), PAR_S sets SEXTF_MSPON (and automatically SERF_PARTY_ON) Maybe i misunderstood...? |
04 March 2021, 20:39 | #26 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Odd parity was broken in win32 specific code (fixed now) but space and mark should work correctly.
Code:
parity = 0; if (extFlags & SEXTF_MSPON) { parity = (extFlags & SEXTF_MARK) ? 3 : 4; if (!(serFlags & SERF_PARTY_ON)) { put_byte_host(req + io_SerFlags, serFlags | SERF_PARTY_ON); } } else if (serFlags & SERF_PARTY_ON) { parity = (serFlags & SERF_PARTY_ODD) ? 1 : 2; } Code:
switch (parity) { case 1: dcb.Parity = ODDPARITY; break; case 2: dcb.Parity = EVENPARITY; break; case 3: dcb.Parity = MARKPARITY; break; case 4: dcb.Parity = SPACEPARITY; break; default: dcb.Parity = NOPARITY; break; } |
04 March 2021, 21:21 | #27 |
Registered User
Join Date: Aug 2018
Location: Germany
Posts: 46
|
All parities ok - except Space.
Space is still the same (gives N with my program and E with Term4.8). I'd say we both interpret the flags the same way - right? So maybe windows specific part for Space? EDIT: This is the logfile entry for a transmission requesting 8S1 28-266 [2286 227-021]: uaeserial.device:1 BAUD=31250 BUF=1024 BITS=8+1 RTSCTS=0 PAR=0 XO=000000 Strange - i've put printf's into my switch-case for all branches and i do see the expected output. So parity S should set SEXTF_MSPON (only) in my program. How can we get parity none then? EDIT EDIT: Maybe got an idea: If SEXTF_MSPON is different between my definition and yours, you'd not find that flag set when i want to set parity S. Since MSPON is the only flag i'd set, you'd think it's N requested. Term4.8 might set SERF_PARTY_ON also (although it's set automatically). Missing SEXTF_MSPON but registering SERF_PARTY_ON, you'd think it's E requested. But why would parity M work then? It shouldn't - so forget it... EDIT EDIT EDIT It shouldn't? Not true... It could, but only if the order of SEXTF_MSPON and SEXTF_MARK is reversed. For parity M i'd set both flags. Wouldn't make a difference if you'd interpret the flags the other way round. Just for the record: SEXTF_MSPON == 2 SEXTF_MARK == 1 for me Last edited by amiga_amigo; 05 March 2021 at 10:18. |
05 March 2021, 11:32 | #28 |
Registered User
Join Date: Aug 2018
Location: Germany
Posts: 46
|
Ok - just tested this.
I intentionally swapped the two flags in my code for testing => all parities work as should. You must have the bitorder of the two flags reversed! (Please tell me i'm right, so we can close this issue...) |
05 March 2021, 19:21 | #29 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
Oops. I didn't notice MSPON and MARK was not in ascending order in header files.. fixed.
|
06 March 2021, 10:19 | #30 |
Registered User
Join Date: Aug 2018
Location: Germany
Posts: 46
|
Tested again - all parity settings work.
Thank you! |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Serial Port? | EugeneNine | support.FS-UAE | 5 | 23 February 2017 01:09 |
Debugging over Serial-Port | sigma63 | support.WinUAE | 1 | 14 March 2016 19:02 |
Serial port, parallel port, and pipe device mount errors | Samurai_Crow | support.FS-UAE | 4 | 13 March 2014 00:04 |
Serial Port Questions | iainnitro | support.Hardware | 10 | 21 April 2012 16:03 |
How to test serial port? | mmikko | support.Hardware | 2 | 05 February 2008 08:43 |
|
|