fix: ir_sirc decoder script build error

This commit is contained in:
dreamsourcelabTAI 2022-02-22 11:26:28 +08:00
parent f8191599f5
commit 7e9b044fa4
3 changed files with 18 additions and 4 deletions

View File

@ -29,7 +29,7 @@
#include <QDir>
#include <QTranslator>
#include <QDesktopServices>
#include <QStyle>
#include <QStyle>
#include "dsapplication.h"
#include "mystyle.h"
@ -111,7 +111,7 @@ int main(int argc, char *argv[])
QApplication::setOrganizationName("DreamSourceLab");
QApplication::setOrganizationDomain("www.DreamSourceLab.com");
printf("\n-----------------version: %s-----------------\n\n", DS_VERSION_STRING);
qDebug()<<"\n----------------- version:"<<DS_VERSION_STRING<<"-----------------\n\n";
#ifdef Q_OS_LINUX
// Use low version qt plugins, for able to debug

View File

@ -136,7 +136,7 @@ public:
}
void begin_decode_work();
void do_decode_work();
void stop_decode_work();
int list_rows_size();
bool options_changed();
@ -153,7 +153,7 @@ private:
void decode_data(const uint64_t decode_start, const uint64_t decode_end, srd_session *const session);
void decode_proc();
static void annotation_callback(srd_proto_data *pdata, void *decoder);
void do_decode_work();
signals:
void new_decode_data();

14
libsigrokdecode4DSL/decoders/common/srdhelper/mod.py Normal file → Executable file
View File

@ -31,6 +31,20 @@ def bin2int(s: str):
def bitpack(bits):
return sum([b << i for i, b in enumerate(bits)])
def bitpack_lsb(bits, idx=None):
'''Conversion from LSB first bit sequence to integer.'''
if idx is not None:
bits = [b[idx] for b in bits]
return bitpack(bits)
def bitpack_msb(bits, idx=None):
'''Conversion from MSB first bit sequence to integer.'''
bits = bits[:]
if idx is not None:
bits = [b[idx] for b in bits]
bits.reverse()
return bitpack(bits)
def bitunpack(num, minbits=0):
res = []
while num or minbits > 0: