File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff line change 77Print* SimpleFOCDebug::_debugPrint = NULL ;
88
99
10- void SimpleFOCDebug::enable (Print* debugPrint) {
10+ void SIMPLEFOC_DEBUG_ENABLE (Print* debugPrint) {
1111 _debugPrint = debugPrint;
1212}
1313
Original file line number Diff line number Diff line change 3434
3535// #define SIMPLEFOC_DISABLE_DEBUG
3636
37- #ifndef SIMPLEFOC_DISABLE_DEBUG
3837
38+ #ifndef SIMPLEFOC_DISABLE_DEBUG
3939class SimpleFOCDebug {
4040public:
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
You can’t perform that action at this time.
0 commit comments