   def parse_code("R05" <> _r), do: {nil, :noop}
   def parse_code("R06 " <> r), do: parse_report_calibration(r)
   def parse_code("R07 " <> _), do: {nil, :noop}
-  def parse_code("R08 " <> echo), do: {:echo, {:echo, String.replace(echo, "\r", "")}}
+  def parse_code("R08 " <> echo),
+    do: {:echo, {:echo, String.replace(echo, "\r", "")}}
   def parse_code("R09 " <> tag),  do: {tag, :invalid_command}
 
   # Report axis homing.

  end

  @doc false
  @spec parse_end_stops(binary) ::
          {:report_end_stops, binary, binary, binary, binary, binary, binary, binary}
  def parse_end_stops(<<
        "XA",
        xa::size(8),
        32,
        "XB",
        xb::size(8),
        32,
        "YA",
        ya::size(8),
        32,
        "YB",
        yb::size(8),
        32,
        "ZA",
        za::size(8),
        32,
        "ZB",
        zb::size(8),
        32,
        "Q",
        tag::binary
      >>),
      do: {
        tag,
        {:report_end_stops, xa |> pes, xb |> pes, ya |> pes, yb |> pes, za |> pes, zb |> pes}
      }

  # lol
  @spec pes(48 | 49) :: 0 | 1

          | :report_encoder_position_scaled
          | :report_encoder_position_raw

  @spec report_xyz(binary, reporter)
    :: {binary, {reporter, binary, binary, binary}}
  defp report_xyz(position, reporter) when is_bitstring(position),
    do: position |> String.split(" ") |> do_parse_pos(reporter)

  @valid_position_reporters [
    :report_current_position,
    :report_encoder_position_scaled
  ]
  defp do_parse_pos(["X" <> x, "Y" <> y, "Z" <> z, "Q" <> tag], reporter)
     when reporter in @valid_position_reporters
   do
     import String, only: [to_float: 1]
     msg = {reporter, to_float(x), to_float(y), to_float(z)}
     {tag, msg}
  end

  defp do_parse_pos(["X" <> x, "Y" <> y, "Z" <> z, "Q" <> tag], reporter) do
    import String, only: [to_integer: 1]
    msg = {reporter, to_integer(x), to_integer(y), to_integer(z)}
    {tag, msg}
  end

  defp do_parse_pos(l, _) do
