mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-30 23:51:54 +08:00
This commit is contained in:
+6
-16
@@ -23,11 +23,6 @@ extern "C" {
|
|||||||
#include "../misc/lv_area.h"
|
#include "../misc/lv_area.h"
|
||||||
#include "../misc/lv_ll.h"
|
#include "../misc/lv_ll.h"
|
||||||
#include "../misc/lv_timer.h"
|
#include "../misc/lv_timer.h"
|
||||||
#include "../misc/lv_types.h"
|
|
||||||
|
|
||||||
#if LV_USE_ATOMICS == 1
|
|
||||||
#include <stdatomic.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@@ -52,11 +47,6 @@ struct _lv_disp_t;
|
|||||||
struct _lv_disp_drv_t;
|
struct _lv_disp_drv_t;
|
||||||
struct _lv_theme_t;
|
struct _lv_theme_t;
|
||||||
|
|
||||||
#if LV_USE_ATOMICS == 1
|
|
||||||
#define FLUSHING_TYPE atomic_int
|
|
||||||
#else
|
|
||||||
#define FLUSHING_TYPE volatile int
|
|
||||||
#endif
|
|
||||||
/**
|
/**
|
||||||
* Structure for holding display buffer information.
|
* Structure for holding display buffer information.
|
||||||
*/
|
*/
|
||||||
@@ -67,13 +57,13 @@ typedef struct _lv_disp_draw_buf_t {
|
|||||||
/*Internal, used by the library*/
|
/*Internal, used by the library*/
|
||||||
void * buf_act;
|
void * buf_act;
|
||||||
uint32_t size; /*In pixel count*/
|
uint32_t size; /*In pixel count*/
|
||||||
FLUSHING_TYPE flushing;
|
/*1: flushing is in progress. (It can't be a bit field because when it's cleared from IRQ Read-Modify-Write issue might occur)*/
|
||||||
/*It was the last chunk to flush. (It can't be a bit field because when it's cleared from IRQ Read-Modify-Write issue might occur)*/
|
volatile int flushing;
|
||||||
FLUSHING_TYPE flushing_last;
|
/*1: It was the last chunk to flush. (It can't be a bit field because when it's cleared from IRQ Read-Modify-Write issue might occur)*/
|
||||||
uint32_t last_area : 1; /*1: the last area is being rendered*/
|
volatile int flushing_last;
|
||||||
uint32_t last_part : 1; /*1: the last part of the current area is being rendered*/
|
volatile uint32_t last_area : 1; /*1: the last area is being rendered*/
|
||||||
|
volatile uint32_t last_part : 1; /*1: the last part of the current area is being rendered*/
|
||||||
} lv_disp_draw_buf_t;
|
} lv_disp_draw_buf_t;
|
||||||
#undef FLUSHING_TYPE
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
LV_DISP_ROT_NONE = 0,
|
LV_DISP_ROT_NONE = 0,
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
#include "lv_hal_tick.h"
|
#include "lv_hal_tick.h"
|
||||||
#include "../misc/lv_types.h"
|
|
||||||
#include <stdatomic.h>
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#if LV_TICK_CUSTOM == 1
|
#if LV_TICK_CUSTOM == 1
|
||||||
@@ -31,13 +29,8 @@
|
|||||||
* STATIC VARIABLES
|
* STATIC VARIABLES
|
||||||
**********************/
|
**********************/
|
||||||
#if !LV_TICK_CUSTOM
|
#if !LV_TICK_CUSTOM
|
||||||
#if LV_USE_ATOMICS == 1
|
static uint32_t sys_time = 0;
|
||||||
static _Atomic(uint32_t) sys_time = 0;
|
static volatile uint8_t tick_irq_flag;
|
||||||
static atomic_int tick_irq_flag;
|
|
||||||
#else
|
|
||||||
static volatile uint32_t sys_time = 0;
|
|
||||||
static volatile int tick_irq_flag;
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
|
|||||||
@@ -32,15 +32,6 @@ extern "C" {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*Use atomics instead of volatile variables for state which is potentially shared between threads, as long as
|
|
||||||
*the compiler supports it.*/
|
|
||||||
#if (defined(__cplusplus) && __cplusplus >= 201103L)\
|
|
||||||
|| (__STDC_VERSION__ >= 201112L && !defined(__STDC_NO_ATOMICS__))
|
|
||||||
#define LV_USE_ATOMICS 1
|
|
||||||
#else
|
|
||||||
#define LV_USE_ATOMICS 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* TYPEDEFS
|
* TYPEDEFS
|
||||||
**********************/
|
**********************/
|
||||||
|
|||||||
Reference in New Issue
Block a user