1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(misc): correct the comment and coding style (#2096)

Co-authored-by: Gabor Kiss-Vamosi <kisvegabor@gmail.com>
This commit is contained in:
Xiang Xiao 2021-03-01 06:55:46 -08:00 committed by GitHub
parent 02efef12db
commit 2aacbd5ddd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 30 additions and 34 deletions

View File

@ -133,7 +133,7 @@ lv_res_t lv_img_decoder_open(lv_img_decoder_dsc_t * dsc, const void * src, lv_co
lv_img_decoder_t * d;
_LV_LL_READ(&LV_GC_ROOT(_lv_img_decoder_ll), d) {
/*Info an Open callbacks are required*/
/*Info and Open callbacks are required*/
if(d->info_cb == NULL || d->open_cb == NULL) continue;
res = d->info_cb(d, src, &dsc->header);

View File

@ -14,6 +14,7 @@
#include "../lv_hal/lv_hal_tick.h"
#include "lv_timer.h"
#include "lv_math.h"
#include "lv_mem.h"
#include "lv_gc.h"
/*********************
@ -93,6 +94,7 @@ void lv_anim_start(lv_anim_t * a)
{
TRACE_ANIM("begin");
/* Do not let two animations for the same 'var' with the same 'fp'*/
if(a->exec_cb != NULL) lv_anim_del(a->var, a->exec_cb); /*fp == NULL would delete all animations of var*/
/*If the list is empty the anim task was suspended and it's last run measure is invalid*/

View File

@ -15,7 +15,6 @@ extern "C" {
*********************/
#include "../lv_conf_internal.h"
#include "lv_area.h"
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
@ -431,7 +430,6 @@ extern const lv_anim_path_t lv_anim_path_def;
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif

View File

@ -41,7 +41,6 @@ extern "C" {
} \
} while(0)
#define LV_ASSERT_MSG(expr, msg) \
do { \
if(!(expr)) { \
@ -50,8 +49,6 @@ extern "C" {
} \
} while(0)
/*-----------------
* ASSERTS
*-----------------*/

View File

@ -200,7 +200,6 @@ enum {
#define _LV_COLOR_ZERO_INITIALIZER LV_CONCAT(_LV_COLOR_ZERO_INITIALIZER, LV_COLOR_DEPTH)
#define LV_COLOR_MAKE(r8, g8, b8) LV_CONCAT(LV_COLOR_MAKE, LV_COLOR_DEPTH)(r8, g8, b8)
#define LV_UDIV255(x) ((uint32_t)((uint32_t) (x) * 0x8081) >> 0x17)
/**********************

View File

@ -272,6 +272,7 @@ void * _lv_ll_get_tail(const lv_ll_t * ll_p)
if(ll_p == NULL) return NULL;
return ll_p->tail;
}
/**
* Return with the pointer of the next node after 'n_act'
* @param ll_p pointer to linked list

View File

@ -156,7 +156,7 @@ bool _lv_ll_is_empty(lv_ll_t * ll_p);
* MACROS
**********************/
#define _LV_LL_READ(list, i) for((i) = _lv_ll_get_head(list); i != NULL; (i) = _lv_ll_get_next(list, i))
#define _LV_LL_READ(list, i) for(i = _lv_ll_get_head(list); i != NULL; i = _lv_ll_get_next(list, i))
#define _LV_LL_READ_BACK(list, i) for(i = _lv_ll_get_tail(list); i != NULL; i = _lv_ll_get_prev(list, i))

View File

@ -242,9 +242,9 @@ int32_t lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min_out, int32
if(x <= min_in) return min_out;
/* The equation should be:
* ((x - min_in) * (delta_out / delta_min)) + min_out
* ((x - min_in) * delta_out) / delta in) + min_out
* To avoid rounding error reorder the operations:
* (((x - min_in) * delta_out) / delta in) + min_out
* (x - min_in) * (delta_out / delta_min) + min_out
*/
int32_t delta_in = max_in - min_in;

View File

@ -3,8 +3,8 @@
*
*/
#ifndef LV_H
#define LV_H
#ifndef LV_MATH_H
#define LV_MATH_H
#ifdef __cplusplus
extern "C" {
@ -46,7 +46,6 @@ typedef struct {
*/
LV_ATTRIBUTE_FAST_MEM int16_t lv_trigo_sin(int16_t angle);
static inline LV_ATTRIBUTE_FAST_MEM int16_t lv_trigo_cos(int16_t angle)
{
return lv_trigo_sin(angle + 90);
@ -115,6 +114,7 @@ int32_t lv_map(int32_t x, int32_t min_in, int32_t max_in, int32_t min, int32_t m
* @return return the random number. min <= return_value <= max
*/
uint32_t lv_rand(uint32_t min, uint32_t max);
/**********************
* MACROS
**********************/
@ -135,7 +135,6 @@ uint32_t lv_rand(uint32_t min, uint32_t max);
#define LV_SMAX_OF(t) (((0x1ULL << ((sizeof(t) * 8ULL) - 1ULL)) - 1ULL) | (0x7ULL << ((sizeof(t) * 8ULL) - 4ULL)))
#define LV_MAX_OF(t) ((unsigned long) (LV_IS_SIGNED(t) ? LV_SMAX_OF(t) : LV_UMAX_OF(t)))
#ifdef __cplusplus
} /* extern "C" */
#endif