mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
format comments
This commit is contained in:
parent
04be7cc6a6
commit
5d44e66d42
@ -1596,8 +1596,8 @@ uint16_t lv_obj_count_children_recursive(const lv_obj_t * obj)
|
||||
|
||||
LV_LL_READ(obj->child_ll, i)
|
||||
{
|
||||
cnt++; // Count the child
|
||||
cnt += lv_obj_count_children_recursive(i); // recursively count children's children
|
||||
cnt++; /*Count the child*/
|
||||
cnt += lv_obj_count_children_recursive(i); /*recursively count children's children*/
|
||||
}
|
||||
|
||||
return cnt;
|
||||
|
@ -74,13 +74,13 @@ void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, cons
|
||||
deg_test = deg_test_inv;
|
||||
|
||||
if(deg_test(270, start_angle, end_angle))
|
||||
hor_line(center_x - r_out + 1, center_y, mask, thickness - 1, color, opa); // Left Middle
|
||||
hor_line(center_x - r_out + 1, center_y, mask, thickness - 1, color, opa); /*Left Middle*/
|
||||
if(deg_test(90, start_angle, end_angle))
|
||||
hor_line(center_x + r_in, center_y, mask, thickness - 1, color, opa); // Right Middle
|
||||
hor_line(center_x + r_in, center_y, mask, thickness - 1, color, opa); /*Right Middle*/
|
||||
if(deg_test(180, start_angle, end_angle))
|
||||
ver_line(center_x, center_y - r_out + 1, mask, thickness - 1, color, opa); // Top Middle
|
||||
ver_line(center_x, center_y - r_out + 1, mask, thickness - 1, color, opa); /*Top Middle*/
|
||||
if(deg_test(0, start_angle, end_angle))
|
||||
ver_line(center_x, center_y + r_in, mask, thickness - 1, color, opa); // Bottom middle
|
||||
ver_line(center_x, center_y + r_in, mask, thickness - 1, color, opa); /*Bottom middle*/
|
||||
|
||||
uint32_t r_out_sqr = r_out * r_out;
|
||||
uint32_t r_in_sqr = r_in * r_in;
|
||||
@ -177,61 +177,59 @@ static uint16_t fast_atan2(int x, int y)
|
||||
unsigned char negflag;
|
||||
unsigned char tempdegree;
|
||||
unsigned char comp;
|
||||
unsigned int degree; // this will hold the result
|
||||
// signed int x; // these hold the XY vector at the start
|
||||
// signed int y; // (and they will be destroyed)
|
||||
unsigned int degree; /*this will hold the result*/
|
||||
unsigned int ux;
|
||||
unsigned int uy;
|
||||
|
||||
// Save the sign flags then remove signs and get XY as unsigned ints
|
||||
/*Save the sign flags then remove signs and get XY as unsigned ints*/
|
||||
negflag = 0;
|
||||
if(x < 0) {
|
||||
negflag += 0x01; // x flag bit
|
||||
x = (0 - x); // is now +
|
||||
negflag += 0x01; /*x flag bit*/
|
||||
x = (0 - x); /*is now +*/
|
||||
}
|
||||
ux = x; // copy to unsigned var before multiply
|
||||
ux = x; /*copy to unsigned var before multiply*/
|
||||
if(y < 0) {
|
||||
negflag += 0x02; // y flag bit
|
||||
y = (0 - y); // is now +
|
||||
negflag += 0x02; /*y flag bit*/
|
||||
y = (0 - y); /*is now +*/
|
||||
}
|
||||
uy = y; // copy to unsigned var before multiply
|
||||
uy = y; /*copy to unsigned var before multiply*/
|
||||
|
||||
// 1. Calc the scaled "degrees"
|
||||
/*1. Calc the scaled "degrees"*/
|
||||
if(ux > uy) {
|
||||
degree = (uy * 45) / ux; // degree result will be 0-45 range
|
||||
negflag += 0x10; // octant flag bit
|
||||
degree = (uy * 45) / ux; /*degree result will be 0-45 range*/
|
||||
negflag += 0x10; /*octant flag bit*/
|
||||
} else {
|
||||
degree = (ux * 45) / uy; // degree result will be 0-45 range
|
||||
degree = (ux * 45) / uy; /*degree result will be 0-45 range*/
|
||||
}
|
||||
|
||||
// 2. Compensate for the 4 degree error curve
|
||||
/*2. Compensate for the 4 degree error curve*/
|
||||
comp = 0;
|
||||
tempdegree = degree; // use an unsigned char for speed!
|
||||
if(tempdegree > 22) { // if top half of range
|
||||
tempdegree = degree; /*use an unsigned char for speed!*/
|
||||
if(tempdegree > 22) { /*if top half of range*/
|
||||
if(tempdegree <= 44) comp++;
|
||||
if(tempdegree <= 41) comp++;
|
||||
if(tempdegree <= 37) comp++;
|
||||
if(tempdegree <= 32) comp++; // max is 4 degrees compensated
|
||||
} else { // else is lower half of range
|
||||
if(tempdegree <= 32) comp++; /*max is 4 degrees compensated*/
|
||||
} else { /*else is lower half of range*/
|
||||
if(tempdegree >= 2) comp++;
|
||||
if(tempdegree >= 6) comp++;
|
||||
if(tempdegree >= 10) comp++;
|
||||
if(tempdegree >= 15) comp++; // max is 4 degrees compensated
|
||||
if(tempdegree >= 15) comp++; /*max is 4 degrees compensated*/
|
||||
}
|
||||
degree += comp; // degree is now accurate to +/- 1 degree!
|
||||
degree += comp; /*degree is now accurate to +/- 1 degree!
|
||||
|
||||
// Invert degree if it was X>Y octant, makes 0-45 into 90-45
|
||||
if(negflag & 0x10) degree = (90 - degree);
|
||||
/*Invert degree if it was X>Y octant, makes 0-45 into 90-45*/
|
||||
if(negflag & 0x10) degree = (90 - degree);
|
||||
|
||||
// 3. Degree is now 0-90 range for this quadrant,
|
||||
// need to invert it for whichever quadrant it was in
|
||||
if(negflag & 0x02) { // if -Y
|
||||
if(negflag & 0x01) // if -Y -X
|
||||
/*3. Degree is now 0-90 range for this quadrant,*/
|
||||
/*need to invert it for whichever quadrant it was in*/
|
||||
if(negflag & 0x02) { /*if -Y*/
|
||||
if(negflag & 0x01) /*if -Y -X*/
|
||||
degree = (180 + degree);
|
||||
else // else is -Y +X
|
||||
else /*else is -Y +X*/
|
||||
degree = (180 - degree);
|
||||
} else { // else is +Y
|
||||
if(negflag & 0x01) // if +Y -X
|
||||
} else { /*else is +Y*/
|
||||
if(negflag & 0x01) /*if +Y -X*/
|
||||
degree = (360 - degree);
|
||||
}
|
||||
return degree;
|
||||
|
@ -67,10 +67,10 @@ void lv_circ_next(lv_point_t * c, lv_coord_t * tmp)
|
||||
c->y++;
|
||||
|
||||
if(*tmp <= 0) {
|
||||
(*tmp) += 2 * c->y + 1; // Change in decision criterion for y -> y+1
|
||||
(*tmp) += 2 * c->y + 1; /*Change in decision criterion for y -> y+1*/
|
||||
} else {
|
||||
c->x--;
|
||||
(*tmp) += 2 * (c->y - c->x) + 1; // Change for y -> y+1, x -> x-1
|
||||
(*tmp) += 2 * (c->y - c->x) + 1; /*Change for y -> y+1, x -> x-1*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,10 +38,10 @@ typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
MEM_UNIT used : 1; // 1: if the entry is used
|
||||
MEM_UNIT d_size : 31; // Size off the data (1 means 4 bytes)
|
||||
MEM_UNIT used : 1; /* 1: if the entry is used*/
|
||||
MEM_UNIT d_size : 31; /* Size off the data (1 means 4 bytes)*/
|
||||
} s;
|
||||
MEM_UNIT header; // The header (used + d_size)
|
||||
MEM_UNIT header; /* The header (used + d_size)*/
|
||||
} lv_mem_header_t;
|
||||
|
||||
typedef struct
|
||||
@ -130,16 +130,16 @@ void * lv_mem_alloc(uint32_t size)
|
||||
/*Use the built-in allocators*/
|
||||
lv_mem_ent_t * e = NULL;
|
||||
|
||||
// Search for a appropriate entry
|
||||
/* Search for a appropriate entry*/
|
||||
do {
|
||||
// Get the next entry
|
||||
/* Get the next entry*/
|
||||
e = ent_get_next(e);
|
||||
|
||||
/*If there is next entry then try to allocate there*/
|
||||
if(e != NULL) {
|
||||
alloc = ent_alloc(e, size);
|
||||
}
|
||||
// End if there is not next entry OR the alloc. is successful
|
||||
/* End if there is not next entry OR the alloc. is successful*/
|
||||
} while(e != NULL && alloc == NULL);
|
||||
|
||||
#else
|
||||
|
@ -207,7 +207,6 @@ lv_img_dsc_t * lv_canvas_get_img(lv_obj_t * canvas)
|
||||
*/
|
||||
const lv_style_t * lv_canvas_get_style(const lv_obj_t * canvas, lv_canvas_style_t type)
|
||||
{
|
||||
// lv_canvas_ext_t * ext = lv_obj_get_ext_attr(canvas);
|
||||
const lv_style_t * style = NULL;
|
||||
|
||||
switch(type) {
|
||||
|
@ -416,7 +416,7 @@ static void lv_gauge_draw_needle(lv_obj_t * gauge, const lv_area_t * mask)
|
||||
for(i = 0; i < ext->needle_count; i++) {
|
||||
/*Calculate the end point of a needle*/
|
||||
int16_t needle_angle =
|
||||
(ext->values[i] - min) * angle * (1 << LV_GAUGE_INTERPOLATE_SHIFT) / (max - min); //+ angle_ofs;
|
||||
(ext->values[i] - min) * angle * (1 << LV_GAUGE_INTERPOLATE_SHIFT) / (max - min);
|
||||
|
||||
int16_t needle_angle_low = (needle_angle >> LV_GAUGE_INTERPOLATE_SHIFT) + angle_ofs;
|
||||
int16_t needle_angle_high = needle_angle_low + 1;
|
||||
|
@ -1045,10 +1045,6 @@ static void tabview_realign(lv_obj_t * tabview)
|
||||
lv_cont_set_fit2(ext->content, LV_FIT_TIGHT, LV_FIT_NONE);
|
||||
lv_cont_set_layout(ext->content, LV_LAYOUT_ROW_T);
|
||||
lv_obj_set_height(ext->content, lv_obj_get_height(tabview) - lv_obj_get_height(ext->btns));
|
||||
|
||||
// lv_obj_set_height(ext->btns, 3 * LV_DPI / 4);
|
||||
|
||||
// lv_obj_set_width(ext->indic, LV_DPI);
|
||||
break;
|
||||
case LV_TABVIEW_BTNS_POS_BOTTOM:
|
||||
lv_obj_align(ext->content, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user