Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having 0x10 set causes arduino to reset when serial message is sent #88

Open
ApplePieAlibi opened this issue Sep 2, 2018 · 3 comments

Comments

@ApplePieAlibi
Copy link

func setCommState(h syscall.Handle, baud int, databits byte, parity Parity, stopbits StopBits) error {
	var params structDCB
	params.DCBlength = uint32(unsafe.Sizeof(params))

	params.flags[0] = 0x01  // fBinary
	params.flags[0] |= 0x10 // Assert DSR

Having 0x10 set causes arduino to reset when serial message is sent when connecting via windows. I modified my copy of the library to remove this line.

func setCommState(h syscall.Handle, baud int, databits byte, parity Parity, stopbits StopBits) error {
	var params structDCB
	params.DCBlength = uint32(unsafe.Sizeof(params))

	params.flags[0] = 0x01  // fBinary
	//params.flags[0] |= 0x10 // Assert DSR

Currently using it in this project: https://github.com/ASoggyToaster/Max7219

@ApplePieAlibi
Copy link
Author

Submitted a PR: #89

@donotnoot
Copy link

donotnoot commented Feb 20, 2019

jeez I wasted so much time yesterday trying to figure out why my Arduino was resetting when I sent data using this library. Thanks for finding out wha the problem is.

Happens in OS X too. I would not say this is a library problem specifically but it would be great to make this behaviour configurable.

@ApplePieAlibi
Copy link
Author

Agreed - Probably shouldn't have submitted this as a PR per se, but having it open - I think - is helpful to others who may experience the same issue.

In this instance I made the quick and dirty change that suited my usecase, but glad it helped you as well @donotnoot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants