EoE updates

- Add missing EoE include, make worker semaphore global to be able to
   trigger from application
 - Add an EoE fragment sent event callback
pull/52/head
Andreas Karlsson 2019-04-03 17:58:46 +02:00 committed by Hans-Erik Floryd
parent 54de5af4b5
commit 68427b6e1e
4 changed files with 10 additions and 1 deletions

View File

@ -6,6 +6,7 @@
#include "esc.h"
#include "esc_coe.h"
#include "esc_foe.h"
#include "esc_eoe.h"
#include "ecat_slv.h"
#define IS_RXPDO(index) ((index) >= 0x1600 && (index) < 0x1800)

View File

@ -901,6 +901,10 @@ static void EOE_send_fragment ()
EOEvar.txframeoffset += len_to_send;
EOEvar.txfragmentno += 1;
}
if(eoe_cfg->fragment_sent_event != NULL)
{
eoe_cfg->fragment_sent_event();
}
}
}

View File

@ -43,6 +43,8 @@ typedef struct eoe_cfg
void (*handle_recv_buffer) (uint8_t port, eoe_pbuf_t * ebuf);
/** Callback to fetch a buffer to send */
int (*fetch_send_buffer) (uint8_t port, eoe_pbuf_t * ebuf);
/** Callback to notify the application fragment sent */
void (*fragment_sent_event) (void);
} eoe_cfg_t;
int EOE_ecat_get_mac (uint8_t port, uint8_t mac[]);

View File

@ -22,9 +22,11 @@
#define ESCADDR(x) (((uint8_t *) ECAT0_BASE) + x)
/* Global sem to make it possible to kick worker from the application */
sem_t * ecat_isr_sem;
static volatile esc_registers_t * ecat0 = (esc_registers_t *)ECAT0_BASE;
static int use_all_interrupts = 0;
static sem_t * ecat_isr_sem;
static void sync0_isr (void * arg);
static volatile uint8_t read_ack;