loogg / agile_led Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU Lesser General Public License v2.1
License: GNU Lesser General Public License v2.1
如果同一个pin,多次调用agile_led_create,因为agile_led_t *led = (agile_led_t *)rt_malloc(sizeof(agile_led_t));调用之前没有判断pin是否被占用,会导致再次对该pin执行creat,而上一次create的led内存未被释放掉,所以可能导致内存泄漏。
当然,您在example中首先判断了led是否为NULL,但如果在create内部做好判断并返回相应提示将更加健壮。
另外,建议led 加入链表放在create中,从链表中删除放在delete中,同时active enable放在start中,disable放在stop中,这样逻辑更清晰。
button中存在同样问题。
led的软件我已经修改完了,您要是感兴趣可以传给你看看
I run example_agile_led example. And when I run led_set_mode cmd, this bug happened at agile_led_default_compelete_callback function.
LOG_D("led pin:%d compeleted.", led->pin);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.