fixed the bug

pull/9/head
Ondřej Hruška 7 years ago
parent e9b4990b40
commit 9a1dbe6757
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 13
      TinyFrame.c
  2. 7
      demo/multipart_tx/Makefile
  3. 2
      demo/multipart_tx/test.c
  4. 2
      demo/socket_demo/Makefile

@ -145,8 +145,13 @@ static inline uint32_t crc32_byte(uint32_t cksum, const uint8_t byte)
/** Init with a user-allocated buffer */
void _TF_FN TF_InitStatic(TinyFrame *tf, TF_Peer peer_bit)
{
// Zero it out
memset(&tf, 0, sizeof(struct TinyFrame_));
if (tf == NULL) return;
// Zero it out, keeping user config
uint32_t usertag = tf->usertag;
memset(tf, 0, sizeof(struct TinyFrame_));
tf->usertag = usertag;
tf->peer_bit = peer_bit;
}
@ -833,11 +838,15 @@ void _TF_FN TF_Tick(TinyFrame *tf)
/** Default impl for claiming write mutex; can be specific to the instance */
void __attribute__((weak)) TF_ClaimTx(TinyFrame *tf)
{
(void) tf;
// do nothing
}
/** Default impl for releasing write mutex; can be specific to the instance */
void __attribute__((weak)) TF_ReleaseTx(TinyFrame *tf)
{
(void) tf;
// do nothing
}

@ -1,11 +1,12 @@
CFILES=../utils.c ../../TinyFrame.c
INCLDIRS=-I. -I.. -I../..
CFLAGS=-O0 -ggdb --std=gnu99 -Wno-main -Wall -Wextra $(CFILES) $(INCLDIRS)
CFLAGS=-O0 -ggdb --std=gnu99 -Wno-main -Wall -Wno-unused -Wextra $(CFILES) $(INCLDIRS)
run: test.bin
./test.bin
build: test.bin
run: test.bin
./test.bin
test.bin: test.c $(CFILES)
gcc test.c $(CFLAGS) -o test.bin

@ -25,7 +25,7 @@ void TF_WriteImpl(TinyFrame *tf, const uint8_t *buff, size_t len)
TF_Result myListener(TinyFrame *tf, TF_Msg *msg)
{
dumpFrameInfo(msg);
if (strcmp(msg->data, romeo) == 0) {
if (strcmp((const char *) msg->data, romeo) == 0) {
printf("FILE TRANSFERRED OK!\r\n");
}
else {

@ -1,6 +1,6 @@
CFILES=../demo.c ../utils.c ../../TinyFrame.c
INCLDIRS=-I. -I.. -I../..
CFLAGS=-O0 -ggdb --std=gnu99 -Wno-main -Wall -Wextra $(CFILES) $(INCLDIRS)
CFLAGS=-O0 -ggdb --std=gnu99 -Wno-main -Wall -Wno-unused -Wextra $(CFILES) $(INCLDIRS)
build: master.bin slave.bin

Loading…
Cancel
Save