@@ -121,7 +121,9 @@ ClockDivAndRange getClockDivAndRange(uint32_t pwm_frequency, uint8_t timer_chann
121121 result.clk_div = TIMER_SOURCE_DIV_1024 ;
122122 }
123123 else {
124+ #if !defined(SIMPLEFOC_DISABLE_DEBUG)
124125 SimpleFOCDebug::println (" DRV: PWM frequency too low" );
126+ #endif
125127 }
126128 return result;
127129};
@@ -181,7 +183,7 @@ bool configureTimerPin(RenesasHardwareDriverParams* params, uint8_t index, bool
181183
182184 // configure timer channel - frequency / top value
183185 ClockDivAndRange timings = getClockDivAndRange (params->pwm_frequency , timer_channel);
184- #if defined(SIMPLEFOC_RENESAS_DEBUG)
186+ #if defined(SIMPLEFOC_RENESAS_DEBUG) && !defined(SIMPLEFOC_DISABLE_DEBUG)
185187 SimpleFOCDebug::println (" ---PWM Config---" );
186188 SimpleFOCDebug::println (" DRV: pwm pin: " , pin);
187189 if (complementary)
@@ -269,7 +271,9 @@ bool configureTimerPin(RenesasHardwareDriverParams* params, uint8_t index, bool
269271 return false ;
270272 }
271273 if (err == FSP_ERR_ALREADY_OPEN ) {
274+ #if !defined(SIMPLEFOC_DISABLE_DEBUG)
272275 SimpleFOCDebug::println (" DRV: timer already open" );
276+ #endif
273277 return false ;
274278 }
275279
@@ -306,12 +310,12 @@ bool startTimerChannels(RenesasHardwareDriverParams* params, int num_channels) {
306310 // return false;
307311 // }
308312 mask |= (1 << params->channels [i]);
309- #if defined(SIMPLEFOC_RENESAS_DEBUG)
313+ #if defined(SIMPLEFOC_RENESAS_DEBUG) && !defined(SIMPLEFOC_DISABLE_DEBUG)
310314 SimpleFOCDebug::println (" DRV: starting timer: " , params->channels [i]);
311315#endif
312316 }
313317 params->timer_config [0 ]->ctrl .p_reg ->GTSTR |= mask;
314- #if defined(SIMPLEFOC_RENESAS_DEBUG)
318+ #if defined(SIMPLEFOC_RENESAS_DEBUG) && !defined(SIMPLEFOC_DISABLE_DEBUG)
315319 SimpleFOCDebug::println (" DRV: timers started" );
316320 #endif
317321 return true ;
0 commit comments