[openfirmware] [commit] r3294 - cpu/arm/olpc
repository service
svn at openfirmware.info
Thu Sep 6 02:28:28 CEST 2012
Author: quozl
Date: Thu Sep 6 02:28:28 2012
New Revision: 3294
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3294
Log:
OLPC XO-4 - Neonode, graphical absolute signal strength tool, watch-fss
Modified:
cpu/arm/olpc/nn-touchscreen.fth
Modified: cpu/arm/olpc/nn-touchscreen.fth
==============================================================================
--- cpu/arm/olpc/nn-touchscreen.fth Thu Sep 6 01:10:40 2012 (r3293)
+++ cpu/arm/olpc/nn-touchscreen.fth Thu Sep 6 02:28:28 2012 (r3294)
@@ -18,7 +18,7 @@
create nn-os \ open short test
create nn-fll \ forced LED levels test
create nn-version \ version display
-create nn-watch-fll \ forced LED levels test, graphical variant
+create nn-watch \ graphical signal tests
\ create nn-fss \ optional fixed signal strength test
\ create nn-ls \ optional low signals test
@@ -523,7 +523,7 @@
-[ifdef] nn-watch-fll \ forced LED levels test, graphical variant
+[ifdef] nn-watch \ graphical signal tests
d# 30 value r \ size of blocks
@@ -535,7 +535,7 @@
fill-rectangle-noff ( )
;
-: signal>colour ( signal-value -- colour )
+: level>colour ( signal-value -- colour )
d# 3 rshift dup d# 5 lshift over d# 11 lshift or or
;
@@ -558,17 +558,19 @@
;
0 value axis#
-: watch-fll-signal ( signal# signal-value led-level -- )
- >r ( signal# signal-value r: led-level )
- signal>colour pixcolor ! ( signal# r: led-level )
- axis# if ( signal# r: led-level ) \ y
+
+: draw-signal ( signal# level -- x y )
+ level>colour pixcolor ! ( signal# )
+ axis# if ( signal# ) \ y
ys>xy
- else ( signal# r: led-level ) \ x
+ else ( signal# ) \ x
xs>xy
- then ( x y r: led-level )
- 2dup bigdot ( x y r: led-level )
- r> ( x y led-level )
- h# c > if ( x y )
+ then ( x y )
+ 2dup bigdot ( x y )
+;
+
+: ?draw-fail ( x y flag? -- )
+ if ( x y )
white pixcolor ! ( x y )
big>little ( x' y' )
dot ( )
@@ -577,6 +579,14 @@
then ( )
;
+
+: watch-fll-signal ( signal# signal-value led-level -- )
+ >r ( signal# signal-value r: led-level )
+ draw-signal ( x y r: led-level )
+ r> ( x y led-level )
+ h# c > ?draw-fail ( )
+;
+
: watch-fll-axis ( axis# -- )
dup to axis# ( axis# )
(fll)
@@ -588,8 +598,12 @@
loop
;
-: watch-fll
+: empty
black 0 0 screen-w screen-h fill-rectangle-noff
+;
+
+: watch-fll
+ empty
begin
0 watch-fll-axis
1 watch-fll-axis key?
@@ -599,6 +613,37 @@
;
+
+: watch-fss-signal ( signal# level -- )
+ dup >r ( signal# level r: level )
+ draw-signal ( x y r: level )
+ r> ( x y level )
+ 1 < ?draw-fail ( )
+;
+
+d# 64 value fs \ fixed signal strength
+
+: watch-fss-axis ( axis# -- )
+ dup to axis# ( axis# )
+ fs swap h# 0f h# 03 h# ee 5 bytes-out
+ h# 0f d# 20 anticipate
+
+ pbuf 4 + c@ 0 do ( )
+ i pbuf 5 + over + c@ ( signal# level )
+ watch-fss-signal ( )
+ loop
+;
+
+: watch-fss
+ empty
+ begin
+ 0 watch-fss-axis
+ 1 watch-fss-axis key?
+ until
+ key drop
+ page
+;
+
[then]
More information about the openfirmware
mailing list