-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Serial.setDebugOutput(0) doesnt actually turn off debug output #98
Comments
the fix is even simpler. thanks for the good bug report. |
igrr
added a commit
that referenced
this issue
Apr 26, 2015
* esp8266: (21 commits) HardwareSerial: add other configs than 8N1 Delete jre-8u31.zip.sha Fix Windows build Add boot loader compatible speed of 74880 to serial. update SDK to esp_iot_sdk_v1.0.1_15_04_24 include stdlib_noniso.h in Arduino.h see #110 strnlen implementation missing strn program space wrappers uart_interrupt_handler is now in ram move libm to flash (.irom0.text) saves 3544 Byte in ram see #104 Revert c_types.h fix bug #98 add INPUT_PULLDOWN support add prototypes for ets_vsnprintf and ets_vprintf fix some compiler warnings update SDK to 1.0.1_b2_15_04_10 + SSL Patch update SDK to 1.0.1_b1_15_04_02 add files to ignore (use hardlink) to get git hardware in arduino dir Add method to configure softAP IP address test for #86 add to ESP class: getChipId getSDKversion getBootVersion getBootMode getCPUfreqMHz ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the latest snapshop of the github code it seems the new function
Serial.setDebugOutput(0)
to turn off debug output is not working.
Usage:
I traced the problem down to setDebugOutput() in HardwareSerial.cpp where there is a an if statement
that will fail to do its thing because uart_get_debug() (s_uart_debug_nr) will never be _uart_nr IF the function uart_set_debug() is never called with that value.
All places that uart_set_debug() is called are inside IF statements that wont run, kind of like a catch-22 situation.
Temp Solution
The temporary solution is to run a function that will set s_uart_debug_nr to something that will satisfy the IF statement above:
We can then turn it off,
Serial.setDebugOutput(0);
And it will properly be turned off.
Semi permanent solution
A fix that works in the code comment out the inner IF inside setDebugOutput() as such:
However that may not make the function do whats intended.
True problem
The true problem is that the code inside uart_set_debug() is never run to initialize the settings that function does. Possibly run this function on .begin() to set things to a known state?
Something like:
Another possible solution/error
Or possibly that last line in begin() is a typo and should be
Any one of these will fix the problem, it comes down to what is the intended sequence of the code. I hope this helps get it fixed and helps others.
The text was updated successfully, but these errors were encountered: