diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1b40eca..bb18cc2 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,12 +10,16 @@ is a safeguard to prevent miscommunication. Version 1.2.2 (upcoming) ======================== +Bugfix version for ``stepgen`` module, which was affected by an error in the ``encoder`` module. + * ``driver``: * ``encoder``: counts and position of encoder can be reset (#74) + * ``encoder``: incorrect required read buffer reported has been corrected. This affected the module ``stepgen`` (#79) * ``watchdog``: the watchdog is reset when the card is reset. Prevents the ``has_bitten`` message when LinuxCNC is restarted without power-cycling the card. (#80) + Version 1.2.1 ============= diff --git a/src/litexcnc/driver/modules/litexcnc_encoder.c b/src/litexcnc/driver/modules/litexcnc_encoder.c index d092904..7de4c50 100644 --- a/src/litexcnc/driver/modules/litexcnc_encoder.c +++ b/src/litexcnc/driver/modules/litexcnc_encoder.c @@ -119,7 +119,7 @@ size_t required_read_buffer(void *instance) { // (32 bits). When there are more then 32 encoders, another DWORD is added to the // registers. For each encoder there is also a struct with the number of counts // retrieved. - return single_dword_buffer(encoder) + num_instances * sizeof(litexcnc_encoder_instance_read_data_t); + return single_dword_buffer(encoder) + encoder->num_instances * sizeof(litexcnc_encoder_instance_read_data_t); }