Skip to content
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

tmgr library fix (now need testing) #39

Merged
merged 9 commits into from
Jan 12, 2014
Merged

tmgr library fix (now need testing) #39

merged 9 commits into from
Jan 12, 2014

Conversation

webconn
Copy link
Collaborator

@webconn webconn commented Oct 19, 2013

Commit 0e4d8aa

@nekromant
Copy link
Owner

I quickly looked through your code, so here goes my small code rant^Wreview:
Style:
0. All commits should have tmgr: prefix on the first line. This makes easier to find what subsystem has been affected by your work.

  1. Do NOT use // for comments, only /* comment */. We are at least trying to follow Linux kernel coding style, and they are prohibited.
  2. Identation is not Linux kernel style.

RTFM: https://www.kernel.org/doc/Documentation/CodingStyle

You can also use checkstyle.pl from linux kernel dist (running this against the rest of the code is still a big TODO)
The rest:
3. Protect atomic parts of your code with ANTARES_DISABLE_IRQS/ANTARES_ENABLE_IRQS defined in arch/antares.h. This is the cross-mcu friendly way to do that, now supported by most architectures.
4. NULL is checked and defined if necessary in generic/macros.h, just use that header. No need to duplicate that.
5. Most architectures (gcc-based at least) can strip unneeded functions, so it's safe to ditch CONFIG_LIB_TMGR_EXTRA. SDCC can't do that, but they are not a very big overhead anyway compared to the whole library. Just implement ticks to seconds and vice versa conversions via preprocessor macros.
6. Remove any remaining TODOs
7. Add doc/ru/tmgr.txt and doc/en/tmgr.txt with some documentation and guidelines.

Once your fix that stuff I'll give it a try to compile against different architectures to see if it works fine and merge. Thanks.

@webconn
Copy link
Collaborator Author

webconn commented Jan 7, 2014

Now timers looks more like in Linux kernel. Check it out and see docs. Now it needs testing!

@nekromant
Copy link
Owner

Looks a lot better. Unfortunately, I can't test it right now since I'm in Minsk till the end of the holidays.
I'll see to it once I'm back. Besides, as far as I remember this one requires also proper locking api #48, which is yet to be pushed to git.
P.S. There seems to be a merge conflict right now. See if you can rebase your branch against the current git master.

Маслов Никита and others added 9 commits January 12, 2014 17:57
Signed-off-by: Maslov Nikita <[email protected]>
Signed-off-by: Nikita 'webconn' Maslov <[email protected]>
Features of reworked tmgr library:

* Cross-platform, tiny task manager/scheduler

* Two modes of operation: uptime-based (faster, but limited in device
uptime) and countdown-based (a bit slower, but uptime-independent)

* In uptime-based mode, the information about system uptime is available
and could be used in projects (for debugging, logging etc.)

* Time conversion functions (s/ms/us to timer ticks and vice versa)

* Basic delay implementation

Signed-off-by: Nikita 'webconn' Maslov <[email protected]>
Signed-off-by: Nikita 'webconn' Maslov <[email protected]>
Signed-off-by: Nikita 'webconn' Maslov <[email protected]>
Now structure is a bit closer to Linux kernel timers.

See docs for further information.

Signed-off-by: Nikita 'webconn' Maslov <[email protected]>
Remove Mode of Operation config entry.

Signed-off-by: Nikita 'webconn' Maslov <[email protected]>
Now queue works more correct. Also, tmgr_set_fq() functions
removed (you still need to set system timer frequency in menuconfig
(see docs)

Signed-off-by: Nikita 'webconn' Maslov <[email protected]>
nekromant added a commit that referenced this pull request Jan 12, 2014
tmgr library fix (now need testing)
@nekromant nekromant merged commit 2490719 into master Jan 12, 2014
@nekromant nekromant deleted the tmgr_fix branch January 12, 2014 14:02
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

Successfully merging this pull request may close these issues.

2 participants