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.
This commit is contained in:
parent
c8d7f2f904
commit
b4a6d4a073
@ -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<LL);
|
||||
|
||||
epi_restoreDynMachineConditions(dynMachCond);
|
||||
}
|
||||
|
||||
|
||||
@ -3288,19 +3273,15 @@ uint8_t hwapi::prn_getCurrentPrinterState() const
|
||||
// bit4: paper jam in cutter
|
||||
// bit6: no response bit7: serial rec. error
|
||||
// bit5: printer not ready
|
||||
|
||||
|
||||
uint8_t lastPrinterStatus;
|
||||
uint8_t buf[70], leng;
|
||||
struct T_dynamicCondition dynCond;
|
||||
memset(&dynCond, 0, sizeof(dynCond));
|
||||
|
||||
if (!epi_areDcDataValid()) // was set to 0 with print command
|
||||
return 0x40; // no response
|
||||
|
||||
// 2nd way to get dyn.conditions:
|
||||
epi_restoreDynMachineConditions(&leng, buf);
|
||||
lastPrinterStatus=buf[52];
|
||||
|
||||
return lastPrinterStatus;
|
||||
epi_restoreDynMachineConditions(&dynCond);
|
||||
return dynCond.lastPrinterStatus;
|
||||
|
||||
// oder mit:
|
||||
//struct T_dynamicCondition myDynMachCond;
|
||||
|
Loading…
Reference in New Issue
Block a user