Commit 88039001 authored by Guilherme Sanches's avatar Guilherme Sanches

Changes in the occan driver

The occan_read and occan_write function went through a major changes on
the while loops and the way information is passed from the iop_buffers
to the CANMsg and vice versa.
parent adecd584
......@@ -75,14 +75,6 @@ typedef struct {
} iop_wrapper_t;
/**
* @brief List of elements
*/
......
......@@ -5,7 +5,7 @@
* ============================================================================
*/
#include <iop.h>
#include <occan.h>
#include <iop_occan.h>
#include <can_support.h>
/**
......@@ -95,9 +95,9 @@ static iop_can_device_t device_configuration = \
.close = occan_close,
},
.dev_name ="/dev/occan0",
.count = 0,
.flags = 0,
.bytes_moved = 0,
// .count = 0,
// .flags = 0,
// .bytes_moved = 0,
};
/**
......
This diff is collapsed.
......@@ -37,12 +37,17 @@ uint8_t occan_fifo_clear(occan_fifo *queue ){
return 1;
}
/* TODO force put option for when the queue is full */
uint8_t occan_fifo_put(occan_fifo *queue, CANMsg *new, int force){
int i;
if(queue->max -queue->cnt < 1){
/* queue is full */
return 0;
if(!force)
{
return 0;
}else
{
queue->ovcnt++;
}
}
queue->fifo[queue->last].extended = new->extended;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment