Replace display_port_busy_t with bool

This commit is contained in:
C47D 2021-10-01 12:11:28 -05:00
parent 3c5a4061d9
commit d627884887
2 changed files with 7 additions and 13 deletions

View file

@ -40,16 +40,16 @@ void display_port_gpio_rst(lv_disp_drv_t *drv, uint8_t state)
#endif #endif
} }
display_port_busy_t display_port_gpio_is_busy(lv_disp_drv_t *drv) bool display_port_gpio_is_busy(lv_disp_drv_t *drv)
{ {
(void) drv; (void) drv;
display_port_busy_t device_busy = DISPLAY_PORT_DEVICE_NOT_BUSY; bool device_busy = false;
#ifdef CONFIG_LV_DISP_PIN_BUSY #ifdef CONFIG_LV_DISP_PIN_BUSY
/* FIXME Assuming the busy signal in logic 1 means the device is busy */ /* FIXME Assuming the busy signal in logic 1 means the device is busy */
if (gpio_get_level(CONFIG_LV_DISP_PIN_BUSY) == 1) { if (gpio_get_level(CONFIG_LV_DISP_PIN_BUSY) == 1) {
device_busy = DISPLAY_PORT_DEVICE_IS_BUSY; device_busy = true;
} }
#endif #endif

View file

@ -12,13 +12,8 @@ extern "C"
#include "lvgl/lvgl.h" #include "lvgl/lvgl.h"
#endif #endif
/** Display is busy port #include <stdint.h>
* Useful for eink displays that need to poll their BUSY signal */ #include <stdbool.h>
typedef enum {
DISPLAY_PORT_DEVICE_NOT_BUSY,
DISPLAY_PORT_DEVICE_IS_BUSY,
/* NOTE Operation should not be interrupted when the device is busy */
} display_port_busy_t;
/** /**
* Busy wait delay port * Busy wait delay port
@ -57,10 +52,9 @@ void display_port_gpio_rst(lv_disp_drv_t *drv, uint8_t state);
* *
* @param drv Pointer to driver See @ref lv_disp_drv_t * @param drv Pointer to driver See @ref lv_disp_drv_t
* *
* @retval Returns DISPLAY_PORT_DEVICE_NOT_BUSY when display is not busy, * @retval Returns false when display is not busy, true otherwise.
* DISPLAY_PORT_DEVICE_IS_BUSY otherwise.
*/ */
display_port_busy_t display_port_gpio_is_busy(lv_disp_drv_t *drv); bool display_port_gpio_is_busy(lv_disp_drv_t *drv);
#ifdef __cplusplus #ifdef __cplusplus
} /* extern "C" */ } /* extern "C" */