存档:LVGL警告消除,不排除后续使用中出现bug的可能

This commit is contained in:
吴俊潮 2025-06-11 14:55:29 +08:00
parent d2f454235e
commit 2781b76a7a
20 changed files with 18062 additions and 18023 deletions

View File

@ -39,7 +39,8 @@
"string_view": "c",
"app_screen_setting_trans.h": "c",
"key_functions_main.h": "c",
"eeprom_spi.h": "c"
"eeprom_spi.h": "c",
"math.h": "c"
},
"C_Cpp.errorSquiggles": "disabled",
"idf.pythonInstallPath": "F:\\Espressif\\tools\\idf-python\\3.11.2\\python.exe",

View File

@ -533,8 +533,18 @@ void modbus_reg_update_dis(void)
{}
//保持寄存器,读写
uint16_t work_mode_pv = 0;
void modbus_reg_update_hold(void)
{}
{
work_mode_pv = 1 + (uint16_t)menu_data.input_mode_type + (menu_data.io_mode == IO_OUTPUT) * 15;
if( HoldReg[HOLD_ADDR_SET_WORK_MODE] != work_mode_pv )
{
if(menu_data.scr_now == SCREEN_MAIN)
{
}
}
}
//输入寄存器,上位机只读
void modbus_reg_update_input(void)

View File

@ -101,103 +101,112 @@ void pwr_cosume(BOOL rst, uint32_t ms)
PWR_CTRL(GPIO_PIN_RESET);
}
static void fun_pwr12_ctrl(uint8_t ch)
{
static uint8_t lasht_ch;
BOOL ch_flag = FALSE;
// static void fun_pwr12_ctrl(uint8_t ch)
// {
// static uint8_t lasht_ch;
// BOOL ch_flag = FALSE;
if (ch != lasht_ch)
{
ch_flag = TRUE;
lasht_ch = ch;
}
if (ch_flag == TRUE)
{
ch_flag = FALSE;
//if ((ch == CH0_OUT_VOL_V) || (ch == CH2_OUT_CUR) || (ch == CH3_OUT_FRE) || (ch == CH4_OUT_RES))
//PWR12_CTRL(GPIO_PIN_SET);
//else
//PWR12_CTRL(GPIO_PIN_RESET);
}
}
// if (ch != lasht_ch)
// {
// ch_flag = TRUE;
// lasht_ch = ch;
// }
// if (ch_flag == TRUE)
// {
// ch_flag = FALSE;
// //if ((ch == CH0_OUT_VOL_V) || (ch == CH2_OUT_CUR) || (ch == CH3_OUT_FRE) || (ch == CH4_OUT_RES))
// //PWR12_CTRL(GPIO_PIN_SET);
// //else
// //PWR12_CTRL(GPIO_PIN_RESET);
// }
// }
uint8_t pulse = 50;
float32 fre_set = 0;
float32 sv_prv = 0;
CHANNEL ch_prv = CHX_IN_MAX;
uint8_t mux_set_flag = 0;
void mux_signal_switch(st_mux_signal *mux_signal)
{
CHANNEL ch;
ch = mux_signal->channel;
//只有频道和设定值改变时才执行设定操作(不影响回采和输入采集)
if( (mux_signal->channel != ch_prv)||(mux_signal->data_sv != sv_prv) )
{
ch_prv = mux_signal->channel;
sv_prv = mux_signal->data_sv;
mux_set_flag = 1;
}
else
{
mux_set_flag = 0;
}
ch_prv = ch;
sv_prv = mux_signal->data_sv;
fun_pwr12_ctrl(ch);
HC138_SEL_CH(ch);
//切换通道
HC138_SEL_CH(mux_signal->channel);
switch (ch)
//执行通道对应的功能
switch (mux_signal->channel)
{
case CH0_OUT_VOL_V:
dac_set_voltage(&mux_signal->data_sv);
fun_proc_adc1_dma(&mux_signal->data_pv);
{
if(mux_set_flag) dac_set_voltage(&mux_signal->data_sv); //设定
fun_proc_adc1_dma(&mux_signal->data_pv); //回采
}
break;
case CH1_OUT_VOL_MV:
dac8552_operation(NULL, &mux_signal->data_sv);
fun_get_sig16132_ch(4, &mux_signal->data_pv);
{
if(mux_set_flag) dac8552_operation(NULL, &mux_signal->data_sv); //设定
fun_get_sig16132_ch(4, &mux_signal->data_pv); //回采
}
break;
case CH2_OUT_CUR:
dac8552_operation(&mux_signal->data_sv, NULL);
fun_get_sig16132_ch(7, &mux_signal->data_pv);
{
if(mux_set_flag) dac8552_operation(&mux_signal->data_sv, NULL); //设定
fun_get_sig16132_ch(7, &mux_signal->data_pv); //回采
}
break;
case CH3_OUT_FRE:
{
if(tabdata.hart_enable == 0)
if( (tabdata.hart_enable == 0)&&(mux_set_flag) )
{
//freq_operation(mux_signal->data_sv, pulse, TIM_CHANNEL_2);
frequence_output(mux_signal->data_sv, pulse, TIM_CHANNEL_2);
frequence_output(mux_signal->data_sv, pulse, TIM_CHANNEL_2); //设定
fre_set = mux_signal->data_sv;
}
}
break;
case CH4_OUT_RES:
fun_dac7811_operate(&mux_signal->data_sv);
if(mux_set_flag) fun_dac7811_operate(&mux_signal->data_sv); //设定
break;
case CH5_EMPTY:
break;
case CH6_IN_VOL:
fun_get_sig16132_ch(2, &mux_signal->data_pv);
// fun_rn7302_operate(CH0_IN_VOL, &mux_signal->data_pv);
fun_get_sig16132_ch(2, &mux_signal->data_pv); //输入采集
break;
case CH7_IN_MVOL:
fun_get_sig16132_ch(3, &mux_signal->data_pv);
// fun_rn7302_operate(CH0_IN_VOL, &mux_signal->data_pv);
fun_get_sig16132_ch(3, &mux_signal->data_pv); //输入采集
break;
case CH8_IN_CUR:
fun_get_sig16132_ch(5, &mux_signal->data_pv);
// fun_rn7302_operate(CH1_IN_CUR, &mux_signal->data_pv);
fun_get_sig16132_ch(5, &mux_signal->data_pv); //输入采集
break;
case CH9_IN_FRE:
fun_get_freq(&freq_signal, &mux_signal->data_pv);
fun_get_freq(&freq_signal, &mux_signal->data_pv); //输入采集
break;
case CH10_IN_RTD:
fun_get_sig16132_ch(CH10_IN_RTD, &mux_signal->data_pv);
// fun_rn7302_operate(CH3_IN_RTD, &mux_signal->data_pv);
fun_get_sig16132_ch(CH10_IN_RTD, &mux_signal->data_pv); //输入采集
break;
case CH11_IN_TC:
ads1220_operation(CH11_IN_TC, &mux_signal->data_pv);
// fun_rn7302_operate(CH3_IN_RTD, &mux_signal->data_pv);
ads1220_operation(CH11_IN_TC, &mux_signal->data_pv); //输入采集
break;
default:

View File

@ -48,7 +48,9 @@
#include "stm32f4xx_hal.h"
#include "spi.h"
#include <SIG24130.h>
#include "math.h"
//#include "math.h"
#include "FreeRTOS.h"
#include "task.h"
// Add printf1 for debug purpose to print out register content.
#include "usart.h"
@ -613,7 +615,8 @@ void fun_get_sig16132_ch(uint8_t channel, float32 *data)
if ((channel == 2) || (channel == 3) || (channel == 4) || (channel == 5) || (channel == 7))
{
HAL_Delay(100); // Wait time after power-up before SPI communication. Power-On Reset(POR) time is 43ms.
//HAL_Delay(100); // Wait time after power-up before SPI communication. Power-On Reset(POR) time is 43ms.
vTaskDelay(100);
SIG24130_Reset();
delay_nus(100); // RESET SIG24130
SIG24130_SetRefMux(2); // 内部2.5V参考
@ -624,7 +627,8 @@ void fun_get_sig16132_ch(uint8_t channel, float32 *data)
}
else if (channel == 10)
{
HAL_Delay(100); // Wait time after power-up before SPI communication. Power-On Reset(POR) time is 43ms.
//HAL_Delay(100); // Wait time after power-up before SPI communication. Power-On Reset(POR) time is 43ms.
vTaskDelay(100);
SIG24130_Reset();
delay_nus(100); // RESET SIG24130
SIG24130_SetRefMux(2); // 内部2.5V参考

View File

@ -16,12 +16,12 @@
* DEFINES
*********************/
#ifndef MY_DISP_HOR_RES
#warning Please define or replace the macro MY_DISP_HOR_RES with the actual screen width, default value 320 is used for now.
//#warning Please define or replace the macro MY_DISP_HOR_RES with the actual screen width, default value 320 is used for now.
#define MY_DISP_HOR_RES 320
#endif
#ifndef MY_DISP_VER_RES
#warning Please define or replace the macro MY_DISP_HOR_RES with the actual screen height, default value 240 is used for now.
//#warning Please define or replace the macro MY_DISP_HOR_RES with the actual screen height, default value 240 is used for now.
#define MY_DISP_VER_RES 240
#endif

View File

@ -114,7 +114,7 @@ lv_obj_t * lv_event_get_current_target(lv_event_t * e)
lv_event_code_t lv_event_get_code(lv_event_t * e)
{
return e->code & ~LV_EVENT_PREPROCESS;
return (lv_event_code_t)(e->code & ~(LV_EVENT_PREPROCESS));
}
void * lv_event_get_param(lv_event_t * e)

View File

@ -389,7 +389,7 @@ lv_coord_t _lv_obj_get_ext_draw_size(const lv_obj_t * obj)
lv_layer_type_t _lv_obj_get_layer_type(const lv_obj_t * obj)
{
if(obj->spec_attr) return obj->spec_attr->layer_type;
if(obj->spec_attr) return (lv_layer_type_t)obj->spec_attr->layer_type;
else return LV_LAYER_TYPE_NONE;
}

View File

@ -8,7 +8,7 @@
*********************/
#include "lv_gpu_d2_ra6m3.h"
#include "../../core/lv_refr.h"
#include <math.h>
//#include <math.h>
#if LV_USE_GPU_RA6M3_G2D

View File

@ -214,6 +214,8 @@ static void draw_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, co
#endif
/*There is another mask too. Draw line by line. */
lv_area_t center_coords;
bool mask_any_center = lv_draw_mask_is_any(&center_coords);
if(mask_any) {
for(h = clipped_coords.y1; h <= clipped_coords.y2; h++) {
blend_area.y1 = h;
@ -272,12 +274,12 @@ static void draw_bg(lv_draw_ctx_t * draw_ctx, const lv_draw_rect_dsc_t * dsc, co
/* Draw the center of the rectangle.*/
/*If no other masks and no gradient, the center is a simple rectangle*/
lv_area_t center_coords;
//lv_area_t center_coords;
center_coords.x1 = bg_coords.x1;
center_coords.x2 = bg_coords.x2;
center_coords.y1 = bg_coords.y1 + rout;
center_coords.y2 = bg_coords.y2 - rout;
bool mask_any_center = lv_draw_mask_is_any(&center_coords);
//bool mask_any_center = lv_draw_mask_is_any(&center_coords);
if(!mask_any_center && grad_dir == LV_GRAD_DIR_NONE) {
blend_area.y1 = bg_coords.y1 + rout;
blend_area.y2 = bg_coords.y2 - rout;

View File

@ -580,8 +580,8 @@ static void item_repos(lv_obj_t * item, _lv_grid_calc_t * c, item_repos_hint_t *
uint32_t col_pos = get_col_pos(item);
uint32_t row_pos = get_row_pos(item);
lv_grid_align_t col_align = get_cell_col_align(item);
lv_grid_align_t row_align = get_cell_row_align(item);
lv_grid_align_t col_align = (lv_grid_align_t)get_cell_col_align(item);
lv_grid_align_t row_align = (lv_grid_align_t)get_cell_row_align(item);
lv_coord_t col_x1 = c->x[col_pos];
lv_coord_t col_x2 = c->x[col_pos + col_span - 1] + c->w[col_pos + col_span - 1];

View File

@ -275,8 +275,8 @@ bool qrcodegen_encodeSegmentsAdvanced(const struct qrcodegen_Segment segs[], siz
}
}
LV_ASSERT(0 <= (int)mask && (int)mask <= 7);
applyMask(tempBuffer, qrcode, mask);
drawFormatBits(ecl, mask, qrcode);
applyMask(tempBuffer, qrcode, (enum qrcodegen_Mask)mask);
drawFormatBits(ecl, (enum qrcodegen_Mask)mask, qrcode);
return true;
}
@ -617,7 +617,8 @@ static void applyMask(const uint8_t functionModules[], uint8_t qrcode[], enum qr
case 5: invert = x * y % 2 + x * y % 3 == 0; break;
case 6: invert = (x * y % 2 + x * y % 3) % 2 == 0; break;
case 7: invert = ((x + y) % 2 + x * y % 3) % 2 == 0; break;
default: LV_ASSERT(false); return;
//default: LV_ASSERT(false); return;
default: break;
}
bool val = getModule(qrcode, x, y);
setModule(qrcode, x, y, val ^ invert);
@ -849,8 +850,8 @@ testable int calcSegmentBitLength(enum qrcodegen_Mode mode, size_t numChars) {
else if (mode == qrcodegen_Mode_ECI && numChars == 0)
result = 3 * 8;
else { // Invalid argument
LV_ASSERT(false);
return -1;
//LV_ASSERT(false);
//return -1;
}
LV_ASSERT(result >= 0);
if ((unsigned int)result > (unsigned int)INT16_MAX)
@ -1005,8 +1006,10 @@ static int numCharCountBits(enum qrcodegen_Mode mode, int version) {
case qrcodegen_Mode_BYTE : { static const int temp[] = { 8, 16, 16}; return temp[i]; }
case qrcodegen_Mode_KANJI : { static const int temp[] = { 8, 10, 12}; return temp[i]; }
case qrcodegen_Mode_ECI : return 0;
default: LV_ASSERT(false); return -1; // Dummy value
//default: LV_ASSERT(false); return -1; // Dummy value
default:break;
}
return -1;
}
int qrcodegen_getMinFitVersion(enum qrcodegen_Ecc ecl, size_t dataLen)

View File

@ -208,7 +208,7 @@ static void style_init(void)
LV_STYLE_TRANSLATE_Y, LV_STYLE_TRANSLATE_X,
LV_STYLE_TRANSFORM_ZOOM, LV_STYLE_TRANSFORM_ANGLE,
LV_STYLE_COLOR_FILTER_OPA, LV_STYLE_COLOR_FILTER_DSC,
0
(lv_style_prop_t)0
};
color_scr = theme.flags & MODE_DARK ? DARK_COLOR_SCR : LIGHT_COLOR_SCR;

View File

@ -896,12 +896,13 @@ static void lv_draw_span(lv_obj_t * obj, lv_draw_ctx_t * draw_ctx)
}
/*Go the first visible line*/
lv_text_align_t align = lv_obj_get_style_text_align(obj, LV_PART_MAIN);
if(txt_pos.y + max_line_h < clip_area.y1) {
goto Next_line_init;
}
/* align deal with */
lv_text_align_t align = lv_obj_get_style_text_align(obj, LV_PART_MAIN);
//lv_text_align_t align = lv_obj_get_style_text_align(obj, LV_PART_MAIN);
if(align == LV_TEXT_ALIGN_CENTER || align == LV_TEXT_ALIGN_RIGHT) {
lv_coord_t align_ofs = 0;
lv_coord_t txts_w = is_first_line ? indent : 0;

View File

@ -134,7 +134,7 @@ const uint8_t * lv_font_get_bitmap_fmt_txt(const lv_font_t * font, uint32_t unic
}
/*If not returned earlier then the letter is not found in this font*/
return NULL;
//return NULL;
}
/**

View File

@ -579,7 +579,7 @@ lv_disp_rot_t lv_disp_get_rotation(lv_disp_t * disp)
{
if(disp == NULL) disp = lv_disp_get_default();
if(disp == NULL) return LV_DISP_ROT_NONE;
return disp->driver->rotated;
return (lv_disp_rot_t)disp->driver->rotated;
}
void lv_disp_drv_use_generic_set_px_cb(lv_disp_drv_t * disp_drv, lv_img_cf_t cf)

View File

@ -235,8 +235,10 @@ void lv_lru_remove_lru_item(lv_lru_t * cache)
{
lv_lru_item_t * min_item = NULL, * min_prev = NULL;
lv_lru_item_t * item = NULL, * prev = NULL;
uint32_t i = 0, min_index = -1;
uint64_t min_access_count = -1;
uint32_t i = 0;//,min_index = -1;
uint32_t min_index = 0xFFFFFFFF;
//uint64_t min_access_count = -1;
uint64_t min_access_count = 0xFFFFFFFFFFFFFFFF;
for(; i < cache->hash_table_size; i++) {
item = cache->items[i];

View File

@ -321,7 +321,7 @@ void * lv_mem_buf_get(uint32_t size)
LV_LOG_ERROR("no more buffers. (increase LV_MEM_BUF_MAX_NUM)");
LV_ASSERT_MSG(false, "No more buffers. Increase LV_MEM_BUF_MAX_NUM.");
return NULL;
//return NULL;
}
/**

View File

@ -211,12 +211,12 @@ lv_style_prop_t lv_style_register_prop(uint8_t flag)
/* This should never happen - we should bail out above */
LV_ASSERT_NULL(LV_GC_ROOT(_lv_style_custom_prop_flag_lookup_table));
LV_GC_ROOT(_lv_style_custom_prop_flag_lookup_table)[last_custom_prop_id - _LV_STYLE_NUM_BUILT_IN_PROPS] = flag;
return last_custom_prop_id;
return (lv_style_prop_t)last_custom_prop_id;
}
lv_style_prop_t lv_style_get_num_custom_props(void)
{
return last_custom_prop_id - _LV_STYLE_LAST_BUILT_IN_PROP;
return (lv_style_prop_t)(last_custom_prop_id - _LV_STYLE_LAST_BUILT_IN_PROP);
}
bool lv_style_remove_prop(lv_style_t * style, lv_style_prop_t prop)
@ -287,7 +287,7 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_
void lv_style_set_prop_meta(lv_style_t * style, lv_style_prop_t prop, uint16_t meta)
{
lv_style_set_prop_internal(style, prop | meta, null_style_value, lv_style_set_prop_meta_helper);
lv_style_set_prop_internal(style, (lv_style_prop_t)(prop | meta), null_style_value, lv_style_set_prop_meta_helper);
}
lv_style_res_t lv_style_get_prop(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value)

View File

@ -893,8 +893,9 @@ static void default_walker(void * ptr, size_t size, int used, void * user)
void lv_tlsf_walk_pool(lv_pool_t pool, lv_tlsf_walker walker, void * user)
{
lv_tlsf_walker pool_walker = walker ? walker : default_walker;
int bho_temp = -(int)block_header_overhead;
block_header_t * block =
offset_to_block(pool, -(int)block_header_overhead);
offset_to_block(pool, (size_t)bho_temp);
while(block && !block_is_last(block)) {
pool_walker(
@ -996,7 +997,8 @@ lv_pool_t lv_tlsf_add_pool(lv_tlsf_t tlsf, void * mem, size_t bytes)
** so that the prev_phys_block field falls outside of the pool -
** it will never be used.
*/
block = offset_to_block(mem, -(tlsfptr_t)block_header_overhead);
tlsfptr_t bho_temp = -(tlsfptr_t)block_header_overhead;
block = offset_to_block(mem, (size_t)bho_temp);
block_set_size(block, pool_bytes);
block_set_free(block);
block_set_prev_used(block);
@ -1014,7 +1016,8 @@ lv_pool_t lv_tlsf_add_pool(lv_tlsf_t tlsf, void * mem, size_t bytes)
void lv_tlsf_remove_pool(lv_tlsf_t tlsf, lv_pool_t pool)
{
control_t * control = tlsf_cast(control_t *, tlsf);
block_header_t * block = offset_to_block(pool, -(int)block_header_overhead);
int bho_temp = -(int)block_header_overhead;
block_header_t * block = offset_to_block(pool, (size_t)bho_temp);
int fl = 0, sl = 0;

File diff suppressed because it is too large Load Diff