mirror of https://github.com/rusefi/wideband.git
uart: introduce TS_SECONDARY_SERIAL_PORT (#245)
(cherry picked from commit 9d8bbe38d1e63384ef0d66d3330363c894f2901b) Co-authored-by: Andrey Gusakov <dron0gus@gmail.com>
This commit is contained in:
parent
c7a8365ea3
commit
67f4aa45fe
|
@ -95,6 +95,22 @@ struct PrimaryChannelThread : public TunerstudioThread {
|
||||||
|
|
||||||
static PrimaryChannelThread primaryChannelThread;
|
static PrimaryChannelThread primaryChannelThread;
|
||||||
|
|
||||||
|
#ifdef TS_SECONDARY_SERIAL_PORT
|
||||||
|
static SerialTsChannel secondaryChannel(TS_SECONDARY_SERIAL_PORT);
|
||||||
|
|
||||||
|
struct SecondaryChannelThread : public TunerstudioThread {
|
||||||
|
SecondaryChannelThread() : TunerstudioThread("Secondary TS Channel") { }
|
||||||
|
|
||||||
|
TsChannelBase* setupChannel() {
|
||||||
|
secondaryChannel.start(TS_SECONDARY_BAUDRATE);
|
||||||
|
|
||||||
|
return &secondaryChannel;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static SecondaryChannelThread secondaryChannelThread;
|
||||||
|
|
||||||
|
#endif /* TS_SECONDARY_SERIAL_PORT */
|
||||||
#endif /* TS_ENABLED */
|
#endif /* TS_ENABLED */
|
||||||
|
|
||||||
void InitUart()
|
void InitUart()
|
||||||
|
@ -104,5 +120,8 @@ void InitUart()
|
||||||
#endif
|
#endif
|
||||||
#ifdef TS_ENABLED
|
#ifdef TS_ENABLED
|
||||||
primaryChannelThread.Start();
|
primaryChannelThread.Start();
|
||||||
|
#ifdef TS_SECONDARY_SERIAL_PORT
|
||||||
|
secondaryChannelThread.Start();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue