From b4a6d4a073e9c7a38ed9de0e9a92e743543fb0b0 Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 27 Jun 2024 12:42:35 +0200 Subject: [PATCH] void hwapi::sys_getDynMachineConditions(): no length info anymore. void hwapi::sys_getDynMachineConditions(struct T_dynamicCondition *dynMachCond) const: no loop, just write to shared mem using struct T_dynamicCondition. uint8_t hwapi::prn_getCurrentPrinterState() const: use struct T_dynamicCondition.lastPrinterStatus. --- src/hwapi.cpp | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/src/hwapi.cpp b/src/hwapi.cpp index ba0208b..4a3e6c3 100644 --- a/src/hwapi.cpp +++ b/src/hwapi.cpp @@ -3229,29 +3229,14 @@ void hwapi::sys_getDeviceConditions(struct T_moduleCondition *devCond) const -void hwapi::sys_getDynMachineConditions(uint8_t *leng, uint8_t *data) const +void hwapi::sys_getDynMachineConditions(void *data) const { - epi_restoreDynMachineConditions(leng, data); + epi_restoreDynMachineConditions(data); } void hwapi::sys_getDynMachineConditions(struct T_dynamicCondition *dynMachCond) const { - - uint16_t LL, nn; - char *start; - uint8_t buf[70], leng; - - epi_restoreDynMachineConditions(&leng, buf); - // Puffer in struct eintragen: - LL=sizeof(struct T_dynamicCondition); - start = &dynMachCond->allDoorsDebounced; - nn=0; - do - { - *start = buf[nn]; - start++; - } while(++nn