[Error] _lv_inv_area: detected modifying dirty areas in render (in lv_refr.c line #212)

在使用LVGL库频繁修改标签时遇到错误,问题源于修改脏区域时的并发冲突。解决方法是在调用lv_task_handler前后使用互斥锁(mutex),确保在多任务环境中LVGL函数的调用安全,防止同时访问导致的错误。通过正确使用互斥锁,可以在实际的多任务环境中顺利运行LVGL。

使用lvgl库频繁修改标签时出现错误

[Error] (2.470, +2470)   _lv_inv_area: detected modifying dirty areas in render         (in lv_refr.c line #212)

 如果需要使用实际的任务或线程,则需要一个互斥锁,该互斥锁应在调用 lv_task_handler 之前被调用,并在其之后释放。同样,必须在与每个LVGL(lv _...)相关的函数调用和代码周围的其他任务和线程中使用相同的互斥锁。这样,就可以在真正的多任务环境中使用LVGL。只需使用互斥锁(mutex)即可避免同时调用 LVGL 函数。

例如如下 上锁、解锁 操作

**** Build of configuration Debug for project kcsj **** "C:\\ti\\ccsv8\\utils\\bin\\gmake" -k -j 16 all -O Building file: "../main.c" Invoking: C5500 Compiler "C:/ti/bin/cl55" -v5509A --memory_model=large -g --include_path="C:/Users/57-cosIN/Desktop/DSPks/kcsj" --include_path="C:/ti/include" --define=c5509a --display_error_number --diag_warning=225 --ptrdiff_size=32 --preproc_with_compile --preproc_dependency="main.d_raw" "../main.c" >> Compilation failure subdir_rules.mk:9: recipe for target 'main.obj' failed "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl.h", line 1: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl.h", line 2: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_pll.h", line 1: error #20: identifier "PLL_Config" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_pll.h", line 2: error #29: expected an expression "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_pll.h", line 3: error #29: expected an expression "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_pll.h", line 4: error #29: expected an expression "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_pll.h", line 6: error #80: expected a type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_pll.h", line 6: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_pll.h", line 7: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 1: error #20: identifier "TIMER_Config" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 2: error #29: expected an expression "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 3: error #29: expected an expression "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 4: error #29: expected an expression "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 7: warning #12-D: parsing restarts here after previous syntax error "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 8: error #20: identifier "TIMER_CTL_CP_PULSE" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 9: error #20: identifier "TIMER_CTL_HLD_YES" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 10: error #20: identifier "TIMER_CTL_GO_RESET" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 11: error #20: identifier "TIMER_CTL_PWID_ONE" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 12: error #20: identifier "TIMER_CTL_DATOUT_0" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 13: error #20: identifier "TIMER_CTL_INVOUT_NO" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 14: error #20: identifier "TIMER_CTL_FUNC_GPIO" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 15: error #68: expected a "}" "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 18: error #20: identifier "TIMER_handle" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 18: error #20: identifier "TIMER_open" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 18: error #60: function call is not allowed in a constant expression "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 18: error #20: identifier "TIMER_DEV0" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 18: error #20: identifier "TIMER_OPEN_RESET" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 19: error #41: expected an identifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 19: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 19: error #93: identifier-list parameters may only be used in a function definition "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 20: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_timer.h", line 20: error #93: identifier-list parameters may only be used in a function definition "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 1: error #20: identifier "MCBSP_Config" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 2: error #29: expected an expression "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 5: warning #12-D: parsing restarts here after previous syntax error "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 6: error #20: identifier "MCBSP_SPCR_GRST_YES" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 7: error #20: identifier "MCBSP_SPCR_XINTM_FRAME" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 8: error #20: identifier "MCBSP_SPCR_XRST_YES" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 9: error #20: identifier "MCBSP_SPCR_DLB_OFF" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 10: error #20: identifier "MCBSP_SPCR_RJUST_RZF" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 11: error #20: identifier "MCBSP_SPCR_CLKSTP_NONE" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 12: error #20: identifier "MCBSP_SPCR_DXENA_OFF" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 13: error #20: identifier "MCBSP_SPCR_RINTM_FRAME" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 14: error #20: identifier "MCBSP_SPCR_RRST_YES" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 15: error #68: expected a "}" "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 24: warning #12-D: parsing restarts here after previous syntax error "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 26: error #20: identifier "MCBSP_handle" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 26: error #20: identifier "MCBSP_open" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 26: error #60: function call is not allowed in a constant expression "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 26: error #20: identifier "MCBSP_DEV1" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 26: error #20: identifier "MCBSP_OPEN_RESET" is undefined "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 27: error #41: expected an identifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 27: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 27: error #93: identifier-list parameters may only be used in a function definition "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 28: error #18: expected a ")" "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 28: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_mcbsp.h", line 28: error #93: identifier-list parameters may only be used in a function definition "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 1: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 4: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 4: error #93: identifier-list parameters may only be used in a function definition "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 5: error #41: expected an identifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 5: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 5: error #93: identifier-list parameters may only be used in a function definition "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 6: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 6: error #93: identifier-list parameters may only be used in a function definition "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 8: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 8: error #93: identifier-list parameters may only be used in a function definition "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 9: warning #78-D: this declaration has no storage class or type specifier "C:/Users/57-cosIN/Desktop/DSPks/kcsj/csl_irq.h", line 14: warning #225-D: function declared implicitly "../main.c", line 31: warning #225-D: function declared implicitly "../main.c", line 32: warning #225-D: function declared implicitly "../main.c", line 42: error #249: function "timer_isr" has already been defined "../main.c", line 48: warning #225-D: function declared implicitly "../main.c", line 55: warning #225-D: function declared implicitly "../main.c", line 45: warning #552-D: variable "len" was set but never used "../main.c", line 60: error #249: function "main" has already been defined "../main.c", line 65: warning #176-D: expression has no effect "../main.c", line 65: error #66: expected a ";" "../main.c", line 69: warning #12-D: parsing restarts here after previous syntax error "../main.c", line 70: error #20: identifier "pllConfig" is undefined "../main.c", line 73: error #20: identifier "MCBSP_Config" is undefined "../main.c", line 76: error #29: expected an expression "../main.c", line 77: error #20: identifier "MCBSP_DEV0" is undefined "../main.c", line 79: warning #225-D: function declared implicitly "../main.c", line 80: warning #225-D: function declared implicitly "../main.c", line 83: error #20: identifier "TIMER_Config" is undefined "../main.c", line 84: error #29: expected an expression "../main.c", line 85: error #29: expected an expression "../main.c", line 86: error #29: expected an expression "../main.c", line 89: warning #12-D: parsing restarts here after previous syntax error "../main.c", line 92: error #20: identifier "TIMER_CTL_GO_NO" is undefined "../main.c", line 93: error #20: identifier "TIMER_CTL_TMOD_32BIT" is undefined "../main.c", line 94: error #68: expected a "}" "../main.c", line 101: warning #225-D: function declared implicitly "../main.c", line 101: error #20: identifier "IRQ_EVT_TINT0" is undefined "../main.c", line 103: warning #225-D: function declared implicitly 66 errors detected in the compilation of "../main.c". gmake: *** [main.obj] Error 1 gmake: Target 'all' not remade because of errors. **** Build Finished **** 报错
12-06
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值