Skip to content

Commit

Permalink
fix for a compile bug & added TF_DeInit()
Browse files Browse the repository at this point in the history
  • Loading branch information
MightyPork committed Dec 14, 2017
1 parent db0ae30 commit ce06abf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion TinyFrame.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ TinyFrame * _TF_FN TF_Init(TF_Peer peer_bit)
return tf;
}

/** Release the struct */
void TF_DeInit(TinyFrame *tf)
{
if (tf == NULL) return;
free(tf);
}

//region Listeners

/** Reset ID listener's timeout to the original value */
Expand Down Expand Up @@ -696,7 +703,7 @@ static size_t _TF_FN TF_ComposeBody(uint8_t *outbuff,
* @param cksum - checksum variable used for the body
* @return nr of bytes in outbuff used
*/
static size_t _TF_FN TF_ComposeTail(uint8_t *outbuff, const TF_CKSUM *cksum)
static size_t _TF_FN TF_ComposeTail(uint8_t *outbuff, TF_CKSUM *cksum)
{
int8_t si = 0; // signed small int
uint8_t b = 0;
Expand Down
9 changes: 8 additions & 1 deletion TinyFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Upstream URL: https://github.com/MightyPork/TinyFrame
*/

#define TF_VERSION "2.0.0"
#define TF_VERSION "2.0.1"

//---------------------------------------------------------------------------
#include <stdint.h> // for uint8_t etc
Expand Down Expand Up @@ -235,6 +235,13 @@ TinyFrame *TF_Init(TF_Peer peer_bit);
*/
void TF_InitStatic(TinyFrame *tf, TF_Peer peer_bit);

/**
* De-init the dynamically allocated TF instance
*
* @param tf
*/
void TF_DeInit(TinyFrame *tf);

/**
* Reset the frame parser state machine.
* This does not affect registered listeners.
Expand Down

0 comments on commit ce06abf

Please # to comment.