Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

408 feature support for arduino esp32 v301 #411

Merged
merged 7 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/communication/SimpleFOCDebug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void SimpleFOCDebug::println(const __FlashStringHelper* str) {
}
}


void SimpleFOCDebug::println(const char* str, float val) {
if (_debugPrint != NULL) {
_debugPrint->print(str);
Expand Down Expand Up @@ -86,6 +87,20 @@ void SimpleFOCDebug::print(const __FlashStringHelper* str) {
}
}

void SimpleFOCDebug::print(const StringSumHelper str) {
if (_debugPrint != NULL) {
_debugPrint->print(str.c_str());
}
}


void SimpleFOCDebug::println(const StringSumHelper str) {
if (_debugPrint != NULL) {
_debugPrint->println(str.c_str());
}
}



void SimpleFOCDebug::print(int val) {
if (_debugPrint != NULL) {
Expand Down
4 changes: 3 additions & 1 deletion src/communication/SimpleFOCDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@
**/


#ifndef SIMPLEFOC_DISABLE_DEBUG
#ifndef SIMPLEFOC_DISABLE_DEBUG

class SimpleFOCDebug {
public:
static void enable(Print* debugPrint = &Serial);

static void println(const __FlashStringHelper* msg);
static void println(const StringSumHelper msg);
static void println(const char* msg);
static void println(const __FlashStringHelper* msg, float val);
static void println(const char* msg, float val);
Expand All @@ -52,6 +53,7 @@ class SimpleFOCDebug {

static void print(const char* msg);
static void print(const __FlashStringHelper* msg);
static void print(const StringSumHelper msg);
static void print(int val);
static void print(float val);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "esp32_adc_driver.h"

#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && defined(SOC_MCPWM_SUPPORTED) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3)
#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && defined(SOC_MCPWM_SUPPORTED) && !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32S3) && !defined(SIMPLEFOC_ESP32_USELEDC) && 0

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "Arduino.h"

#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && defined(SOC_MCPWM_SUPPORTED)
#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && defined(SOC_MCPWM_SUPPORTED) && !defined(SIMPLEFOC_ESP32_USELEDC) && 0
/*
* Get ADC value for pin
* */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "../../hardware_api.h"
#include "../../../drivers/hardware_api.h"

#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && !defined(SOC_MCPWM_SUPPORTED)
#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && (!defined(SOC_MCPWM_SUPPORTED) || defined(SIMPLEFOC_ESP32_USELEDC))

#include "esp32_adc_driver.h"

Expand Down
2 changes: 1 addition & 1 deletion src/current_sense/hardware_specific/esp32/esp32_mcu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "../../../drivers/hardware_api.h"
#include "../../../drivers/hardware_specific/esp32/esp32_driver_mcpwm.h"

#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && defined(SOC_MCPWM_SUPPORTED) && !defined(SIMPLEFOC_ESP32_USELEDC)
#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && defined(SOC_MCPWM_SUPPORTED) && !defined(SIMPLEFOC_ESP32_USELEDC) && 0

#include "esp32_adc_driver.h"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "esp32_adc_driver.h"

#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && defined(SOC_MCPWM_SUPPORTED) && (defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3))
#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && defined(SOC_MCPWM_SUPPORTED) && (defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32S3)) && !defined(SIMPLEFOC_ESP32_USELEDC) && 0

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
Expand Down
3 changes: 0 additions & 3 deletions src/drivers/hardware_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
#define SIMPLEFOC_PWM_LOWSIDE_ACTIVE_HIGH true
#endif




// flag returned if driver init fails
#define SIMPLEFOC_DRIVER_INIT_FAILED ((void*)-1)

Expand Down
Loading
Loading