/*============================================================================ Name : Transmit_Delta ------------------------------------------------------------------------------ Purpose : Transmits the channel delta values to QTouch Studio Input : n/a Output : n/a Notes : The value is equal to signal-reference ============================================================================*/ void Transmit_Delta(void) { int16_t delta; /* avoid Cppcheck Warning */ UNUSED(delta); #if ((DEF_TOUCH_QMATRIX == 1) || \ (DEF_TOUCH_QTOUCH_GRP_A == 1) || \ (DEF_TOUCH_QTOUCH_GRP_B == 1)) uint8_t c; PutChar(QT_DELTAS); for (c=0; c < QDEBUG_NUM_SENSORS; c++) { QDEBUG_GET_DELTA_FUNC( c, &delta); PutChar((uint8_t)((delta >>8) & 0xFFu)); PutChar((uint8_t)(delta & 0xFFu)); } #endif #if DEF_TOUCH_AUTONOMOUS_QTOUCH == 1 uint16_t reference = *(QDEBUG_REFERENCES_PTR); uint16_t signal = *(QDEBUG_SIGNALS_PTR); uint16_t unsigned_delta = (uint16_t)( reference - signal ); delta = (int16_t) unsigned_delta; PutChar(QT_DELTAS); PutChar((uint8_t)((delta >>8) & 0xFFu)); PutChar((uint8_t)(delta & 0xFFu)); #endif Send_Message(); }
/*! \brief Transmits the channel delta values to QTouch Studio. */ void Transmit_Delta(void) { int16_t delta; UNUSED(delta); /* Dummy. To avoid warning. */ #if ((DEF_TOUCH_QDEBUG_ENABLE_QM == 1) ||\ (DEF_TOUCH_QDEBUG_ENABLE_QTA == 1) ||\ (DEF_TOUCH_QDEBUG_ENABLE_QTB == 1)) uint8_t c; PutChar(QT_DELTAS); for (c = 0; c < QDEBUG_NUM_SENSORS; c++) { QDEBUG_GET_DELTA_FUNC(c, &delta); PutChar((uint8_t)((delta >> 8) & 0xFFu)); PutChar((uint8_t)(delta & 0xFFu)); } #endif #if DEF_TOUCH_QDEBUG_ENABLE_AT == 1 uint16_t reference = *(QDEBUG_REFERENCES_PTR); uint16_t signal = *(QDEBUG_SIGNALS_PTR); uint16_t unsigned_delta = (uint16_t)(reference - signal); delta = (int16_t)unsigned_delta; PutChar(QT_DELTAS); PutChar((uint8_t)((delta >> 8) & 0xFFu)); PutChar((uint8_t)(delta & 0xFFu)); #endif Send_Message(); }
/*! \brief Transmits the channel delta values to QTouch Studio. */ void Transmit_Delta(void) { touch_ret_t touch_ret = TOUCH_SUCCESS; int16_t delta; uint8_t c; PutChar(QT_DELTAS); for (c = 0; c < QDEBUG_NUM_SENSORS; c++) { touch_ret = QDEBUG_GET_DELTA_FUNC(c, &delta); if (touch_ret != TOUCH_SUCCESS) { while (1u) { /* Check API Error return code. */ } } PutChar((uint8_t)((delta >> 8) & 0xFFu)); PutChar((uint8_t)(delta & 0xFFu)); } Send_Message(); }