From 98b984b17bf3a56213d8d9e6129be7eaf1eb7bd7 Mon Sep 17 00:00:00 2001 From: windowsair Date: Thu, 20 Jan 2022 15:13:34 +0800 Subject: [PATCH] fix: Eliminating unused gpio function warnings --- components/DAP/include/cmsis_compiler.h | 4 ++++ components/DAP/include/gpio_op.h | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/components/DAP/include/cmsis_compiler.h b/components/DAP/include/cmsis_compiler.h index d448225..e775103 100644 --- a/components/DAP/include/cmsis_compiler.h +++ b/components/DAP/include/cmsis_compiler.h @@ -14,6 +14,10 @@ #define __WEAK __attribute__((weak)) #endif +#ifndef __UNUSED + #define __UNUSED __attribute__((unused)) +#endif + #define GPIO_PIN_REG_0 PERIPHS_IO_MUX_GPIO0_U #define GPIO_PIN_REG_1 PERIPHS_IO_MUX_U0TXD_U #define GPIO_PIN_REG_2 PERIPHS_IO_MUX_GPIO2_U diff --git a/components/DAP/include/gpio_op.h b/components/DAP/include/gpio_op.h index 6c11bd3..013a459 100644 --- a/components/DAP/include/gpio_op.h +++ b/components/DAP/include/gpio_op.h @@ -9,7 +9,7 @@ #include "esp8266/pin_mux_register.h" -__STATIC_INLINE void GPIO_FUNCTION_SET(int io_num) +__STATIC_INLINE __UNUSED void GPIO_FUNCTION_SET(int io_num) { gpio_pin_reg_t pin_reg; @@ -29,7 +29,7 @@ __STATIC_INLINE void GPIO_FUNCTION_SET(int io_num) } -static void GPIO_SET_DIRECTION_NORMAL_OUT(int io_num) +__UNUSED static void GPIO_SET_DIRECTION_NORMAL_OUT(int io_num) { GPIO.enable_w1ts |= (0x1 << io_num); // PP out @@ -37,13 +37,13 @@ static void GPIO_SET_DIRECTION_NORMAL_OUT(int io_num) } -__STATIC_INLINE void GPIO_SET_LEVEL_HIGH(int io_num) +__STATIC_INLINE __UNUSED void GPIO_SET_LEVEL_HIGH(int io_num) { GPIO.out_w1ts |= (0x1 << io_num); } -__STATIC_INLINE void GPIO_SET_LEVEL_LOW(int io_num) +__STATIC_INLINE __UNUSED void GPIO_SET_LEVEL_LOW(int io_num) { GPIO.out_w1tc |= (0x1 << io_num); }