Page 1 of 1

LED colour settings logics (?)

Posted: 04 Mar 2013, 11:49
by gonk
How come that the RGB-LED only allows 4 out of 7 combinations where any of RGB is on?

I would have expected that it was a 3-bit signal so that:
0=000=off
1=001=blue
2=010=green
3=011=cyan
4=100=red
5=101=magenta
6=110=yellow
7=111=white

Instead we have
0=000=blue
1=001=red
2=010=green
3=011=n/a
4=100=magenta
5=101=n/a
6=110=n/a
7=111=n/a
... and
echo off > /sys/bus/platform/devices/bubbatwo/ledmode to switch it off.

What's the reason and logics here?

Re: LED colour settings logics (?)

Posted: 30 Mar 2013, 12:17
by johannes
Reason is to be backwards compatible with the Bubba 2 (one-color blue LED) driver. Hence a in-between layer was created with this translation table. I don't know about logic though. :)

Re: LED colour settings logics (?)

Posted: 31 Mar 2013, 05:32
by gonk
Well, you could have made that in another way and thus not only reaching backwards compatibility but also increased capabilities.

How ocme that the led_* scripts in /etc/init.d/ is still in the B3 build?
They seem kind of outdated, especially the one for flashing the LED that doesn't seem to have any effect at all.

Refactor, modernize, clean out, enhance and utilize the capabilities would be favourable to just keeping backward compatibility.

Re: LED colour settings logics (?)

Posted: 31 Mar 2013, 06:21
by johannes
Keeping backwards compatibility was crucial since we back then planned a merge of the B2 and B3 software trees (which eventually also was done). But yes I agree, could have been done nicer. To complicate matters we also had an in-between version of the B3 based on another chipset that never saw light, and the led driver worked there too. But yes, I can't argue against that a cleanup would be nice.