Removed dead code and fixed demoes

pull/14/head
Ondřej Hruška 7 years ago
parent 137797cc7d
commit 0ed3fd91f7
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 9
      TinyFrame.c
  2. 2
      demo/demo.c
  3. 2
      demo/multipart_tx/test.c

@ -11,9 +11,7 @@
#endif #endif
// Helper macros // Helper macros
#define TF_MAX(a, b) ((a)>(b)?(a):(b))
#define TF_MIN(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) #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 // 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; break;
} }
//@formatter:on //@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 // Helper macros for the Compose functions

@ -39,7 +39,7 @@ void demo_disconn(void)
* @param buff * @param buff
* @param len * @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"); printf("\033[32mTF_WriteImpl - sending frame:\033[0m\n");
dumpFrame(buff, len); dumpFrame(buff, len);

@ -11,7 +11,7 @@ extern const char *romeo;
* This function should be defined in the application code. * This function should be defined in the application code.
* It implements the lowest layer - sending bytes to UART (or other) * 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("--------------------\n");
printf("\033[32mTF_WriteImpl - sending frame:\033[0m\n"); printf("\033[32mTF_WriteImpl - sending frame:\033[0m\n");

Loading…
Cancel
Save