void epi_clearDynMachineConditions(void)

void gpi_storeDynMachineConditions(void const *data)
void epi_restoreDynMachineConditions(void *data)
	use T_dynamicConditions directly.
This commit is contained in:
Gerhard Hoffmann 2024-06-27 12:48:39 +02:00
parent 81cba7e615
commit dda9e4ad8f

View File

@ -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; nn<leng; nn++)
SharedMem::write()->store_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; nn<LL; nn++)
data[nn] = SharedMem::read()->store_machCond[nn];
*(struct T_dynamicCondition *)(data) = SharedMem::read()->dynMachCond;
}