Skip to content

Commit

Permalink
[squash me] fixed minor coding convention problems
Browse files Browse the repository at this point in the history
  • Loading branch information
fnack committed Dec 1, 2014
1 parent 7828e55 commit aad564d
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
3 changes: 2 additions & 1 deletion drivers/cc110x/cc110x-netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
#ifdef MODULE_NETDEV_BASE
extern netdev_rcv_data_cb_t cc110x_recv_cb;

int _cc110x_send_data(netdev_t *dev, void *dest, size_t dest_len, netdev_hlist_t *upper_layer_hdrs, void *data, size_t data_len)
int _cc110x_send_data(netdev_t *dev, void *dest, size_t dest_len,
netdev_hlist_t *upper_layer_hdrs, void *data, size_t data_len)
{
netdev_hlist_t *ptr = upper_layer_hdrs;
uint8_t tx_buffer[data_len + netdev_get_hlist_len(upper_layer_hdrs)];
Expand Down
12 changes: 8 additions & 4 deletions drivers/cc110x/cc110x-rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@
netdev_rcv_data_cb_t cc110x_recv_cb = NULL;
#endif

/* Internal function prototypes */
static uint8_t receive_packet_variable(uint8_t *rxBuffer, radio_packet_length_t length);
static uint8_t receive_packet(uint8_t *rxBuffer, radio_packet_length_t length);

rx_buffer_t cc110x_rx_buffer[RX_BUF_SIZE]; ///< RX buffer
volatile uint8_t rx_buffer_next; ///< Next packet in RX queue
/* Global variables */
rx_buffer_t cc110x_rx_buffer[RX_BUF_SIZE]; /* RX buffer */
volatile uint8_t rx_buffer_next; /* Next packet in RX queue */

void cc110x_rx_handler(void *args)
{
Expand All @@ -52,7 +54,8 @@ void cc110x_rx_handler(void *args)
/* Possible packet received, RX -> IDLE (0.1 us) */
cc110x_statistic.packets_in++;

res = receive_packet((uint8_t *)&(cc110x_rx_buffer[rx_buffer_next].packet), sizeof(cc110x_packet_t));
res = receive_packet((uint8_t *)&(cc110x_rx_buffer[rx_buffer_next].packet),
sizeof(cc110x_packet_t));

if (res) {
/* If we are sending a burst, don't accept packets.
Expand Down Expand Up @@ -88,7 +91,8 @@ void cc110x_rx_handler(void *args)
#ifdef MODULE_NETDEV_BASE
if (cc110x_recv_cb != NULL) {
cc110x_packet_t p = cc110x_rx_buffer[rx_buffer_next].packet;
cc110x_recv_cb(&cc110x_dev, &p.phy_src, sizeof(uint8_t), &p.address, sizeof(uint8_t), p.data, p.length - CC1100_HEADER_LENGTH);
cc110x_recv_cb(&cc110x_dev, &p.phy_src, sizeof(uint8_t), &p.address,
sizeof(uint8_t), p.data, p.length - CC1100_HEADER_LENGTH);
}
#endif

Expand Down
29 changes: 14 additions & 15 deletions drivers/cc110x/cc110x.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,25 @@
#define ENABLE_DEBUG (0)
#include "debug.h"

/* some externals */
extern uint8_t pa_table[]; ///< PATABLE with available output powers
extern uint8_t pa_table_index; ///< Current PATABLE Index

/* global variables */

cc110x_statistic_t cc110x_statistic;

volatile cc110x_flags rflags; ///< Radio control flags
volatile uint8_t radio_state = RADIO_UNKNOWN; ///< Radio state

static radio_address_t radio_address; ///< Radio address
static uint8_t radio_channel; ///< Radio channel

/* internal function prototypes */
/* Internal function prototypes */
static int rd_set_mode(int mode);
static void reset(void);
static void power_up_reset(void);
static void write_register(uint8_t r, uint8_t value);

/* External variables */
extern uint8_t pa_table[]; /* PATABLE with available output powers */
extern uint8_t pa_table_index; /* Current PATABLE Index */

/* Global variables */
cc110x_statistic_t cc110x_statistic; /* Statistic values for debugging */

volatile cc110x_flags rflags; /* Radio control flags */
volatile uint8_t radio_state = RADIO_UNKNOWN; /* Radio state */

static radio_address_t radio_address; /* Radio address */
static uint8_t radio_channel; /* Radio channel */

/*---------------------------------------------------------------------------*
* Radio Driver API *
*---------------------------------------------------------------------------*/
Expand Down

0 comments on commit aad564d

Please sign in to comment.