soc: updates caps usage

We should define caps as 1 if true. When use the caps macros, #if and
 #if ! should be used instead of #ifdef/#ifndef.
This commit is contained in:
Michael (XIAO Xufeng)
2020-09-12 17:58:30 +08:00
parent 647dea9395
commit 1966f00f0b
27 changed files with 53 additions and 60 deletions

View File

@@ -12,13 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef _DRIVER_MCPWM_H_
#define _DRIVER_MCPWM_H_
#pragma once
#include "soc/soc_caps.h"
#ifndef SOC_MCPWM_SUPPORTED
#error MCPWM is not supported in this chip target
#endif
#if SOC_MCPWM_SUPPORTED
#include "esp_err.h"
#include "soc/soc.h"
@@ -664,4 +661,5 @@ esp_err_t mcpwm_isr_register(mcpwm_unit_t mcpwm_num, void (*fn)(void *), void *a
}
#endif
#endif /*_DRIVER_MCPWM_H_*/
#endif //SOC_MCPWM_SUPPORTED

View File

@@ -15,9 +15,7 @@
#pragma once
#include "soc/soc_caps.h"
#ifndef SOC_SDMMC_HOST_SUPPORTED
#error SDMMC host is not supported in this chip target
#endif
#if SOC_SDMMC_HOST_SUPPORTED
#include <stdint.h>
#include <stddef.h>
@@ -245,3 +243,5 @@ esp_err_t sdmmc_host_pullup_en(int slot, int width);
#ifdef __cplusplus
}
#endif
#endif //SOC_SDMMC_HOST_SUPPORTED

View File

@@ -19,9 +19,7 @@ extern "C" {
#endif
#include "soc/soc_caps.h"
#ifndef SOC_TWAI_SUPPORTED
#error TWAI is not supported in this chip target
#endif
#if SOC_TWAI_SUPPORTED
#include "freertos/FreeRTOS.h"
#include "esp_types.h"
@@ -346,3 +344,5 @@ esp_err_t twai_clear_receive_queue(void);
#ifdef __cplusplus
}
#endif
#endif //SOC_TWAI_SUPPORTED