fix for a compile bug & added TF_DeInit()

pull/14/head 2.0.1
Ondřej Hruška 7 years ago
parent db0ae30f41
commit ce06abfdbf
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 9
      TinyFrame.c
  2. 9
      TinyFrame.h

@ -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 */
@ -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;

@ -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
@ -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.

Loading…
Cancel
Save