qpcpp/doxygen/snippets/qs_startup.cpp
MMS 34cdcc7929 7.0.0rc1
major release 7.0.0 release candidate 1
2022-04-19 19:23:30 -04:00

26 lines
686 B
C++

#ifdef Q_SPY
bool QS::onStartup(void const *arg) {
static uint8_t qsTxBuf[1024]; // buffer for QS transmit channel
static uint8_t qsRxBuf[100]; // buffer for QS receive channel
initBuf(qsTxBuf, sizeof(qsTxBuf));
rxInitBuf(qsRxBuf, sizeof(qsRxBuf));
// configure UART 0/1 for QSPY output ...
if (*(char const *)arg == '0') { // use UART 0
// configure UART 0 for QSPY output ...
. . .
return true; // UART 0 successfully opened
}
else { // use UART 1
// configure UART 1 for QSPY output ...
. . .
return false; // UART 1 successfully opened
}
}
. . .
#endif // Q_SPY