mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
LED failed attempt, GPIO working
This commit is contained in:
@@ -6,3 +6,7 @@ We use it to for things like:
|
||||
|
||||
- customized configuration files
|
||||
- userland module test scripts
|
||||
|
||||
Most tests correspond clearly to a given kernel module, but the following ones don't, e.g. they correspond to mainline tree features:
|
||||
|
||||
- [gpio](gpio.sh)
|
||||
|
||||
27
rootfs_overlay/gpio.sh
Executable file
27
rootfs_overlay/gpio.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
cd /sys/class/gpio
|
||||
echo 480 > export
|
||||
echo 481 > export
|
||||
echo 482 > export
|
||||
echo 488 > export
|
||||
echo 496 > export
|
||||
echo out > gpio480/direction
|
||||
echo out > gpio481/direction
|
||||
echo out > gpio482/direction
|
||||
echo out > gpio488/direction
|
||||
echo out > gpio496/direction
|
||||
v=1
|
||||
while true; do
|
||||
echo $v > gpio480/value
|
||||
echo $v > gpio481/value
|
||||
echo $v > gpio482/value
|
||||
echo $v > gpio488/value
|
||||
echo $v > gpio496/value
|
||||
if [ $v -eq 1 ]; then
|
||||
v=0
|
||||
else
|
||||
v=1
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
Reference in New Issue
Block a user