Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Commit

Permalink
Merge pull request #6 from peroxyacyl/2022.04.28-hotplug
Browse files Browse the repository at this point in the history
export functions for slave-wise configuration
  • Loading branch information
peroxyacyl authored May 11, 2022
2 parents 098634c + b3f635b commit 7a10b4c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
16 changes: 8 additions & 8 deletions SOEM/soem/ethercatconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ int ecx_detect_slaves(ecx_contextt *context)
return wkc;
}

static void ecx_set_slaves_to_default(ecx_contextt *context)
void ecx_set_slaves_to_default(ecx_contextt *context)
{
uint8 b;
uint16 w;
Expand Down Expand Up @@ -638,7 +638,7 @@ static int ecx_lookup_mapping(ecx_contextt *context, uint16 slave, int *Osize, i
return 0;
}

static int ecx_map_coe_soe(ecx_contextt *context, uint16 slave, int thread_n)
int ecx_map_coe_soe(ecx_contextt *context, uint16 slave, int thread_n)
{
int Isize, Osize;
int rval;
Expand Down Expand Up @@ -692,7 +692,7 @@ static int ecx_map_coe_soe(ecx_contextt *context, uint16 slave, int thread_n)
return 1;
}

static int ecx_map_sii(ecx_contextt *context, uint16 slave)
int ecx_map_sii(ecx_contextt *context, uint16 slave)
{
int Isize, Osize;
int nSM;
Expand Down Expand Up @@ -733,13 +733,13 @@ static int ecx_map_sii(ecx_contextt *context, uint16 slave)
}
context->slavelist[slave].Obits = Osize;
context->slavelist[slave].Ibits = Isize;
EC_PRINT(" ISIZE:%d %d OSIZE:%d\n",
context->slavelist[slave].Ibits, Isize,context->slavelist[slave].Obits);
EC_PRINT(" ISIZE:%d OSIZE:%d\n",
context->slavelist[slave].Ibits,context->slavelist[slave].Obits);

return 1;
}

static int ecx_map_sm(ecx_contextt *context, uint16 slave)
int ecx_map_sm(ecx_contextt *context, uint16 slave)
{
uint16 configadr;
int nSM;
Expand Down Expand Up @@ -893,7 +893,7 @@ static void ecx_config_find_mappings(ecx_contextt *context, uint8 group)
}
}

static void ecx_config_create_input_mappings(ecx_contextt *context, void *pIOmap,
void ecx_config_create_input_mappings(ecx_contextt *context, void *pIOmap,
uint8 group, int16 slave, uint32 * LogAddr, uint8 * BitPos)
{
int BitCount = 0;
Expand Down Expand Up @@ -1031,7 +1031,7 @@ static void ecx_config_create_input_mappings(ecx_contextt *context, void *pIOmap
context->slavelist[slave].FMMUunused = FMMUc;
}

static void ecx_config_create_output_mappings(ecx_contextt *context, void *pIOmap,
void ecx_config_create_output_mappings(ecx_contextt *context, void *pIOmap,
uint8 group, int16 slave, uint32 * LogAddr, uint8 * BitPos)
{
int BitCount = 0;
Expand Down
9 changes: 9 additions & 0 deletions SOEM/soem/ethercatconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ int ecx_config_map_group(ecx_contextt *context, void *pIOmap, uint8 group);
int ecx_config_overlap_map_group(ecx_contextt *context, void *pIOmap, uint8 group);
int ecx_recover_slave(ecx_contextt *context, uint16 slave, int timeout);
int ecx_reconfig_slave(ecx_contextt *context, uint16 slave, int timeout);
void ecx_init_context(ecx_contextt *context);
void ecx_set_slaves_to_default(ecx_contextt *context);
void ecx_config_create_input_mappings(ecx_contextt *context, void *pIOmap,
uint8 group, int16 slave, uint32 * LogAddr, uint8 * BitPos);
void ecx_config_create_output_mappings(ecx_contextt *context, void *pIOmap,
uint8 group, int16 slave, uint32 * LogAddr, uint8 * BitPos);
int ecx_map_coe_soe(ecx_contextt *context, uint16 slave, int thread_n);
int ecx_map_sii(ecx_contextt *context, uint16 slave);
int ecx_map_sm(ecx_contextt *context, uint16 slave);

#ifdef __cplusplus
}
Expand Down

0 comments on commit 7a10b4c

Please sign in to comment.