Skip to content

Commit 4885863

Browse files
authored
Merge pull request #62 from LucasMahieu/end_bug
Rename end() function to avoid potential duplicate with linker symbol
2 parents 2476df8 + 10f6f82 commit 4885863

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/telemetry/c/framing.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void outgoing_storage(uint8_t * buf, uint32_t bufSize)
5454
outgoingStorage.size = bufSize;
5555
}
5656

57-
void begin()
57+
void begin_frame()
5858
{
5959
if(outgoingStorage.size == 0 || outgoingStorage.ptr == NULL)
6060
return;
@@ -97,7 +97,7 @@ void append4(uint32_t fourbytes)
9797
append(ptr[3]);
9898
}
9999

100-
uint32_t end()
100+
uint32_t end_frame()
101101
{
102102
if(outgoingStorage.size == 0 || outgoingStorage.ptr == NULL)
103103
return 0;

src/telemetry/c/telemetry_core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ uint16_t payload(const void * p, uint32_t size, uint16_t crc)
192192
void frame(const char * t, TM_type type, const void * data, uint32_t datasize)
193193
{
194194
// start new frame
195-
begin();
195+
begin_frame();
196196

197197
// header
198198
uint16_t crc = header(type);
@@ -207,7 +207,7 @@ void frame(const char * t, TM_type type, const void * data, uint32_t datasize)
207207
append2(crc);
208208

209209
// complete frame
210-
uint32_t bytesAmount = end();
210+
uint32_t bytesAmount = end_frame();
211211

212212
// send data
213213
send(outgoingBuffer, bytesAmount);

src/telemetry/headers/framing.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ void initialize_framing();
99
// Set storage for the outgoing frame
1010
void outgoing_storage(uint8_t * buf, uint32_t bufSize);
1111

12-
void begin();
12+
void begin_frame();
1313
void append(uint8_t byte);
1414
void append2(uint16_t twobytes);
1515
void append4(uint32_t fourbytes);
16-
uint32_t end();
16+
uint32_t end_frame();
1717

1818
// Incoming data
1919
// Set storage for the incoming data

test/c/framing_outgoing_suite.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ TEST framing_simple_frame()
88
initialize_framing();
99
outgoing_storage(outgoingBuffer,12);
1010

11-
begin();
11+
begin_frame();
1212
append(0xFF);
13-
uint32_t amount = end();
13+
uint32_t amount = end_frame();
1414

1515
ASSERT_EQ_FMT(3,amount,"%d");
1616

@@ -33,11 +33,11 @@ TEST framing_with_escaping()
3333
initialize_framing();
3434
outgoing_storage(outgoingBuffer,12);
3535

36-
begin();
36+
begin_frame();
3737
append(0xF7);
3838
append(0x7F);
3939
append(0x7D);
40-
uint32_t amount = end();
40+
uint32_t amount = end_frame();
4141

4242
ASSERT_EQ_FMT(8,amount,"%d");
4343

@@ -59,10 +59,10 @@ TEST framing_overflow()
5959
initialize_framing();
6060
outgoing_storage(outgoingBuffer,3);
6161

62-
begin();
62+
begin_frame();
6363
append(0xFF);
6464
append(0xFF);
65-
uint32_t amount = end();
65+
uint32_t amount = end_frame();
6666

6767
ASSERT_EQ_FMT(0,amount,"%d");
6868

0 commit comments

Comments
 (0)