diff --git a/src/fas_arch/arduino_esp32.h b/src/fas_arch/arduino_esp32.h index df53756f..7456de91 100644 --- a/src/fas_arch/arduino_esp32.h +++ b/src/fas_arch/arduino_esp32.h @@ -146,4 +146,17 @@ // have more than one core #define SUPPORT_CPU_AFFINITY +#ifdef __ESP32_IDF_V44__ +#include +#include +#endif /* __ESP32_IDF_V44__ */ + +//========================================================================== +// determine, if driver type selection should be supported +#if defined(QUEUES_MCPWM_PCNT) && defined(QUEUES_RMT) +#if (QUEUES_MCPWM_PCNT > 0) && (QUEUES_RMT > 0) +#define SUPPORT_SELECT_DRIVER_TYPE +#endif +#endif + #endif /* FAS_ARCH_ARDUINO_ESP32_H */ diff --git a/src/fas_arch/espidf_esp32.h b/src/fas_arch/espidf_esp32.h index d9912591..df27e517 100644 --- a/src/fas_arch/espidf_esp32.h +++ b/src/fas_arch/espidf_esp32.h @@ -76,4 +76,17 @@ #define FAS_RMT_MEM(channel) ((uint32_t *)RMT_CHANNEL_MEM(channel)) #endif +#ifdef __ESP32_IDF_V44__ +#include +#include +#endif /* __ESP32_IDF_V44__ */ + +//========================================================================== +// determine, if driver type selection should be supported +#if defined(QUEUES_MCPWM_PCNT) && defined(QUEUES_RMT) +#if (QUEUES_MCPWM_PCNT > 0) && (QUEUES_RMT > 0) +#define SUPPORT_SELECT_DRIVER_TYPE +#endif +#endif + #endif /* FAS_ARCH_ESPIDF_ESP32_H */ diff --git a/src/fas_common.h b/src/fas_common.h index 3ecded66..a909955a 100644 --- a/src/fas_common.h +++ b/src/fas_common.h @@ -1,5 +1,5 @@ -#ifndef COMMON_H -#define COMMON_H +#ifndef FAS_COMMON_H +#define FAS_COMMON_H #define TICKS_FOR_STOPPED_MOTOR 0xffffffff @@ -60,75 +60,34 @@ struct queue_end_s { // All architecture specific definitions should be located here //============================================================================== -// disable inject_fill_interrupt() for all real devices -#ifndef TEST -#define inject_fill_interrupt(x) -#endif - -//========================================================================== -// -// The TEST "architecture" is in use with pc_based testing. -// -// //========================================================================== #if defined(TEST) +// TEST "architecture" is in use with pc_based testing. #include "fas_arch/test_pc.h" -//========================================================================== -// -// This for ESP32 derivates using arduino core -// -//========================================================================== #elif defined(ARDUINO_ARCH_ESP32) +// ESP32 derivates using arduino core #include "fas_arch/arduino_esp32.h" -//========================================================================== -// -// This for ESP32 derivates using espidf -// -// This is most likely broken and not tested on github actions -// -//========================================================================== #elif defined(ESP_PLATFORM) +// ESP32 derivates using espidf #include "fas_arch/espidf_esp32.h" -//========================================================================== -// -// This for SAM-architecture -// -//========================================================================== #elif defined(ARDUINO_ARCH_SAM) +// SAM-architecture #include "fas_arch/arduino_sam.h" -//========================================================================== -// -// This for the AVR family -// -//========================================================================== #elif defined(ARDUINO_ARCH_AVR) +// AVR family #include "fas_arch/arduino_avr.h" -//========================================================================== -// -// For all unsupported devices -// -//========================================================================== #else #error "Unsupported devices" - #endif -#ifdef __ESP32_IDF_V44__ -#include -#include -#endif /* __ESP32_IDF_V44__ */ - -//========================================================================== -// determine, if driver type selection should be supported -#if defined(QUEUES_MCPWM_PCNT) && defined(QUEUES_RMT) -#if (QUEUES_MCPWM_PCNT > 0) && (QUEUES_RMT > 0) -#define SUPPORT_SELECT_DRIVER_TYPE -#endif +// disable inject_fill_interrupt() for all real devices. Only defined in TEST +#ifndef inject_fill_interrupt +#define inject_fill_interrupt(x) #endif -#endif /* COMMON_H */ +#endif /* FAS_COMMON_H */