GithubHelp home page GithubHelp logo

multitimer's Issues

为什么重复执行的定时器不在MultiTimerYield执行重新启动,在回调函数容易漏掉

为什么重复执行的定时器不在MultiTimerYield执行重新启动,在回调函数容易漏掉
增加排序功能很好,但是去掉了重复执行功能啊,单片机又很多都是要重复执行的定时器
增加可重复执行功能
struct MultiTimerHandle {
MultiTimer* next;
uint64_t deadline;
MultiTimerCallback_t callback;
void* userData;
uint64_t interval; //记录间隔
uint8_t repeat; //重复执行标记
};
//根据repeat标志重新启动定时器
if (entry->repeat) {
MultiTimerStart(entry, entry->interval, entry->callback, entry->userData, entry->repeat)
}

提点需求,希望能完善该项目

  1. 支持其他线程在我这个定时器里创建任务
  2. 支持定时任务的循环执行,每隔一个timeout就执行一次
  3. 支持在定时器任务回调里创建新的定时器任务

如果作者允许的话,我可以为该工程实现以上需求,谢谢!

PlatformTicksGetFunc() 系统时间溢出怎么处理

用的8位机不支持uint64_t,只支持uint32_t,用的ms定时器累加计时tick
uint32_t tick;
void Timer0_IRQHandler(void) interrupt TMR0_VECTOR
{
tick++;
TH0 =(65536-4000)>>8 ;
TL0 = 65536-4000;
}
请问tick溢出时,PlatformTicksGetFunc中需要做何种处理,
还是说我只需要将tick置0

超时溢出有问题

99
_timer_ticks 是一个无符号数, 假如是一个无符号8位,当_timer_ticks为254,我超时为2m, target->timeout此时为0吧,这时候判断感觉出现问题了,会立马导致超时事件发生

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.