Introducing modular openchronos (candidate for openchronos-ng)

118 views
Skip to first unread message

Angelo Arrifano

unread,
Apr 20, 2012, 7:30:35 AM4/20/12
to openchronos
Hello everybody,

Since I saw quite some movement lately in the mailing list, I thought
it was the best time to introduce the modular development of
openchronos done by me and Aljaz.
The experimental tree is at the *modular repository* in the *display branch*:
https://gitorious.org/openchronos/modular/trees/display

In a small summary, this is what have been accomplished:
* Removed A LOT OF CODE, the firmware is considerably smaller.
* The display, timer, menu API etc.. were greatly simplified.
* Have a working RTC API (no more inaccuracy in time keeping).
* Modular design: sources can simply be added/removed into/from the
modules directory without having to hack other source files.
* A new reworked build system which is faster.
* High power savings due to reworked display API.
* Single menu: We got rid of the two menu system, it made the code
more complex, make firmware larger and for these reasons we thought it
was not worth having it.

For more information see here: (ignore the display and menu sections
since they already have been implemented)
https://gitorious.org/openchronos/pages/ModularDev

For now, only the clock, alarm and wireless update are working. If you
are interested in helping please drop us an email. We need help
porting the remaining modules into the new framework. Mind you that
you need to be familiar with the openchronos code in order to help.

Thanks
--
Angelo Arrifano AKA MiKNiX
Doctorate at the I3S Laboratory / CNRS - France
Doctorate at the University of Beira Interior - Portugal
http://www.arrifano.com
PGP Pubkey 0x3D92BB0B

Paolo Di Prodi

unread,
Apr 23, 2012, 7:05:00 PM4/23/12
to openc...@googlegroups.com
Hello I become quite familiar with the modular version as I modified it recently.
Could you at least port  the accelerometer module so that I have an idea about the usage
of the display functions.
After that I could also integrate the features I wanted like logging acceleration
while in time mode etc.
The code now looks better and cleaner.
I am working now on free fall and activity detection which are not supported in the driver section.

Cheers.
--
Dr. Paolo Di Prodi


Angelo Arrifano

unread,
Apr 23, 2012, 7:46:32 PM4/23/12
to openc...@googlegroups.com, Aljaž Srebrnič
Hello,

I'll work on porting the accelerometer module then. For now have a
look at the date and clock modules since they already implement the
new API.
I'm going to try to provide a quick explanation on my work with Aljaž:

*basically it worked like this before:*
1) A module (logic/*.c) receives execution by user input (menu) or timer event.
2) If the module needs to update the screen, it then sets the global
display flag.
3) Execution goes back to the system.
4) Before going idle, the system calls the display_update function of
the module.
5) The module then updates the screen.

An exception to this would be the user setting values (for example,
setting the alarm using up/down buttons). This functionality was
provided by a ugly workaround (set_value() function in user.c) that
steals execution from the system while the display is in "setting
mode". There were also other ugly hacks like calling the update_time
function (from timer.c) in rfbsl.c

*now it works like this*
1) A module (logic/*.c) receives execution by user input (menu) or timer event.
2) If the module needs to update the screen then it should check if it
is active (the user selected it in the menu)
3) Execution goes back to the system.

Every module can update the screen as many times as they wish. For
example, the clock updates every minute, the date only updates when a
day or month digit changes - this is optimal for power savings. An
accelerometer, for example, can potentially update every half second
or even more frequently.

Since we got rid of the two menu system. Every module is free to draw
in the first or second row. A module can also touch display symbols
(like hear, R, wireless ...), however it *must* save the symbol state
when the module is activated and restore it when being deactivated
(there are activation and deactivation callbacks for every module, see
the source for more info).

For setting values, there are no workarounds. The module just needs to
call a function (I don't remember its name right now) which gives
execution back to the module when the up/down/set/cancel buttons are
pressed during the "setting mode"

I wrote this very quickly without looking at the actual code so pardon
me if the terminology does not match.
Let me know if you have any questions.
- Angelo

Andrey Ulanov

unread,
Apr 28, 2012, 2:46:40 AM4/28/12
to openc...@googlegroups.com
Just tried it: awesome! module API is really clean and simple, much better than before. 
I primarily use my watch as skydiving altimeter so I'll work on porting the altimeter module.
--
with best regards, Andrey Ulanov.

Aljaž Srebrnič

unread,
Apr 30, 2012, 1:18:01 AM4/30/12
to openc...@googlegroups.com
On 28/apr/2012, at 08:46, Andrey Ulanov wrote:

Just tried it: awesome! module API is really clean and simple, much better than before. 

Thank you very much :)

I primarily use my watch as skydiving altimeter so I'll work on porting the altimeter module.

Great! I'll soon start working again on core, have to do some exams first...


Aljaž Srebrnič
-- --
My public key:  http://bit.ly/g5pw_pubkey

michael gindonis

unread,
Apr 30, 2012, 4:28:25 AM4/30/12
to openc...@googlegroups.com
Is anyone using mspgcc to build this?

I have run into some problems. When I have time I will post more details.
I have compiled the latest mspgcc from sources ( April 2012 release).
I'll try it again with the Fedora packaged version.

...Mike
--
Regards...

...Mike
---
Michael Gindonis
Email: firstnam...@gmail.com

Aljaž Srebrnič

unread,
Apr 30, 2012, 2:36:16 PM4/30/12
to openc...@googlegroups.com
On 30/apr/2012, at 10:28, michael gindonis wrote:

> Is anyone using mspgcc to build this?

If you mean the msp430-gcc yes, this is the primary build toolchain.

>
> I have run into some problems. When I have time I will post more details.

Great, thanks!

> I have compiled the latest mspgcc from sources ( April 2012 release).
> I'll try it again with the Fedora packaged version.

I've built it with the latest development version (gcc 4.7.0) and it compiles fine with two warnings (SimpliciTI related)
Reply all
Reply to author
Forward
0 new messages