Index: firmware/App/Services/CommBuffers.c =================================================================== diff -u -r2505e43eaab426e0de49f67ebb9b78efcfd13f55 -r94a190522ce398399c7b93c59f788d7666ec0060 --- firmware/App/Services/CommBuffers.c (.../CommBuffers.c) (revision 2505e43eaab426e0de49f67ebb9b78efcfd13f55) +++ firmware/App/Services/CommBuffers.c (.../CommBuffers.c) (revision 94a190522ce398399c7b93c59f788d7666ec0060) @@ -1,17 +1,17 @@ /************************************************************************** * -* Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2021 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * -* @file CommBuffers.c +* @file CommBuffers.c * -* @author (last) Sean Nash -* @date (last) 19-Aug-2020 +* @author (last) Sean Nash +* @date (last) 25-Jun-2021 * -* @author (original) Dara Navaei -* @date (original) 05-Nov-2019 +* @author (original) Dara Navaei +* @date (original) 05-Nov-2019 * ***************************************************************************/ @@ -48,9 +48,8 @@ /*********************************************************************//** * @brief * The initCommBuffers function initializes the CommBuffers module. - * @details - * Inputs : none - * Outputs : CommBuffers module initialized. + * @details Inputs: none + * @details Outputs: CommBuffers module initialized. * @return none *************************************************************************/ void initCommBuffers( void ) @@ -68,9 +67,8 @@ * @brief * The clearBuffer function clears (empties) a given buffer. Caller should * ensure buffer won't be used while this function is clearing the buffer. - * @details - * Inputs : none - * Outputs : given buffer is cleared + * @details Inputs: none + * @details Outputs: given buffer is cleared * @param buffer the buffer to clear * @return none *************************************************************************/ @@ -101,9 +99,8 @@ * communication buffer. S/W fault if buffer too full to add data. This function * will always add to the active double buffer. This function should only be called * from the background, general, or priority tasks (BG or IRQ) for thread safety. - * @details - * Inputs : commBufferByteCount[], activeDoubleBuffer[] - * Outputs : commBuffers[], commBufferByteCount[] + * @details Inputs: commBufferByteCount[], activeDoubleBuffer[] + * @details Outputs: commBuffers[], commBufferByteCount[] * @param buffer which comm buffer to add data to * @param data pointer to byte array containing data to add * @param len length of data (in bytes) @@ -154,13 +151,6 @@ // if buffer was full, check persistence - trigger s/w fault if persists if ( TRUE == bufferFull ) { -#ifdef DEBUG_ENABLED - char debugStr[100]; - sprintf( debugStr, "Buf OF:#%3d,%3d, %02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\n", buffer, len, \ - data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7] ); - sendDebugData( (U08*)debugStr, strlen(debugStr) ); - sendDebugDataToUI( (U08*)debugStr ); -#endif clearBuffer( buffer ); // not first overflow? if ( firstBufferOverflowTimeStamp != 0 ) @@ -199,9 +189,8 @@ * the buffer. This function will draw from the inactive double buffer first and, * if needed, switch double buffers to draw the rest of the requested data. Only * one function in one thread should be calling this function for a given buffer. - * @details - * Inputs : commBuffers[], commBufferByteCount[], activeDoubleBuffer[] - * Outputs : commBuffers[], commBufferByteCount[], activeDoubleBuffer[], + * @details Inputs: commBuffers[], commBufferByteCount[], activeDoubleBuffer[] + * @details Outputs: commBuffers[], commBufferByteCount[], activeDoubleBuffer[], * and the given data array is populated with data from the buffer * @param buffer which comm buffer to retrieve data from * @param data pointer to byte array to stuff data into @@ -258,9 +247,8 @@ * peeks at them. A call to numberOfBytesInCommBuffer() should be made before * calling this function to determine how many bytes are currently in the buffer. * Do not call this function with a "len" longer than what is currently in the buffer. - * @details - * Inputs : commBuffers[], commBufferByteCount[], activeDoubleBuffer[] - * Outputs : given array populated with requested number of bytes from the buffer. + * @details Inputs: commBuffers[], commBufferByteCount[], activeDoubleBuffer[] + * @details Outputs: given array populated with requested number of bytes from the buffer. * @param buffer which comm buffer to retrieve data from * @param data pointer to byte array to stuff data into * @param len number of bytes to retrieve into given data array. @@ -312,9 +300,8 @@ * @brief * The numberOfBytesInCommBuffer function determines how many bytes are currently * contained in a given comm buffer. Both double buffers are considered for this. - * @details - * Inputs : activeDoubleBuffer[], commBufferByteCount[] - * Outputs : none + * @details Inputs: activeDoubleBuffer[], commBufferByteCount[] + * @details Outputs: none * @param buffer which comm buffer to get byte count for * @return the number of bytes in the given comm buffer. *************************************************************************/ @@ -343,9 +330,8 @@ * The switchDoubleBuffer function switches the active and inactive buffers for the * given buffer. This function should only be called when the current inactive buffer * has been emptied. Any unconsumed data in inactive buffer will be lost. - * @details - * Inputs : activeDoubleBuffer[] - * Outputs : activeDoubleBuffer[], commBufferByteCount[] + * @details Inputs: activeDoubleBuffer[] + * @details Outputs: activeDoubleBuffer[], commBufferByteCount[] * @param buffer which comm buffer to switch double buffers on * @return the new active buffer for the given buffer. *************************************************************************/ @@ -368,9 +354,8 @@ * The getDataFromInactiveBuffer function retrieves a given number of bytes * from the inactive buffer of a given buffer. This function should only be * called by getFromCommBuffer(). Params will be pre-validated there. - * @details - * Inputs : commBuffers[], activeDoubleBuffer[], commBufferByteCount[] - * Outputs : commBuffers[], activeDoubleBuffer[], commBufferByteCount[] + * @details Inputs: commBuffers[], activeDoubleBuffer[], commBufferByteCount[] + * @details Outputs: commBuffers[], activeDoubleBuffer[], commBufferByteCount[] * @param buffer which comm buffer get data from * @param data pointer to byte array to populate with data * @param len number of bytes to get from comm buffer