Debugging Confusion

I have confused myself surrounding debug. Reading the Docs here:

Debugging | Arduino-FOC I set up a .PIO flag for:

SIMPLEFOC_DISABLE_DEBUG
-D SIMPLEFOC_DISABLE_DEBUG

My goal is to disable serial prints such that I can use the serial port for a CRC + COBS protocol. I of course wish to re-enable for troubleshooting.

I am using an STM32F401 and I think… I am running into serial prints specific to the STM32. Basically my flag is still allowing serial prints form the SimpleFOC library during the motor alignment and current reading startup.

I think the feedback I am looking for is:

  1. Yes, there are two different build flags between SimpleFOC librarys and some of the STM32 specific librarys.
  2. Possible alternate to going through the library and creating If DEF cases around each STM32 print….
  3. Ask questions that will reveal the blinding obvious

Regardless of the build flag, it shouldn’t print anything unless you call SimpleFOCDebug::enable();. And if it’s somehow getting enabled without your explicitly doing so, try calling SimpleFOCDebug::enable(NULL); to disable it.

Hey!
This is a bug. We’ve not really been checking this for some time now and the SIMPLEFOC_DISABLE_DEBUG did not work well for a couple of releases.

The dev branch fixes it since a month or two. So you can check it out if you want.

The new release is close so the dev branch is a lot different format he master though. No real change in the api but there are a lot of changes under the hood.