qpcpp/doxygen/snippets/qs_startup.cpp

26 lines
686 B
C++
Raw Normal View History

2012-08-14 18:00:48 -04:00
#ifdef Q_SPY
2013-10-10 20:01:51 -04:00
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));
2012-08-14 18:00:48 -04:00
// configure UART 0/1 for QSPY output ...
2013-10-10 20:01:51 -04:00
if (*(char const *)arg == '0') { // use UART 0
2012-08-14 18:00:48 -04:00
// configure UART 0 for QSPY output ...
. . .
2013-10-10 20:01:51 -04:00
return true; // UART 0 successfully opened
2012-08-14 18:00:48 -04:00
}
2013-10-10 20:01:51 -04:00
else { // use UART 1
// configure UART 1 for QSPY output ...
2012-08-14 18:00:48 -04:00
. . .
2013-10-10 20:01:51 -04:00
return false; // UART 1 successfully opened
2012-08-14 18:00:48 -04:00
}
}
. . .
#endif // Q_SPY