Skip to content

Commit

Permalink
copied readTextFile function
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Weyand committed Dec 28, 2011
1 parent 6da96d0 commit 6aee4d3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion tbchat.c
Expand Up @@ -16,7 +16,6 @@

#include "usetable.h"


/*Global Communication Config*/
uint8_t mac[5] = {1,2,3,5,5};
struct NRF_CFG config =
Expand All @@ -32,6 +31,8 @@ unsigned char recvbuf[32];
unsigned char sendbuf[32];

uint8_t recv_msg(unsigned char **msg);
void send_msg(unsigned char *msg);
int readTextFile(char * filename, char * data, int len);

void ram(void)
{
Expand Down Expand Up @@ -63,6 +64,16 @@ void ram(void)
}
}

// Copy from filesystem/util.c since the function is not exported
int readTextFile(char * filename, char * data, int len){
UINT readbytes;

readbytes=readFile(filename,data,len-1);
if(len>=0)
data[readbytes]=0;
return readbytes;
};

uint8_t recv_msg(unsigned char **msg)
{
nrf_config_set(&config);
Expand Down

0 comments on commit 6aee4d3

Please sign in to comment.