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