mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-01-01 13:58:06 +00:00
Revert "libgpiod: modify test 'gpioset: toggle (continuous)'"
This reverts commit d891624096.
This commit is contained in:
parent
cf1c20bed3
commit
3174a9da4c
|
|
@ -1,60 +0,0 @@
|
|||
From b73a79245ac0fa36b15bf3308e4ed008793ff15c Mon Sep 17 00:00:00 2001
|
||||
From: Joe Slater <joe.slater@windriver.com>
|
||||
Date: Fri, 19 May 2023 08:46:47 -0700
|
||||
Subject: [PATCH] ptest: modify delays in toggle test
|
||||
|
||||
The test "gpioset: toggle (continuous)" uses fixed delays to test
|
||||
toggling values. This is not reliable, so we switch to looking
|
||||
for transitions from one value to another.
|
||||
|
||||
Upstream-Status: pending
|
||||
|
||||
Signed-off-by: Joe Slater <joe.slater@windriver.com>
|
||||
---
|
||||
tools/gpio-tools-test.bats | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- libgpiod-2.0.orig/tools/gpio-tools-test.bats
|
||||
+++ libgpiod-2.0/tools/gpio-tools-test.bats
|
||||
@@ -141,6 +141,20 @@ gpiosim_check_value() {
|
||||
[ "$VAL" = "$EXPECTED" ]
|
||||
}
|
||||
|
||||
+gpiosim_wait_value() {
|
||||
+ local OFFSET=$2
|
||||
+ local EXPECTED=$3
|
||||
+ local DEVNAME=${GPIOSIM_DEV_NAME[$1]}
|
||||
+ local CHIPNAME=${GPIOSIM_CHIP_NAME[$1]}
|
||||
+
|
||||
+ for i in {1..10} ; do
|
||||
+ VAL=$(<$GPIOSIM_SYSFS/$DEVNAME/$CHIPNAME/sim_gpio$OFFSET/value)
|
||||
+ [ "$VAL" = "$EXPECTED" ] && return
|
||||
+ sleep 0.1
|
||||
+ done
|
||||
+ return 1
|
||||
+}
|
||||
+
|
||||
gpiosim_cleanup() {
|
||||
for CHIP in ${!GPIOSIM_CHIP_NAME[@]}
|
||||
do
|
||||
@@ -1567,15 +1581,15 @@ request_release_line() {
|
||||
gpiosim_check_value sim0 4 0
|
||||
gpiosim_check_value sim0 7 0
|
||||
|
||||
- sleep 1
|
||||
-
|
||||
- gpiosim_check_value sim0 1 0
|
||||
+ # sleeping fixed amounts can be unreliable, so we
|
||||
+ # sync to the toggles
|
||||
+ #
|
||||
+ gpiosim_wait_value sim0 1 0
|
||||
gpiosim_check_value sim0 4 1
|
||||
gpiosim_check_value sim0 7 1
|
||||
|
||||
- sleep 1
|
||||
|
||||
- gpiosim_check_value sim0 1 1
|
||||
+ gpiosim_wait_value sim0 1 1
|
||||
gpiosim_check_value sim0 4 0
|
||||
gpiosim_check_value sim0 7 0
|
||||
}
|
||||
|
|
@ -9,8 +9,6 @@ LIC_FILES_CHKSUM = " \
|
|||
|
||||
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}-2.x:"
|
||||
|
||||
SRC_URI += "file://0001-ptest-modify-delays-in-toggle-tests.patch"
|
||||
|
||||
SRC_URI[sha256sum] = "b5367d28d045b36007a4ffd42cceda4c358737ef4f2ce22b0c1d05ec57a38392"
|
||||
|
||||
# Enable all project features for ptest
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user