Skip to content

Commit

Permalink
restructured imports
Browse files Browse the repository at this point in the history
  • Loading branch information
askuric committed Jun 22, 2024
1 parent a1bd20e commit 8ce92e0
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 0 additions & 2 deletions src/current_sense/hardware_specific/esp32/esp32_adc_driver.h
Original file line number Diff line number Diff line change
@@ -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)

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -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)

Expand All @@ -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"

Expand Down
7 changes: 1 addition & 6 deletions src/current_sense/hardware_specific/esp32/esp32_mcu.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/current_sense/hardware_specific/esp32/esp32_mcu.h
Original file line number Diff line number Diff line change
@@ -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"


Expand Down

0 comments on commit 8ce92e0

Please sign in to comment.