Skip to content

InexactError when using set_mode #13

@phykos

Description

@phykos

So far, I tried changing mode on pin 1.
This is what I've got.

julia> using PiGPIO

julia> p = Pi()
[ Info: Successfully connected!
Pi("localhost", 8888, true, PiGPIO.SockLock(Sockets.TCPSocket(RawFD(0x00000012) open, 0 bytes waiting), ReentrantLock(nothing, Base.GenericCondition{Base.Threads.SpinLock}(Base.InvasiveLinkedList{Task}(nothing, nothing), Base.Threads.SpinLock(0)), 0)), PiGPIO.CallbackThread(PiGPIO.SockLock(Sockets.TCPSocket(RawFD(0x00000012) open, 0 bytes waiting), ReentrantLock(nothing, Base.GenericCondition{Base.Threads.SpinLock}(Base.InvasiveLinkedList{Task}(nothing, nothing), Base.Threads.SpinLock(0)), 0)), PiGPIO.SockLock(Sockets.TCPSocket(RawFD(0x00000013) paused, 0 bytes waiting), ReentrantLock(nothing, Base.GenericCondition{Base.Threads.SpinLock}(Base.InvasiveLinkedList{Task}(nothing, nothing), Base.Threads.SpinLock(0)), 0)), true, true, 0, 0x00000000, Any[]))

julia> set_mode(p, 1, PiGPIO.OUTPUT)
ERROR: InexactError: check_top_bit(Int32, 4294967255)
Stacktrace:
 [1] throw_inexacterror(::Symbol, ::Type{Int32}, ::UInt32) at ./boot.jl:558
 [2] check_top_bit at ./boot.jl:572 [inlined]
 [3] toInt32 at ./boot.jl:621 [inlined]
 [4] Int32 at ./boot.jl:707 [inlined]
 [5] convert at ./number.jl:7 [inlined]
 [6] _u2i(::UInt32) at /home/g/.julia/packages/PiGPIO/bH87w/src/pi.jl:72
 [7] set_mode(::Pi, ::Int64, ::Int64) at /home/g/.julia/packages/PiGPIO/bH87w/src/pi.jl:356
 [8] top-level scope at REPL[3]:1

julia> set_mode(p, 1, PiGPIO.INPUT)
ERROR: InexactError: check_top_bit(Int32, 4294967255)
Stacktrace:
 [1] throw_inexacterror(::Symbol, ::Type{Int32}, ::UInt32) at ./boot.jl:558
 [2] check_top_bit at ./boot.jl:572 [inlined]
 [3] toInt32 at ./boot.jl:621 [inlined]
 [4] Int32 at ./boot.jl:707 [inlined]
 [5] convert at ./number.jl:7 [inlined]
 [6] _u2i(::UInt32) at /home/g/.julia/packages/PiGPIO/bH87w/src/pi.jl:72
 [7] set_mode(::Pi, ::Int64, ::Int64) at /home/g/.julia/packages/PiGPIO/bH87w/src/pi.jl:356
 [8] top-level scope at REPL[4]:1

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