bugfix: banknotes have been summed with the coins. Now they are handled separately.

This commit is contained in:
Thomas Sax 2024-03-21 15:54:58 +01:00
parent 3486c4ccaf
commit c59de6cad8

View File

@ -1773,15 +1773,25 @@ void epi_clearCurrentPayment(void)
void gpi_storeCurrentPayment(uint32_t insertedAmount, uint16_t lastCoinType, uint16_t lastCoinValue)
{
uint8_t pLC=SharedMem::read()->p_lastCoin;
SharedMem::write()->store_insertedAmount=insertedAmount;
SharedMem::write()->store_lastCoinType[pLC]=lastCoinType;
SharedMem::write()->store_lastCoinValue[pLC]=lastCoinValue;
pLC++;
SharedMem::write()->p_lastCoin=pLC;
SharedMem::write()->store_curPayNewCoin++;
uint8_t pLC;
// 21.3.24 attention: if bit 15 in lastCoinType is set then we got a bill not a coin
SharedMem::write()->store_insertedAmount=insertedAmount;
if (lastCoinType & 0x8000)
{
// then it's a banknote
//qCritical()<<"gpi_storeCurrentPayment got banknote, total: "<<insertedAmount;
} else
{
//qCritical()<<"gpi_storeCurrentPayment "<<insertedAmount<<" " << lastCoinType<<" " << lastCoinValue;
pLC=SharedMem::read()->p_lastCoin;
SharedMem::write()->store_lastCoinType[pLC]=lastCoinType;
SharedMem::write()->store_lastCoinValue[pLC]=lastCoinValue;
pLC++;
SharedMem::write()->p_lastCoin=pLC;
SharedMem::write()->store_curPayNewCoin++;
}
//qDebug()<<"gpi_storeCurrentPayment "<<insertedAmount<<" " << lastCoinType<<" " << lastCoinValue;
}
uint32_t epi_CurrentPaymentGetAmount(void)
@ -1819,6 +1829,13 @@ bool epi_CurrentPaymentGetAllCoins(uint16_t *types, uint16_t *values)
return true;
}
/*
int nn;
for (nn=0; nn<8; nn++)
{
data[nn]=SharedMem::read()->store_bnaCollect[nn];
}
*/
//uint64_t stor_wakSrc;
//uint8_t stor_reason;