help with fix

24 views
Skip to first unread message

Krzysztof Andrelczyk

unread,
Jul 21, 2012, 1:45:59 PM7/21/12
to openc...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I'm still trying to port stopwatch module (not enough time so it takes
me weeks :/) and I run into some problems with display. I'm trying to
display time in second line properly and there is a problem with first
segment (from left). When I do:
display_chars(&screen[0], LCD_SEG_L2_5_4, _itoa(sStopwatch.time[1],2,0), SEG_ON);
when time[1] == 1 it simply displays 0 instead of 1 or 01. Is this a bug
in display? I think that when I try to display '01' at LCD_SEG_L2_5_4
it should skip '0' and write '1' in second segment but instead it writes
'0' in the second segment.
I've changed:
write_lcd_mem(segmem, blkmem, bits, bitmask, state);
to:
if (segment != LCD_SEG_L2_5 || bits == BIT7) {
write_lcd_mem(segmem, blkmem, bits, bitmask, state);
}
in display.c to skip invalid values in first segment and this helped
(now 1 is 1) but now this segment (first) isn't cleared.
Is this a valid fix and do I have to add another condition to allow
clearing of this field?

Also, my screen is only updated every minute. What do I have to do to
update it with the 10HZ and 1HZ timers? Now I have:
_messagebus_register(&stopwatch_tick, TIMER0_EVENT_10HZ | TIMER0_EVENT_1HZ);
but it doesn't seem to work.

- --

Krzysztof Andrelczyk
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlAK6tcACgkQxkiuxAVxbTXjVgCfZj6Iv1XeikYGEp7FR3JFo3je
wfwAnRJKZ+CDPsG+Aqg61KBEsem8s/Vc
=kHHi
-----END PGP SIGNATURE-----

Ângelo Miguel Arrifano

unread,
Jul 22, 2012, 10:46:56 AM7/22/12
to openc...@googlegroups.com, kandr...@gmail.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sat, 21 Jul 2012 19:45:59 +0200
Krzysztof Andrelczyk <kandr...@gmail.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,

Hi,
>
> I'm still trying to port stopwatch module (not enough time so it takes
> me weeks :/) and I run into some problems with display. I'm trying to
> display time in second line properly and there is a problem with first
> segment (from left). When I do:
> display_chars(&screen[0], LCD_SEG_L2_5_4, _itoa(sStopwatch.time[1],2,0), SEG_ON);
> when time[1] == 1 it simply displays 0 instead of 1 or 01. Is this a bug
> in display? I think that when I try to display '01' at LCD_SEG_L2_5_4
> it should skip '0' and write '1' in second segment but instead it writes
> '0' in the second segment.
> I've changed:
> write_lcd_mem(segmem, blkmem, bits, bitmask, state);
> to:
> if (segment != LCD_SEG_L2_5 || bits == BIT7) {
> write_lcd_mem(segmem, blkmem, bits, bitmask, state);
> }
> in display.c to skip invalid values in first segment and this helped
> (now 1 is 1) but now this segment (first) isn't cleared.
> Is this a valid fix and do I have to add another condition to allow
> clearing of this field?

Krzysztof,

I see you are still developing against the deprecated master branch.
The master branch holds stable code for users but new development should
happen in the testing branch.
So please have a look to the new API in the testing branch. Most of the
display code was reworked so you will not have this bug anymore!

>
> Also, my screen is only updated every minute. What do I have to do to
> update it with the 10HZ and 1HZ timers? Now I have:
> _messagebus_register(&stopwatch_tick, TIMER0_EVENT_10HZ | TIMER0_EVENT_1HZ);
> but it doesn't seem to work.

Try the testing branch, let us know if you have any problems with it :)

PS: The mailing list at openchronos-ng at sourceforge.net is probably
best for openchronos-ng related development.

- - Angelo
>
> - --
>
> Krzysztof Andrelczyk
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.12 (GNU/Linux)
>
> iEYEARECAAYFAlAK6tcACgkQxkiuxAVxbTXjVgCfZj6Iv1XeikYGEp7FR3JFo3je
> wfwAnRJKZ+CDPsG+Aqg61KBEsem8s/Vc
> =kHHi
> -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iEYEARECAAYFAlAMEmQACgkQNahyoD2SuwvxzwCfWG9bw9Kwl2+8HmTepdUgHDuT
Ry8An3kxz9t7YRWCS4Pr2HyiqD2tIVMN
=byjt
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages