Skip to content

Commit

Permalink
Merge pull request #17 from paulpatience/master
Browse files Browse the repository at this point in the history
Use fewer headers and change i to uint16_t
  • Loading branch information
pavel-kirienko committed May 12, 2016
2 parents 34195e7 + 27b3c87 commit ba523d0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/canard.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "canard.h"
#include "canard_internals.h"
#include <inttypes.h>
#include <string.h>


#define CANARD_MAKE_TRANSFER_DESCRIPTOR(data_type_id, transfer_type, \
Expand Down Expand Up @@ -299,7 +300,7 @@ void canardHandleRxFrame(CanardInstance* ins, const CanardCANFrame* frame, uint6
uint16_t middle_len = 0;
if (rxstate->payload_len < CANARD_RX_PAYLOAD_HEAD_SIZE)
{
int i;
uint16_t i;
for (i=rxstate->payload_len, tail_offset=0; i<CANARD_RX_PAYLOAD_HEAD_SIZE && tail_offset<frame->data_len-1; i++, tail_offset++)
{
rxstate->buffer_head[i] = frame->data[tail_offset];
Expand Down
5 changes: 0 additions & 5 deletions src/canard.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,8 @@
extern "C" {
#endif

#include <stdio.h>
#include <unistd.h>
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>

/** The size of a memory block in bytes. */
Expand Down
2 changes: 1 addition & 1 deletion src/canard_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#ifndef CANARD_INTERNALS_H
#define CANARD_INTERNALS_H

#include <unistd.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
Expand Down
2 changes: 0 additions & 2 deletions src/canard_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>
#include <pthread.h>
#include "canard.h"
// #include "canard_debug.h"
/*
Expand Down

0 comments on commit ba523d0

Please sign in to comment.