chode(dev-deps): Update credo to 1.6.1.

This commit is contained in:
James Harton 2021-12-08 16:27:46 +13:00
parent 895d9173b5
commit d8e485c726
3 changed files with 8 additions and 14 deletions

View file

@ -30,9 +30,9 @@ defmodule PCA9685 do
Disconnect a PCA9685 device.
"""
def disconnect(device_name) do
with :ok <- Supervisor.terminate_child(PCA9685.Supervisor, {PCA9685.Device, device_name}),
:ok <- Supervisor.delete_child(PCA9685.Supervisor, {PCA9685.Device, device_name}) do
:ok
case Supervisor.terminate_child(PCA9685.Supervisor, {PCA9685.Device, device_name}) do
:ok -> Supervisor.delete_child(PCA9685.Supervisor, {PCA9685.Device, device_name})
{:error, reason} -> {:error, reason}
end
end
end

View file

@ -61,9 +61,7 @@ defmodule PCA9685.Commands do
<<mode1>> <- I2C.write_read(pid, <<@mode1>>, 1),
:ok <- I2C.write(pid, <<@mode1, mode1 &&& ~~~@sleep>>),
:ok <- :timer.sleep(5),
:ok <- set_pwm_frequency(pid, freq_hz) do
:ok
end
do: set_pwm_frequency(pid, freq_hz)
end
@doc false
@ -98,9 +96,7 @@ defmodule PCA9685.Commands do
:ok <- I2C.write(pid, <<@prescale, prescale>>),
:ok <- I2C.write(pid, <<@mode1, old_mode>>),
:ok <- :timer.sleep(5),
:ok <- I2C.write(pid, <<@mode1, old_mode ||| 0x80>>) do
:ok
end
do: I2C.write(pid, <<@mode1, old_mode ||| 0x80>>)
end
def set_pwm_frequency(_pid, hz), do: {:error, "#{hz}hz is outside available range."}
@ -113,8 +109,7 @@ defmodule PCA9685.Commands do
with :ok <- I2C.write(pid, <<@all_led_on_l, on &&& 0xFF>>),
:ok <- I2C.write(pid, <<@all_led_on_h, on >>> 8>>),
:ok <- I2C.write(pid, <<@all_led_off_l, off &&& 0xFF>>),
:ok <- I2C.write(pid, <<@all_led_off_h, off >>> 8>>),
do: :ok
do: I2C.write(pid, <<@all_led_off_h, off >>> 8>>)
end
def set_all_pwm(_pid, _on, _off), do: {:error, "Invalid PWM values."}
@ -128,8 +123,7 @@ defmodule PCA9685.Commands do
with :ok <- I2C.write(pid, <<@led0_on_l + 4 * channel, on &&& 0xFF>>),
:ok <- I2C.write(pid, <<@led0_on_h + 4 * channel, on >>> 8>>),
:ok <- I2C.write(pid, <<@led0_off_l + 4 * channel, off &&& 0xFF>>),
:ok <- I2C.write(pid, <<@led0_off_h + 4 * channel, off >>> 8>>),
do: :ok
do: I2C.write(pid, <<@led0_off_h + 4 * channel, off >>> 8>>)
end
def set_one_pwm(_pid, _channel, _on, _off), do: {:error, "Invalid channel or duty cycle."}

View file

@ -1,6 +1,6 @@
%{
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
"credo": {:hex, :credo, "1.5.4", "9914180105b438e378e94a844ec3a5088ae5875626fc945b7c1462b41afc3198", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "cf51af45eadc0a3f39ba13b56fdac415c91b34f7b7533a13dc13550277141bc4"},
"credo": {:hex, :credo, "1.6.1", "7dc76dcdb764a4316c1596804c48eada9fff44bd4b733a91ccbf0c0f368be61e", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "698607fb5993720c7e93d2d8e76f2175bba024de964e160e2f7151ef3ab82ac5"},
"earmark": {:hex, :earmark, "1.4.1", "07bb382826ee8d08d575a1981f971ed41bd5d7e86b917fd012a93c51b5d28727", [:mix], [], "hexpm", "cdfa03374331187c7b9e86d971423a19138dc1cf9902b26923a657c789673876"},
"earmark_parser": {:hex, :earmark_parser, "1.4.12", "b245e875ec0a311a342320da0551da407d9d2b65d98f7a9597ae078615af3449", [:mix], [], "hexpm", "711e2cc4d64abb7d566d43f54b78f7dc129308a63bc103fbd88550d2174b3160"},
"elixir_ale": {:hex, :elixir_ale, "1.2.1", "07ac2f17a0191b8bd3b0df6b526c7f699a3a4d690c9def573fcb5824eef24d98", [:make, :mix], [{:elixir_make, "~> 0.4", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "bfb099137500a3b8c4a1750cf07f2d704897ef9feac3412064bf9edc7d74193c"},