From 8ce92e0692ec13a5c981c9dc4dc35eb018ce7e73 Mon Sep 17 00:00:00 2001 From: askuric Date: Sat, 22 Jun 2024 12:36:01 +0200 Subject: [PATCH] restructured imports --- .../hardware_specific/esp32/esp32_adc_driver.cpp | 6 ++++-- .../hardware_specific/esp32/esp32_adc_driver.h | 2 -- .../hardware_specific/esp32/esp32_mcpwm_mcu.cpp | 4 +--- src/current_sense/hardware_specific/esp32/esp32_mcu.cpp | 7 +------ src/current_sense/hardware_specific/esp32/esp32_mcu.h | 4 ++-- 5 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/current_sense/hardware_specific/esp32/esp32_adc_driver.cpp b/src/current_sense/hardware_specific/esp32/esp32_adc_driver.cpp index 649343f1..b9594918 100644 --- a/src/current_sense/hardware_specific/esp32/esp32_adc_driver.cpp +++ b/src/current_sense/hardware_specific/esp32/esp32_adc_driver.cpp @@ -1,8 +1,8 @@ -#include "esp32_adc_driver.h" -#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) #include "esp32_mcu.h" +#include "esp32_adc_driver.h" +#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) #define SIMPLEFOC_ADC_ATTEN ADC_11db #define SIMPLEFOC_ADC_RES 12 @@ -138,6 +138,8 @@ uint16_t IRAM_ATTR adcRead(uint8_t pin) #else // if others just use analogRead +#pragma message("SimpleFOC: Using analogRead for ADC reading, no fast ADC configuration available!") + uint16_t IRAM_ATTR adcRead(uint8_t pin){ return analogRead(pin); } diff --git a/src/current_sense/hardware_specific/esp32/esp32_adc_driver.h b/src/current_sense/hardware_specific/esp32/esp32_adc_driver.h index f41904d8..688b6d5a 100644 --- a/src/current_sense/hardware_specific/esp32/esp32_adc_driver.h +++ b/src/current_sense/hardware_specific/esp32/esp32_adc_driver.h @@ -1,8 +1,6 @@ #ifndef SIMPLEFOC_ESP32_HAL_ADC_DRIVER_H_ #define SIMPLEFOC_ESP32_HAL_ADC_DRIVER_H_ -#include "Arduino.h" - #if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && defined(SOC_MCPWM_SUPPORTED) && !defined(SIMPLEFOC_ESP32_USELEDC) /** diff --git a/src/current_sense/hardware_specific/esp32/esp32_mcpwm_mcu.cpp b/src/current_sense/hardware_specific/esp32/esp32_mcpwm_mcu.cpp index 7efb6294..33d547db 100644 --- a/src/current_sense/hardware_specific/esp32/esp32_mcpwm_mcu.cpp +++ b/src/current_sense/hardware_specific/esp32/esp32_mcpwm_mcu.cpp @@ -1,5 +1,4 @@ -#include "../../hardware_api.h" -#include "../../../drivers/hardware_api.h" +#include "esp32_mcu.h" #if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) && defined(SOC_MCPWM_SUPPORTED) && !defined(SIMPLEFOC_ESP32_USELEDC) @@ -10,7 +9,6 @@ #error SimpleFOC: ESP-IDF version 4 or lower detected. Please update to ESP-IDF 5.x and Arduino-esp32 3.0 (or higher) #endif -#include "esp32_mcu.cpp" #include "../../../drivers/hardware_specific/esp32/esp32_driver_mcpwm.h" #include "../../../drivers/hardware_specific/esp32/mcpwm_private.h" diff --git a/src/current_sense/hardware_specific/esp32/esp32_mcu.cpp b/src/current_sense/hardware_specific/esp32/esp32_mcu.cpp index 9cf3a271..e5ed3fbf 100644 --- a/src/current_sense/hardware_specific/esp32/esp32_mcu.cpp +++ b/src/current_sense/hardware_specific/esp32/esp32_mcu.cpp @@ -1,11 +1,6 @@ -#include "../../hardware_api.h" -#include "../../../drivers/hardware_api.h" - -#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) - -#include "esp32_adc_driver.h" #include "esp32_mcu.h" +#if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) /** * Inline adc reading implementation diff --git a/src/current_sense/hardware_specific/esp32/esp32_mcu.h b/src/current_sense/hardware_specific/esp32/esp32_mcu.h index b50c3113..9207fb6a 100644 --- a/src/current_sense/hardware_specific/esp32/esp32_mcu.h +++ b/src/current_sense/hardware_specific/esp32/esp32_mcu.h @@ -1,12 +1,12 @@ #ifndef ESP32_MCU_CURRENT_SENSING_H #define ESP32_MCU_CURRENT_SENSING_H +#include "../../hardware_api.h" #if defined(ESP_H) && defined(ARDUINO_ARCH_ESP32) -#include "../../hardware_api.h" -#include "../../../drivers/hardware_api.h" +#include "../../../drivers/hardware_api.h" #include "esp32_adc_driver.h"