-
Notifications
You must be signed in to change notification settings - Fork 4
Allow compilation in absence of RS485 library #54
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An #include
directive for ArduinoRS485.h
should be added to examples/Logger/Logger.ino
. The file already contains a conditional directive for the Opta, so that can be moved to above the #include
directive for Arduino_UnifiedStorage.h
line and the #include <ArduinoRS485.h>
placed inside that conditional.
An #include
directive for ArduinoRS485.h
should also be added to the sketches under extras/test
.
#include <Arduino_UnifiedStorage.h> | ||
|
||
void setup(){ | ||
debugPrint("I'm alive!"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debugPrint("I'm alive!"); | |
Arduino_UnifiedStorage::debugPrint("I'm alive!"); |
@@ -65,3 +65,16 @@ This limitation only affects Portenta C33 boards. | |||
## 📖 Documentation | |||
|
|||
For more information about this library please read the documentation [here](./docs). | |||
|
|||
## 🐛 Debugging | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of two methods are typically used to debug programs: | |
- Adding code to print program status information to the serial port (e.g., `Serial.print` calls), which can be viewed in [Serial Monitor](https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-serial-monitor) | |
- "[In-circuit emulation](https://en.wikipedia.org/wiki/In-circuit_emulation)" using a debug probe and [debugger](https://en.wikipedia.org/wiki/Debugger) | |
Add an introductory overview. This will make it easier for the reader to understand the nature of the dilemma presented in the subsequent sentences.
|
||
## 🐛 Debugging | ||
|
||
Printing debug messages over the USB Serial port is not possible when the USB port is used for data storage operations. On Arduino Opta this is the only accessible option however, since no JTAG connector is exposed. Therefore you need to resort to the RS485 connector to see the output of your messages. To do so you can use the `debugPrint` function from this library. In order to make it work you will have to install the `ArduinoRS485` library beforehand and add the corresponding header in your sketch above the include for this library. e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Printing debug messages over the USB Serial port is not possible when the USB port is used for data storage operations. On Arduino Opta this is the only accessible option however, since no JTAG connector is exposed. Therefore you need to resort to the RS485 connector to see the output of your messages. To do so you can use the `debugPrint` function from this library. In order to make it work you will have to install the `ArduinoRS485` library beforehand and add the corresponding header in your sketch above the include for this library. e.g. | |
Printing debug messages over the USB Serial port is not possible when the USB port is used for data storage operations. When using Arduino Opta, the alternative "in-circuit emulation" approach is also unavailable due to not having an exposed JTAG connector. Therefore in order to debug programs on the Opta you must resort to using the RS485 connector to see the output of your messages. To do so you can use the `debugPrint` function from this library. In order to make it work you will have to install the `ArduinoRS485` library beforehand and add an `#include` directive for that library in your sketch above the include for this library. e.g. |
- Reference information provided by the overview I proposed.
- Make it more clear that the information re: RS-485 is specific to Opta.
- Minor improvements to wording.
This PR allows to compile on Opta without the need to install the ArduinoRS485 library. ArduinoRS485 is only needed for debugging USB storage which occupies the USB port so debug prints need to go through RS485.