Skip to content

Commit 402c5d4

Browse files
committed
Last gasp of pipgpio here
1 parent 47595ab commit 402c5d4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • deploy/dev/PiGPIO/src

deploy/dev/PiGPIO/src/pi.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ Runs a pigpio socket command.
104104
function _pigpio_command(sl::SockLock, cmd::Integer, p1::Integer, p2::Integer, rl=true)
105105
lock(sl.l)
106106
Base.write(sl.s, UInt32.([cmd, p1, p2, 0]))
107-
108107
out = zeros(UInt8, _SOCK_CMD_LEN)
109108
Base.readbytes!(sl.s, out, _SOCK_CMD_LEN)
110109
@debug "_pigpio_command" out
@@ -128,8 +127,8 @@ Runs an extended pigpio socket command.
128127
function _pigpio_command_ext(sl, cmd, p1, p2, p3, extents, rl=true)
129128
io = IOBuffer()
130129
write(io,Cuint.((cmd, p1, p2, p3))...)
131-
ext = vcat(take!(io),extents)
132-
130+
prefix = take!(io)
131+
ext = vcat(prefix,extents)
133132
lock(sl.l)
134133
write(sl.s, ext)
135134
out = Base.read(sl.s, _SOCK_CMD_LEN)
@@ -1081,7 +1080,7 @@ function hardware_PWM(self::Pi, gpio, PWMfreq, PWMduty)
10811080
## extension ##
10821081
# I PWMdutycycle
10831082
extents = IOBuffer()
1084-
extents =write(extents, 10)
1083+
write(extents, Int32(PWMduty))
10851084
return _u2i(_pigpio_command_ext(
10861085
self.sl, _PI_CMD_HP, gpio, PWMfreq, 4, extents))
10871086
end
@@ -1223,6 +1222,7 @@ function custom_2(self, arg1=0, argx=[], retMax=8192)
12231222
## extension ##
12241223
# s len argx bytes
12251224

1225+
12261226
# Don't raise exception. Must release lock.
12271227
bytes = u2i(_pigpio_command_ext(
12281228
self.sl, _PI_CMD_CF2, arg1, retMax, length(argx), [argx], false))

0 commit comments

Comments
 (0)