Skip to content

Commit

Permalink
Adding prints to debug controlword
Browse files Browse the repository at this point in the history
  • Loading branch information
preston-rogers committed Sep 10, 2024
1 parent 158c175 commit 1819dd2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/jsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void jsd_write(jsd_t* self) {

// Write EtherCat frame to slaves, with logic for smart prints
int transmitted = ecx_send_overlap_processdata(&self->ecx_context);

WARNING("\nSENDING THE OVERLAP PROCESSDATA!!!\n");
static int last_transmitted = 1;
if (transmitted <= 0 && last_transmitted != transmitted) {
WARNING("ecx_send_overlap_processdata is not transmitting");
Expand Down
11 changes: 11 additions & 0 deletions src/jsd_epd_nominal.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,17 @@ void jsd_epd_nominal_process(jsd_t* self, uint16_t slave_id) {

jsd_epd_nominal_process_state_machine(self, slave_id);

unsigned int controlword_uint = (unsigned int)self->slave_states[slave_id].epd_nominal.rxpdo.controlword;
WARNING("Bits of rxpdo controlword:\n");
for(int bit=0;bit<(sizeof(unsigned int) * 8); bit++)
{
WARNING("%i ", controlword_uint & 0x01);
controlword_uint = controlword_uint >> 1;
}
WARNING("\n");

WARNING("Controlword is now ")

// Copy RxPDO data into SOEM's IOmap
assert(sizeof(jsd_epd_nominal_rxpdo_data_t) ==
self->ecx_context.slavelist[slave_id].Obytes);
Expand Down

0 comments on commit 1819dd2

Please sign in to comment.