Skip to content

if there exists three timing tasks,such as 1ms, 5ms and 10ms, how to schedule them? #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
anghd opened this issue Jun 6, 2022 · 2 comments

Comments

@anghd
Copy link

anghd commented Jun 6, 2022

No description provided.

@emre108
Copy link
Owner

emre108 commented Jun 6, 2022

Hi,

First you need to init the timers;
SoftTimer_Init(eTimerID1,100); // 250ms
SoftTimer_Init(eTimerID2,500); // 100ms

than in systick timer handler or any other timer handler which is set to 1 ms period, you need to include SoftTimer_ISR(); function. Then you can track time with this condition SoftTimer[i].timeout=set; . If it is set it means the period you initialize the timer has passed.

@emre108
Copy link
Owner

emre108 commented Jun 6, 2022

Sorry for the comment lines. They are wrong. They need to be ->
SoftTimer_Init(eTimerID1,100); // 100ms
SoftTimer_Init(eTimerID2,500); // 500ms
In your case it is ;
SoftTimer_Init(eTimerID1,1); // 1ms
SoftTimer_Init(eTimerID2,5); // 5ms
SoftTimer_Init(eTimerID3,10); // 10ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants