1. 25 Dec, 2020 1 commit
  2. 31 Jul, 2020 1 commit
    • BenediktO's avatar
      lpc: improve performance, use proper .wait() condition · 190b74dd
      BenediktO authored
      Use a proper .wait() condition to have edges detected in common code,
      and avoid the many transitions between C and Python. This dramatically
      increases performance of the LPC protocol decoder.
      [ gsi: rephrased and reflowed the commit message ]
  3. 30 Jul, 2020 3 commits
  4. 29 Jul, 2020 4 commits
  5. 26 Jul, 2020 8 commits
    • Gerhard Sittig's avatar
      ir_sirc: use common bitpack() variant with array access · a9e95739
      Gerhard Sittig authored
      This eliminates array copies and indexed access to bit values in the
      calling decoder. Prefer common helpers instead.
    • Gerhard Sittig's avatar
      can: use common MSB first variant of bitpack() · ae3ed295
      Gerhard Sittig authored
      This eliminates array copies and bit order reversal in the calling
      decoder. Prefer common helpers instead.
    • Gerhard Sittig's avatar
      common: add LSB/MSB first bitpack variant with optional index · 4a3c854c
      Gerhard Sittig authored
      The CAN decoder collects bits in MSB first order. The SIRC decoder keeps
      lists of tuples with bits and their ss/es. Introduce common logic for
      LSB and MSB first arguments, and optional array index access, to reduce
      redundancy at callers'.
    • Gerhard Sittig's avatar
      can: avoid assignment to .id field during frame inspection · bd7efe23
      Gerhard Sittig authored
      The CAN frame's ID field gets stored in an .id member, which is
      unfortunate. Use .ident instead. The 'id' identifier is a Python
      language word, though it's used for PD boilerplate as well. Assume
      that the boilerplate is worth keeping, and harder to adjust (more
      dependencies), so adjust this PD's implementation to resolve the
    • Gerhard Sittig's avatar
      can: use common helper for bits to number conversion · b0edaeb3
      Gerhard Sittig authored
      Eliminate repeated local string manipulation for the purpose of
      number conversion from bits input. Prefer the common helper instead
      (is an MSB first variant desirable to simplify call sites more?).
    • Gerhard Sittig's avatar
      can: amend recently added Python output feature · ba8529ae
      Gerhard Sittig authored
      Adjust nits in the previous commit which added Python output to the CAN
      decoder. Rename the routine to .putpy() for consistency with other PDs.
      Avoid the 'bytes' identifier as it ships with Python as a data type.
      Rephrase the construction of the tuple for Python output, to become more
      explicit and help reviewers. Partially "undo" the rtr rename, to reduce
      diffs to the previous version (see diff HEAD~2 to see the essence). Fix
      up a three space indentation issue (which was there before the addition
      of Python output).
    • Kari Hautio's avatar
      can: enable Python output from decoder · 7ecd283c
      Kari Hautio authored
    • Gerhard Sittig's avatar
      ir_nec: improve robustness, present more data on invalid input · 24490b8a
      Gerhard Sittig authored
      Don't terminate IR frame inspection when successfully decoded fields
      fail the validity check. Reset internal state on long periods of idle
      level instead (beware of the late detection of the STOP condition).
      Unconditionally annotate received fields, and optionally amend them with
      a warning annotation. It's unexpected to not see the address field value
      at all just because the number was not acceptable for the potentially
      incorrect protocol selection.
      Rename a variable in the decode() routine. The 'b' identifier suggested
      a bit value, but it was used for the pulse width.
  6. 25 Jul, 2020 6 commits
    • Sebastian Rittau's avatar
      ir_nec: Add button texts for an unknown LED panel remote · 5881582c
      Sebastian Rittau authored
      The remote is unmarked and belongs to a 60x60cm LED panel. There is
      a total of 8 buttons. It's probably some generic remote control.
      Bought here: https://www.lumizil.de/led-deckenleuchte-panel-60x60cm
    • Gerhard Sittig's avatar
      ir_nec: add support for extended NEC protocol (16bit address) · 17e0ba22
      Gerhard Sittig authored
      Add support for the extended NEC protocol, where the address field spans
      16 bits and the complement is not sent. Commands still span 8 bits and
      are sent in normal and in inverted form. The user needs to select the
      extended protocol (off by default for compatibility), the input data
      does not allow automatic detection of the protocol variant. It's also
      not appropriate to assume the extended format when the address field
      happens to fail the validity check.
      The unfortunate mix of data value checks and annotation emission in
      combination with "global" state makes this implementation more redundant
      than I would like. A later cleanup is desirable.
      This resolves bug #1583.
    • Gerhard Sittig's avatar
      ir_nec: use common helper for bit accumulation · 025c728e
      Gerhard Sittig authored
      The input signal's polarity ('active' variable) is strictly local to the
      decode() method. The 'count' becomes obsolete when 'data' is kept in a
      Python list. Conversion of bit patterns to numbers is provided by common
      helpers. Alpha-sort Python imports while we are here.
      This commit also renames a few variables in the normal/inverted check
      for valid input data. Which can help the introduction of support for the
      extended protocol, by decoupling what gets checked and what gets shown.
    • Gerhard Sittig's avatar
      ir_nec: rephrase button lookup and addr/cmd validity checks · d478372a
      Gerhard Sittig authored
      Eliminate redundancy in the check for database entries of button events.
      Tighten the check for valid address and command bit patterns. The former
      implementation did something unexpected, wanted the AND of the first and
      second 8bit patterns to become zero. But the second 8bit item has not yet
      become available when the test runs after the reception of the first 8bit
      item. So the test happened to "pass" unexpectedly in intermediate steps,
      and failed to catch invalid input data when all fields became available.
      Unfortunately the check for valid data and the emission of annotations
      was combined in the implementation. So it's essential to keep running
      the "check" routine to get the annotations, and update internal ss/es
      state. But only emit warnings when the check fails after all involved
      data became available. Check for strict XOR as per the protocol spec.
    • Gerhard Sittig's avatar
      ir_nec: only use the samplerate after receiving the value · b3f83fda
      Gerhard Sittig authored
      The metadata() method unconditionally referenced the samplerate even
      though the value is only available conditionally. Move the references to
      a location after the samplerate presence check.
    • Gerhard Sittig's avatar
      ir_nec: rephrase annotation logic, symbolic names, format() call · 34ed4b3f
      Gerhard Sittig authored
      Eliminate magic numbers, use symbolic names for annotation classes and
      pin numbers. Also vertically align text variants for zoom levels in the
      more complex cases, to simplify maintenance. Prefer .format() calls to
      improve readability in the more complex invocations.
  7. 22 Jul, 2020 8 commits
    • Gerhard Sittig's avatar
      ir_sirc: minor Python and other nits · 32d1c350
      Gerhard Sittig authored
      The .wait() wrapper always receives Python lists. There is only a single
      IR pin (and its value isn't even used anywhere because appropriate edge
      conditions get constructed). There is a delicate ss/es detail in the
      .decode() routine concerning the IR frame's annotation's start. Don't
      "continue" in the loop body's last statement, just "pass" and continue.
    • Gerhard Sittig's avatar
      ir_sirc: symbolic names for IR pulse widths, more line trimming · 03fe8db1
      Gerhard Sittig authored
      Concentrate the magic numbers for IR pulse widths at the top of the
      source file. Drop more unused variables. Rename others to shorten more
      text lines.
    • Gerhard Sittig's avatar
    • Gerhard Sittig's avatar
      ir_sirc: reduce smarts to improve maintenance (.wait() API change) · 50207d80
      Gerhard Sittig authored
      Eliminate redundancy in time to snum conversions and vice versa. Don't
      locally overload .wait() with unexpected semantics and neither change
      its parameters nor return values. Give reviewers and maintainers a
      chance to see what's happening when they inspect call sites. The
      'signals' identifier is unusual for pin states, use the more common
      'pins' instead for consistency with other decoders. Reflect when return
      values are not used, so that readers need to juggle fewer details in
      their head.
    • Gerhard Sittig's avatar
    • Gerhard Sittig's avatar
      ir_sirc: .put() nits, common helpers, whitespace · 195cb7b3
      Gerhard Sittig authored
      Wrap the .put() routine which eliminates redundancy and shortens a few
      code lines. Vertically align text variants for different zoom levels.
      Prefer common helpers for bit accumulation which eliminates a local copy
      of that feature. Address minor whitespace nits, alpha-sort imports.
    • Gerhard Sittig's avatar
      ir_sirc: fixup decoder boilerplate · c449c583
      Gerhard Sittig authored
      The SIRC decoder was written to an older API, and failed to load in a
      recent environment (tag missing, ambiguous annotation names). Unbreak
      the decoder's boilerplate, and address other nits while we are here:
      There is no Python output. Use the same declaration syntax as in other
      decoders for improved maintenance (greppability). Call reset() from
      __init__() to avoid surprises when a future version does have vars. Do
      provide a doc string in the module initialization, to keep the URL for
      the protocol description at hand.
    • Tom Flanagan's avatar
  8. 20 Jul, 2020 4 commits
    • Uwe Hermann's avatar
      spdif: Simplify samplerate check. · cc75bd23
      Uwe Hermann authored
    • Uwe Hermann's avatar
      spdif: Drop unneeded braces. · 51194ffc
      Uwe Hermann authored
    • Arno Morbach's avatar
      spdif: Fix various issues. · 028589e6
      Arno Morbach authored
      Bug #897 and my own experience caused me to improve the SPDIF decoder.
      The following issues were addressed and resolved:
      1. The Error: "srd: ValueError: Protocol decoder instance spdif-1:
           invalid literal for int() with base 2: '121111012112021111012120'"
         This error can happen if the sample rate is marginal. The correct function
         of the decoder depends on the position of the data stream. The pulse width
         calculation was wrong and the pulse width detection sometimes thought the
         same pulse classes to be different.
         The new decoder explicitly checks for short pulses and reports an error
         with a corresponding message.
      2. Bitrates were calculated wrong: The shown results were not usable at all.
         The new decoder uses the first ten frames to calculate the bit rates and
         uses the correct measurement units.
         Possible issue: The bit rate calculation assumes an ongoing data stream.
         It uses the time between the first and 10th frame.
         They need to be sent without interruption. But this should be no problem
         because SPDIF is meant to be a continuous stream.
      3. A missing samplerate, e.g. when used in sigrok-cli with binary input, lead
         to an error message on the original decoder.
         The new decoder just skips the output of the bitrate if the samplerate is
         missing. A missing samplerate no longer raises an error but only a message
         in the data output.
      4. The user was not informed about the integral steps of the decoder.
         The new decoder shows the results of the synchronisation process at the
         beginning. This can help to understand the behaviour of the decoder.
      This fixes bug #897.
    • Gerhard Sittig's avatar
      numbers_and_state: introduce decoder (based on vector slicer) · b094fdfc
      Gerhard Sittig authored
      The idea was taken from the vector slicer as suggested in github PR 17.
      The code was rewritten to avoid cluttering the decoder set with lots of
      tiny implementations. Create a single decoder which does all of the bit
      accumulation as well as number format interpretation and also includes
      number to text formatting with user selectable presentations. Optional
      clock is supported, to avoid too many annotations in glitchy setups. The
      IEEE 754 format was added as another interpretation. The enum code path
      accepts data files in either the Python or JSON format (the latter feels
      backwards to me). Putting enums on separate rows helps visualize state
      transitions. Users can disable GUI traces or select CLI rows to silence
      the output if it feels noisy.
      The most appropriate (useful, and usable) number of supported channels
      is yet to get determined. This version accepts up to 16 inputs.
  9. 19 Jul, 2020 1 commit
    • Gerhard Sittig's avatar
      irmp: silence "illegal character encoding" compiler warning · 33687d6e
      Gerhard Sittig authored
      Replace non-ASCII characters in the FDC keyboard map with their
      respective number values, since the character presentation is
      non-portable and results in compiler warnings.
      A similar change was done in IRMP version 3.2.0 (SVN r192 as of
      2020-06-22) which the sigrok project has not caught up with yet.
  10. 18 Jul, 2020 4 commits
    • Stefan's avatar
      rgb_led_ws281x: Support RGBW · 47ff9910
      Stefan authored
      Support of the now common RGBW type LED strips (uses 4 bytes instead of 3).
      Added an option to select RGB or RGBW
    • Gerhard Sittig's avatar
      caliper: rephrase measurement annotation text construction · ea0c4cb6
      Gerhard Sittig authored
      Unclutter the construction of the annotation text for measurements.
      Prefer one code block over multiple scatterred lines. Only do string
      formatting when an annotation gets emitted. Prefer .format() for its
      better control over generated text. Fixup remaining Python idioms in
      the unit conversion block while we are here.
    • Gerhard Sittig's avatar
      caliper: use common code for packet timeout · 9e208e00
      Gerhard Sittig authored
      The previous implementation unconditionally waited for up to 1ms, and
      optionally handled the user configured timeout period. Use common code
      instead to handle the full span of the timeout period. Which somewhat
      unclutters the .decode() routine's body by eliminating an unnecessary
      step in the sequence. This change also reduces indentation, and prefers
      Python's .format() over the old syntax.
    • Gerhard Sittig's avatar
      caliper: use common code for bit accumulation · 95435ac2
      Gerhard Sittig authored
      There is only one annotation, rename ss/es for consistency with other
      decoders. Move a conversion constant to the top of the source file, and
      rename some identifiers to increase readability of math expressions.
      There is no point in constructing numbers in MSB first order and then
      reversing their bit order. Prefer Python lists for accumulated bits, and
      common code for number conversion. Use one code block for the extraction
      and conversion of received data instead of a set of scattered lines.
      This shall increase readability of the data extraction, and eliminates
      redundancy in the implementation.