Closed trentgill closed 5 years ago
@tehn nightmare!!
Oof. Sorry for the line ending goose chase. Should this check if line length mod 64 == 0? A 128 character line seems extreme but possible, especially for initializing a long table or something?
:scream:
@csboling not at all! it was key to finding the underlying issue! re: modulo, that's a very good point, i'll check now but it seems len==128 would cause the same problem.
Indeed 128bytes was crashing too! Merging now.
Turns out the line-ending issue was potentially a red-herring.
This PR removes the forced line-ending encoding as crow should handle either line-endings gracefully.
This does however introduce a gross hack to solve a problem where transmissions of exactly 64bytes would cause crow to stop receiving further data. This solution adds an additonal newline character which crow discards anyway, and remains active. Confusingly this hack is ony needed on windows & osx (not linux).
64bytes is the size of the USB-buffer endpoints on crow. See the following files in the crow project: crow/submodules/STM32_Cube_F7/Middlewares/ST/STM32_USB_Device_Library/Core/Inc/usbd_def.h @114-115 crow/submodules/STM32_Cube_F7/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc/usbd_cdc.h @58
Tested on lin/win/osx with a number of scripts using both
r
andu
.