## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+## along with this program; if not, see <http://www.gnu.org/licenses/>.
##
import sigrokdecode as srd
('rgb', 'RGB', (2,)),
)
- def __init__(self, **kwargs):
+ def __init__(self):
self.samplerate = None
self.oldpin = None
- self.packet_ss = None
+ self.ss_packet = None
self.ss = None
self.es = None
self.bits = []
if len(self.bits) == 24:
grb = reduce(lambda a, b: (a << 1) | b, self.bits)
rgb = (grb & 0xff0000) >> 8 | (grb & 0x00ff00) << 8 | (grb & 0x0000ff)
- self.put(self.packet_ss, samplenum, self.out_ann,
+ self.put(self.ss_packet, samplenum, self.out_ann,
[2, ['#%06x' % rgb]])
self.bits = []
- self.packet_ss = None
+ self.ss_packet = None
def decode(self, ss, es, data):
if not self.samplerate:
self.inreset = True
self.bits = []
- self.packet_ss = None
+ self.ss_packet = None
self.ss = None
if not self.oldpin and pin:
self.bits.append(bit_)
self.handle_bits(samplenum)
- if self.packet_ss is None:
- self.packet_ss = samplenum
+ if self.ss_packet is None:
+ self.ss_packet = samplenum
self.ss = samplenum