Skip to content

wait_for_edge with timeout less than 1s does not work #57

@dex6

Description

@dex6

Tried something like that:

t1 = time.time()
ret = GPIO.wait_for_edge(input_pin, GPIO.BOTH, timeout=500)
t2 = time.time()
print(ret, t2 - t1)

The intention is to wait for a half second, but it takes only about 1ms and prints None 0.0010421276092529297

I think the calculation of timeout sec/nsec in line_event_wait() is wrong, and the nsec should be multiplied by 1000000 and not 1000.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions