Re: H1940 screen dimming under GPE

From: Arjan Schrijver <arjan_at_anymore.nl>
Date: Fri, 02 Feb 2007 13:21:07 +0100

Hi Tom,

Thanks for your addition!
My latest angstrom gpe image contains this by default.
And the latest image also contains a working h1940 feed,
which can be used to install additional programs or update
the ipaq using the package manager.

Thanks,
Arjan

Tom Talpey wrote:
> The H1940's GPE environment uses a daemon called ipaq-sleep to
> control screen auto-dimming and suspend, which in turn depends
> on a missing executable /usr/bin/bl to control the backlight. The
> one in the OE build tree is obsolete and also incompatible with the
> H1940 support.
>
> So here's a shell script to do it, just unpack it into /usr/bin and
> be sure to chmod +x /usr/bin/bl. Works for me!
>
> Be careful of the extra two spaces after "on" in line 13. The
> ipaq_sleep program is very picky about where it finds the number.
> Also, the "toggle" option is used by the long-power-press key
> handler to switch the backlight on and off manually, but that
> doesn't seem to work properly due to the name of the key, or
> something.
>
> I have a similar fix for the Opie install too, but it requires minor
> code changes in libopie2, which means a rebuild.
>
> Tom.
>
>
> Index: rootfs/usr/bin/bl
> ===================================================================
> --- /dev/null
> +++ rootfs/usr/bin/bl
> @@ -0,0 +1,43 @@
> +#!/bin/sh
> +# get/set relative screen brightness
> +
> +dv='/sys/class/backlight/s3c2410-bl'
> +br=`cat $dv/brightness 2>/dev/null`
> +bm=`cat $dv/max_brightness 2>/dev/null`
> +bl=`expr $br \* 256 / $bm 2>/dev/null`
> +
> +case x$1 in
> +"x")
> + case x$bl in
> + x|x0) echo "off " ;;
> + *) echo "on " $bl ;;
> + esac
> + exit 0
> + ;;
> +"xtoggle")
> + case x$bl in
> + x|x0) bl=256 ;;
> + *) bl=0 ;;
> + esac
> + ;;
> +"xon")
> + bl=256
> + ;;
> +"xoff")
> + bl=0
> + ;;
> +x[0-9]*)
> + if [ $1 -gt 255 ] ; then
> + bl=256
> + else
> + bl=$1
> + fi
> + ;;
> +*)
> + echo "usage: $0 [on|off|toggle|<0-255>]" 2>&1
> + exit 1
> + ;;
> +esac
> +
> +expr $bl \* $bm / 256 > $dv/brightness 2>/dev/null
> +exit 0
> _______________________________________________
> H1900-port mailing list
> H1900-port_at_handhelds.org
> https://handhelds.org/mailman/listinfo/h1900-port
>
Received on Fri Feb 02 2007 - 07:21:12 EST

This archive was generated by hypermail 2.2.0 : Fri Feb 02 2007 - 07:21:31 EST