Skip to content

Commit 0b2e287

Browse files
committed
WIP
1 parent 3319cee commit 0b2e287

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

ports/esp32/esp32_mcpwm.c

+9
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@
4040
#include "mphalport.h"
4141
#include "esp_err.h"
4242

43+
#if 1 // MICROPY_DEBUG_VERBOSE // print debugging info
44+
#define DEBUG_PRINT (1)
45+
#define DEBUG_printf DEBUG_printf
46+
#else // don't print debugging info
47+
#define DEBUG_PRINT (0)
48+
#define DEBUG_printf(...) (void)0
49+
#endif
50+
4351
#if SOC_MCPWM_SUPPORTED
4452

4553
// #if SOC_TEMP_SENSOR_SUPPORTED
@@ -575,6 +583,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(mcpwm_duty_ns_obj, 1, 2, mcpwm_duty_n
575583

576584
STATIC void configure_mcpwm(esp32_mcpwm_obj_t *self) {
577585
MP_DEBUG_PRINT(6, "configure_mcpwm() group_id=%d resolution_hz=%d period_ticks=%d action=%d", self->group_id, self->resolution_hz, self->period_ticks, self->action);
586+
DEBUG_printf("configure_mcpwm() group_id=%d resolution_hz=%d period_ticks=%d action=%d\n", self->group_id, self->resolution_hz, self->period_ticks, self->action);
578587

579588
mcpwm_timer_config_t timer_config = {
580589
.group_id = self->group_id,

ports/esp32/mpconfigport.h

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
#define MICROPY_STREAMS_POSIX_API (1)
5555
#define MICROPY_USE_INTERNAL_ERRNO (0) // errno.h from xtensa-esp32-elf/sys-include/sys
5656
#define MICROPY_USE_INTERNAL_PRINTF (0) // ESP32 SDK requires its own printf
57+
#define MICROPY_DEBUG_PRINTERS (1)
58+
#define MICROPY_DEBUG_VERBOSE (0)
5759
#define MICROPY_SCHEDULER_DEPTH (8)
5860
#define MICROPY_VFS (1)
5961

0 commit comments

Comments
 (0)