Skip to content

Commit

Permalink
issue #2513
Browse files Browse the repository at this point in the history
  • Loading branch information
240617 committed Sep 23, 2024
1 parent 416abe4 commit 1882b92
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions sys/rt-thread/port/u8g2_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,6 @@ static struct rt_i2c_bus_device *i2c_bus = RT_NULL;
#if defined U8G2_USE_HW_SPI
static struct rt_spi_device u8g2_spi_dev;

static inline void u8g2_port_pin_mode(uint8_t pin, rt_uint8_t mode)
{
if(pin != U8X8_PIN_NONE)
{
rt_pin_mode(pin, mode);
}
}

static inline void u8g2_port_pin_write(uint8_t pin, uint8_t value)
{
if(pin != U8X8_PIN_NONE)
{
rt_pin_write(pin, value);
}
}

static inline int u8g2_port_pin_read(uint8_t pin)
{
if(pin != U8X8_PIN_NONE)
{
return rt_pin_read(pin);
}

return 0;
}

int rt_hw_spi_config(uint8_t spi_mode, uint32_t max_hz, uint8_t cs_pin )
{
rt_err_t res;
Expand Down Expand Up @@ -78,6 +52,33 @@ int rt_hw_spi_config(uint8_t spi_mode, uint32_t max_hz, uint8_t cs_pin )
}
#endif /* U8G2_USE_HW_SPI */


static inline void u8g2_port_pin_mode(uint8_t pin, rt_uint8_t mode)
{
if(pin != U8X8_PIN_NONE)
{
rt_pin_mode(pin, mode);
}
}

static inline void u8g2_port_pin_write(uint8_t pin, uint8_t value)
{
if(pin != U8X8_PIN_NONE)
{
rt_pin_write(pin, value);
}
}

static inline int u8g2_port_pin_read(uint8_t pin)
{
if(pin != U8X8_PIN_NONE)
{
return rt_pin_read(pin);
}

return 0;
}

uint8_t u8x8_gpio_and_delay_rtthread(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int, void *arg_ptr)
{
uint8_t i;
Expand Down

0 comments on commit 1882b92

Please sign in to comment.