From 0ed3fd91f7e74ef7f5ea497c1426dcdf2bea331e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Fri, 26 Jan 2018 09:59:42 +0100 Subject: [PATCH] Removed dead code and fixed demoes --- TinyFrame.c | 9 --------- demo/demo.c | 2 +- demo/multipart_tx/test.c | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/TinyFrame.c b/TinyFrame.c index 922d189..883ab8b 100644 --- a/TinyFrame.c +++ b/TinyFrame.c @@ -11,9 +11,7 @@ #endif // Helper macros -#define TF_MAX(a, b) ((a)>(b)?(a):(b)) #define TF_MIN(a, b) ((a)<(b)?(a):(b)) - #define TF_TRY(func) do { if(!(func)) return false; } while (0) // TODO It would be nice to have per-instance configurable checksum types, but that would @@ -685,13 +683,6 @@ void _TF_FN TF_AcceptChar(TinyFrame *tf, unsigned char c) break; } //@formatter:on - - // we get here after finishing HEAD, if no data are to be received - handle and clear - // TODO verify - this seems unreachable under normal circumstances - if (tf->len == 0 && tf->state == TFState_DATA) { - TF_HandleReceivedMessage(tf); - TF_ResetParser(tf); - } } // Helper macros for the Compose functions diff --git a/demo/demo.c b/demo/demo.c index 7c030ab..6248c46 100644 --- a/demo/demo.c +++ b/demo/demo.c @@ -39,7 +39,7 @@ void demo_disconn(void) * @param buff * @param len */ -void TF_WriteImpl(TinyFrame *tf, const uint8_t *buff, size_t len) +void TF_WriteImpl(TinyFrame *tf, const uint8_t *buff, uint32_t len) { printf("\033[32mTF_WriteImpl - sending frame:\033[0m\n"); dumpFrame(buff, len); diff --git a/demo/multipart_tx/test.c b/demo/multipart_tx/test.c index a2c3a67..b6140f3 100644 --- a/demo/multipart_tx/test.c +++ b/demo/multipart_tx/test.c @@ -11,7 +11,7 @@ extern const char *romeo; * This function should be defined in the application code. * It implements the lowest layer - sending bytes to UART (or other) */ -void TF_WriteImpl(TinyFrame *tf, const uint8_t *buff, size_t len) +void TF_WriteImpl(TinyFrame *tf, const uint8_t *buff, uint32_t len) { printf("--------------------\n"); printf("\033[32mTF_WriteImpl - sending frame:\033[0m\n");