Add collected changes from T.Sax

This commit is contained in:
2024-07-04 14:01:43 +02:00
parent ab5a343ab2
commit b0e55d8ea4
16 changed files with 2623 additions and 338 deletions

10
src/prot.cpp Normal file → Executable file
View File

@@ -97,14 +97,22 @@ void T_prot::setRecLen(uint16_t ReadCmd)
void T_prot::setUserWriteData(uint16_t WriteCmd, uint16_t WrAddr, uint8_t WrDatLen, uint8_t *data)
{
int nn;
WriteCommand=WriteCmd;
WriteAddr=WrAddr;
WrDataLength=WrDatLen;
if (WrDataLength>FRAME_DATALEN)
WrDataLength=FRAME_DATALEN;
for (int nn=0; nn<WrDataLength; nn++)
// ui8BLsendData[BL_DATA_LEN];
for (nn=0; nn<WrDataLength; nn++)
ui8OutputData[nn]=data[nn];
// clear the rest. added at 26.6.2024TS. important for printer text
for (nn=WrDataLength; nn<FRAME_DATALEN; nn++)
ui8OutputData[nn]=0;
SendDataValid=1; // always set WR first
kindOfData=0; // 0: binaries, 1:text
this->setRecLen(100); // default: short response