Skip to content

Commit 7058955

Browse files
committed
leonardo compile with debug disbled
1 parent 1676c15 commit 7058955

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

.github/workflows/arduino.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ jobs:
4141

4242
- arduino-boards-fqbn: arduino:avr:leonardo # arduino leonardo - one full example
4343
sketch-names: open_loop_position_example.ino
44+
build-properties:
45+
build.extra_flags: -D SIMPLEFOC_DISABLE_DEBUG
4446

4547
- arduino-boards-fqbn: arduino:avr:mega # arduino mega2660 - one full example
4648
sketch-names: single_full_control_example.ino

src/common/trajectory.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "trajectory.h"
22

3-
// for more information about the trapezoidal profile, see https://en.wikipedia.org/wiki/Trapezoidal_velocity_profile
3+
// for more information about the trapezoidal profile, see https://mechatronics.studio/blog/bang-bang-motion-profile/
4+
// and the main motivation :D - https://www.youtube.com/watch?v=qYJpl7SNow
45

56
// Resets the trapezoidal profile state to the current position and velocity,
67
// and sets the target position.

src/communication/SimpleFOCDebug.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Print* SimpleFOCDebug::_debugPrint = NULL;
88

99

10-
void SimpleFOCDebug::enable(Print* debugPrint) {
10+
void SIMPLEFOC_DEBUG_ENABLE(Print* debugPrint) {
1111
_debugPrint = debugPrint;
1212
}
1313

src/communication/SimpleFOCDebug.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434

3535
// #define SIMPLEFOC_DISABLE_DEBUG
3636

37-
#ifndef SIMPLEFOC_DISABLE_DEBUG
3837

38+
#ifndef SIMPLEFOC_DISABLE_DEBUG
3939
class SimpleFOCDebug {
4040
public:
4141
static void enable(Print* debugPrint = &Serial);
@@ -66,10 +66,15 @@ class SimpleFOCDebug {
6666
#define SIMPLEFOC_DEBUG(msg, ...) \
6767
SimpleFOCDebug::println(F(msg), ##__VA_ARGS__)
6868

69+
#define SIMPLEFOC_DEBUG_ENABLE(printer) \
70+
SIMPLEFOC_DEBUG_ENABLE(printer)
71+
6972
#else //ifndef SIMPLEFOC_DISABLE_DEBUG
7073

7174
#define SIMPLEFOC_DEBUG(msg, ...)
7275

76+
#define SIMPLEFOC_DEBUG_ENABLE(printer)
77+
7378

7479
#endif //ifndef SIMPLEFOC_DISABLE_DEBUG
7580
#endif

0 commit comments

Comments
 (0)