From 2b3f827af1cd5d670963e817af6ef91f30a4a892 Mon Sep 17 00:00:00 2001 From: jontio Date: Tue, 15 Nov 2016 11:06:30 +1300 Subject: [PATCH] 5A uint16 and 5A auto start bug fix --- JMPX/mainwindow.cpp | 2 +- libJMPX/rds.h | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/JMPX/mainwindow.cpp b/JMPX/mainwindow.cpp index 6e3c784..837674c 100644 --- a/JMPX/mainwindow.cpp +++ b/JMPX/mainwindow.cpp @@ -200,6 +200,6 @@ void MainWindow::songtitlecheck(const QString &title) void MainWindow::pushdatato5a(const QByteArray &data) { - if((!pJMPX)||!pJMPX.data()->IsActive())return; + if(!pJMPX)return; pJMPX->RDS_Set_5A_data(data); } diff --git a/libJMPX/rds.h b/libJMPX/rds.h index 6432079..3e24d08 100644 --- a/libJMPX/rds.h +++ b/libJMPX/rds.h @@ -204,16 +204,16 @@ class RDS0AGroup : public RDSGroup switch(c) { case 0: - blk=((((quint16)ba[0])<<8)|((quint16)ba[1])); + blk=((((quint16)((uchar)ba[0]))<<8)|((quint16)((uchar)ba[1]))); break; case 1: - blk=((((quint16)ba[2])<<8)|((quint16)ba[3])); + blk=((((quint16)((uchar)ba[2]))<<8)|((quint16)((uchar)ba[3]))); break; case 2: - blk=((((quint16)ba[4])<<8)|((quint16)ba[5])); + blk=((((quint16)((uchar)ba[4]))<<8)|((quint16)((uchar)ba[5]))); break; case 3: - blk=((((quint16)ba[6])<<8)|((quint16)ba[7])); + blk=((((quint16)((uchar)ba[6]))<<8)|((quint16)((uchar)ba[7]))); break; } setBlock(blk,RDSGroup::Block_D); @@ -289,11 +289,11 @@ class RDS2AGroup : public RDSGroup setBlock(blk,RDSGroup::Block_B); //C - blk=((((quint16)ba[4*c])<<8)|((quint16)ba[4*c+1])); + blk=((((quint16)((uchar)ba[4*c]))<<8)|((quint16)((uchar)ba[4*c+1]))); setBlock(blk,RDSGroup::Block_C); //D - blk=((((quint16)ba[4*c+2])<<8)|((quint16)ba[4*c+3])); + blk=((((quint16)((uchar)ba[4*c+2]))<<8)|((quint16)((uchar)ba[4*c+3]))); setBlock(blk,RDSGroup::Block_D); if((ba[4*c]==(char)0x0D)|(ba[4*c+1]==(char)0x0D)|(ba[4*c+2]==(char)0x0D)|(ba[4*c+3]==(char)0x0D))c=-1; @@ -413,7 +413,7 @@ class RDS5AGroup : public RDSGroup setBlock(pi,RDSGroup::Block_A); //B - channel=ba[c]; + channel=((uchar)ba[c]); blk=0x5000; if(tp)blk|=0x0400; blk|=(((quint16)pty)<<5); @@ -421,11 +421,11 @@ class RDS5AGroup : public RDSGroup setBlock(blk,RDSGroup::Block_B); //C - blk=((((quint16)ba[c+1])<<8)|((quint16)ba[c+2])); + blk=((((quint16)((uchar)ba[c+1]))<<8)|((quint16)((uchar)ba[c+2]))); setBlock(blk,RDSGroup::Block_C); //D - blk=((((quint16)ba[c+3])<<8)|((quint16)ba[c+4])); + blk=((((quint16)((uchar)ba[c+3]))<<8)|((quint16)((uchar)ba[c+4]))); setBlock(blk,RDSGroup::Block_D); c+=5;c%=ba.size();