@@ -165,17 +165,17 @@ bool jsd_init(jsd_t* self, const char* ifname, uint8_t enable_autorecovery) {
165
165
self -> ecx_context .slavelist [0 ].state = EC_STATE_OPERATIONAL ;
166
166
167
167
ecx_send_overlap_processdata (& self -> ecx_context );
168
- uint64_t * bad_wkc_indices ;
169
- * bad_wkc_indices = 0 ;
168
+ uint64 bad_wkc_indices_val = 0 ;
169
+ uint64 * bad_wkc_indices = & bad_wkc_indices_val ;
170
170
ecx_receive_processdata (& self -> ecx_context , EC_TIMEOUTRET , bad_wkc_indices );
171
171
172
172
ecx_writestate (& self -> ecx_context , 0 );
173
173
174
174
int attempt = 0 ;
175
175
while (true) {
176
176
int sent = ecx_send_overlap_processdata (& self -> ecx_context );
177
- uint64_t * bad_wkc_indices ;
178
- * bad_wkc_indices = 0 ;
177
+ uint64 bad_wkc_indices_val = 0 ;
178
+ uint64 * bad_wkc_indices = & bad_wkc_indices_val ;
179
179
int wkc = ecx_receive_processdata (& self -> ecx_context , EC_TIMEOUTRET , bad_wkc_indices );
180
180
ec_state actual_state = ecx_statecheck (
181
181
& self -> ecx_context , 0 , EC_STATE_OPERATIONAL , EC_TIMEOUTSTATE );
@@ -234,8 +234,8 @@ void jsd_read(jsd_t* self, int timeout_us) {
234
234
assert (self );
235
235
236
236
// Wait for EtherCat frame to return from slaves, with logic for smart prints
237
- uint64 * bad_wkc_indices ;
238
- * bad_wkc_indices = 0 ;
237
+ uint64 bad_wkc_indices_val = 0 ;
238
+ uint64 * bad_wkc_indices = & bad_wkc_indices_val ;
239
239
self -> wkc = ecx_receive_processdata (& self -> ecx_context , timeout_us , bad_wkc_indices );
240
240
if (self -> wkc != self -> expected_wkc && self -> last_wkc != self -> wkc ) {
241
241
WARNING ("ecx_receive_processdata returning bad wkc: %d (expected: %d)" ,
@@ -250,7 +250,7 @@ void jsd_read(jsd_t* self, int timeout_us) {
250
250
for (slave_idx = 1 ; slave_idx < num_slaves ; slave_idx ++ ) {
251
251
ec_slavet * slave = & slaves [slave_idx ];
252
252
// Go through every bit and see if any device was set to 1 due to bad wkc
253
- bool bad_device_wkc = * bad_wkc_indices & (1 << slave_idx );
253
+ bool bad_device_wkc = bad_wkc_indices_val & (1 << slave_idx );
254
254
if (bad_device_wkc ) {
255
255
WARNING ("Device (%s) index caused a bad working counter: %d" , slave -> name , slave_idx );
256
256
}
0 commit comments