Commit Graph

14 Commits

Author SHA1 Message Date
David Given
653a6a0189 Be more consistent about DTR toggling (needed to reset serial devices). 2024-05-01 12:54:22 +02:00
p-j-b
c2248c7e4a Added CLRDTR and SETDTR to setBaudRate
Fixes hang in Windows with Adafruit Floppy GreaseWeazle
2024-04-02 13:05:29 +01:00
David Given
f5f223f622 First steps towards reworking the build system... again. 2023-10-21 23:02:46 +02:00
David Given
d4c0853e1f Reset the Greaseweazle data stream when connecting. 2023-05-25 22:23:28 +02:00
dg
466c3c34e5 Replace the Error() object with an error() function which takes fmt
formatspecs, making for much cleaner code. Reformatted everything.

This actually happened in multiple steps but then I corrupted my local
repository and I had to recover from the working tree.
2023-05-09 20:59:44 +00:00
Jeff Epler
33bd912476 Some quality of life improvements for Adafruit generic GW-compatibles
The addition of the new tcsetattr call fixes a problem where interrupting
fluxengine during a flux read will leave data in the device and/or Linux's
serial buffers, so that the next invocation of fluxengine will fail similar
to
```
Error: command returned garbage (0x27 != 0x0 with status 0x31)
```
(the specific value differs because it's actually flux data)

Merely changing the existing tcsetattr call to specify TCSAFLUSH was not
enough; moving it after the 200ms pause seems to be enough.

Note that it doesn't seem feasible in our USB stack to make DTR reset
the device, since that would take down the USB stack and require a fresh
USB connection.

The addition of the special case for `rlen == 0` in read is for when the
GW-compatible board is reset or crashes and usb-disconnects during a
reading operation. Without this change, fluxengine spins forever at 100%
of a CPU, repeating a read().  After the change, this will cause
the host computer to print messages like:
```
  2.1: 200 ms in 68928 bytes
  3.0: Error: serial read returned no data (device removed?)
```
and exit.

I only tested these changes on Linux (Debian with kernel 5.10) and in
particular I don't know if/how it will work on a Mac.
2022-02-12 22:04:18 -06:00
David Given
3e4d4cc002 Hotfix for Windows build. 2022-01-22 22:29:34 +01:00
David Given
d6db2128df Toggle DTR on Unixes as well as on Windows. 2022-01-22 20:39:20 +01:00
lady ada
45d7b284e3 1) update CI to add zip on commit for quick testing
2) fix gw readflux command (should be 8 bytes long but was packed as 10)
3) add support for non-gw VID/PID (generic serial port that is gw compatible)
4) manually set/clear DTR on serial port devices - this seems to be essential for tinyusb/arduino CDC

not tested with a gw but ought not to have broken anything!
2022-01-16 12:43:47 -05:00
Howard M. Harte
9ee5b3eaf3 Windows: Support serial ports > COM9
Windows requires the use of the DOS UNC path name for COM ports
greater than COM9.  Prefix the port name with \\.\
2021-12-17 14:21:19 -08:00
David Given
53c8ec864c Clean up the GreaseWeazle bandwidth tester. Sometimes it doesn't read the right
amount of data from the device?
2021-12-14 18:01:53 +00:00
David Given
4b815846ee ...and fix for OSX. 2021-12-10 23:35:58 +00:00
David Given
fe8be18c4c Fix the serial port code on Windows. 2021-12-10 23:29:20 +00:00
David Given
519c30321d Split the serial port code off into its own file so we can use it for the SCP
driver.
2021-12-11 00:06:14 +01:00