0
0
Fork 0

fix: Eliminating unused gpio function warnings

This commit is contained in:
windowsair 2022-01-20 15:13:34 +08:00
parent a321da8fb6
commit 98b984b17b
2 changed files with 8 additions and 4 deletions

View File

@ -14,6 +14,10 @@
#define __WEAK __attribute__((weak)) #define __WEAK __attribute__((weak))
#endif #endif
#ifndef __UNUSED
#define __UNUSED __attribute__((unused))
#endif
#define GPIO_PIN_REG_0 PERIPHS_IO_MUX_GPIO0_U #define GPIO_PIN_REG_0 PERIPHS_IO_MUX_GPIO0_U
#define GPIO_PIN_REG_1 PERIPHS_IO_MUX_U0TXD_U #define GPIO_PIN_REG_1 PERIPHS_IO_MUX_U0TXD_U
#define GPIO_PIN_REG_2 PERIPHS_IO_MUX_GPIO2_U #define GPIO_PIN_REG_2 PERIPHS_IO_MUX_GPIO2_U

View File

@ -9,7 +9,7 @@
#include "esp8266/pin_mux_register.h" #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; 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); GPIO.enable_w1ts |= (0x1 << io_num);
// PP out // 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); 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); GPIO.out_w1tc |= (0x1 << io_num);
} }