diff --git a/src/storeINdata.cpp b/src/storeINdata.cpp index 65e1ec9..daff689 100644 --- a/src/storeINdata.cpp +++ b/src/storeINdata.cpp @@ -6,6 +6,8 @@ #include "shared_mem_buffer.h" #include "datei.h" +#include "interfaces.h" // #include "dynamic-machine-conditions.h" + // gpi: grafical access to PI: access from external devices over device controller FOR GUI // epi: external access from GUI to PI: FOR external devices (DC) @@ -1932,32 +1934,17 @@ void epi_restoreDeviceConditions(uint8_t *leng, uint8_t *data) void epi_clearDynMachineConditions(void) { - uint8_t nn; - SharedMem::write()->store_machCondLen=0; - for (nn=0; nn<64; nn++) - SharedMem::write()->store_machCond[nn] = 0; + memset(&SharedMem::write()->dynMachCond, 0, sizeof(struct T_dynamicCondition)); } - -void gpi_storeDynMachineConditions(uint8_t leng, uint8_t *data) +void gpi_storeDynMachineConditions(void const *data) { - uint8_t nn; - if (leng>64) leng=64; - SharedMem::write()->store_machCondLen=leng; -// tslib_strcpy(data, SharedMem::write()->store_machCond, leng); - for (nn=0; nnstore_machCond[nn] = data[nn]; + SharedMem::write()->dynMachCond = *(struct T_dynamicCondition const *)(data); +} - } - -void epi_restoreDynMachineConditions(uint8_t *leng, uint8_t *data) +void epi_restoreDynMachineConditions(void *data) { - uint8_t nn, LL; - LL=SharedMem::read()->store_machCondLen; - *leng=LL; - //tslib_strcpy(SharedMem::read()->store_machCond, data, SharedMem::read()->store_machCondLen); - for (nn=0; nnstore_machCond[nn]; + *(struct T_dynamicCondition *)(data) = SharedMem::read()->dynMachCond; }