Skip to content

Commit

Permalink
first steps to arduino esp32 rel 3.0.0 migration
Browse files Browse the repository at this point in the history
  • Loading branch information
gin66 committed Jun 5, 2024
1 parent 11d4872 commit 0c1d96e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/StepperDemo/StepperDemo.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1159,7 +1159,15 @@ bool process_cmd(char *cmd) {
#if defined(ARDUINO_ARCH_ESP32)
if (strcmp(cmd, "eset") == 0) {
SerialInterface.println("ESP reset");
#if defined(ARDUINO_ESP32_RELEASE_3_0_0)
esp_task_wdt_config_t wdt_config;
wdt_config.idle_core_mask = 1<<1;
wdt_config.timeout_ms = 100;
wdt_config.trigger_panic = false;
esp_task_wdt_init(&wdt_config);
#else
esp_task_wdt_init(1, true);
#endif
esp_task_wdt_add(NULL);
while (true)
;
Expand Down
13 changes: 13 additions & 0 deletions src/fas_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,35 @@ struct queue_end_s {
//==========================================================================

#if CONFIG_IDF_TARGET_ESP32
#include "core_version.h"
#ifdef ARDUINO_ESP32_RELEASE_3_0_0
#include <driver/mcpwm_prelude.h>
#include <driver/pulse_cnt.h>
#else
#include <driver/mcpwm.h>
#include <driver/pcnt.h>
#endif
#include <soc/mcpwm_reg.h>
#include <soc/mcpwm_struct.h>
#include <soc/pcnt_reg.h>
#include <soc/pcnt_struct.h>

#if defined(ARDUINO_ESP32_RELEASE_3_0_0)
#define SUPPORT_ESP32_RMT
#else
#define SUPPORT_ESP32_MCPWM_PCNT
#define SUPPORT_ESP32_RMT
#endif
#include <driver/rmt.h>
#define QUEUES_MCPWM_PCNT 6
#define QUEUES_RMT 8

#if defined(ARDUINO_ESP32_RELEASE_3_0_0)
#else
// have support for pulse counter
#define SUPPORT_ESP32_PULSE_COUNTER
#define FAS_RMT_MEM(channel) ((uint32_t *)RMT_CHANNEL_MEM(channel))
#endif

//==========================================================================
//
Expand Down

0 comments on commit 0c1d96e

Please sign in to comment.