diff --git a/src/jsd_el1008.c b/src/jsd_el1008.c index a75cf79..8703260 100644 --- a/src/jsd_el1008.c +++ b/src/jsd_el1008.c @@ -29,7 +29,7 @@ void jsd_el1008_read(jsd_t* self, uint16_t slave_id) { (jsd_el1008_txpdo_t*)self->ecx_context.slavelist[slave_id].inputs; for (int ch = 0; ch < JSD_EL1008_NUM_CHANNELS; ++ch) { - state->values[ch] = (1 << ch) & txpdo->channels; // Bit shift the channel to get value + state->values[ch] = (bool)((1 << ch) & txpdo->channels); // Bit shift the channel to get value } } @@ -74,4 +74,4 @@ int jsd_el1008_PO2SO_config(ecx_contextt* ecx_context, uint16_t slave_id) { bool jsd_el1008_product_code_is_compatible(uint32_t product_code) { return product_code == JSD_EL1008_PRODUCT_CODE; -} \ No newline at end of file +}