Fixed transfers that wouldn't validate properly if size%99==0

This commit is contained in:
jjwbruijn
2024-04-10 21:23:03 +02:00
parent e92824335c
commit 5f77358bd0
2 changed files with 10 additions and 1 deletions

View File

@@ -224,6 +224,9 @@ void drawImageAtAddressWrap(uint32_t addr, uint8_t lut) {
#endif
switch (eih.dataType) {
case DATATYPE_IMG_RAW_1BPP: {
#ifdef DEBUG_DRAWING
printf("DRAW: 1BPP\n");
#endif
drawItem *di = new drawItem;
// di->setRotation(ro);
di->xpos = 0;
@@ -241,6 +244,9 @@ void drawImageAtAddressWrap(uint32_t addr, uint8_t lut) {
di->addToList();
} break;
case DATATYPE_IMG_RAW_2BPP: {
#ifdef DEBUG_DRAWING
printf("DRAW: 2BPP\n");
#endif
drawItem *di = new drawItem;
// di->setRotation(ro);
di->xpos = 0;

View File

@@ -552,7 +552,7 @@ static uint8_t *getDataBlock(const uint16_t blockSize) {
memset(curBlock.requestedParts, 0xFF, BLOCK_REQ_PARTS_BYTES);
} else {
partsThisBlock = (sizeof(struct blockData) + blockSize) / BLOCK_PART_DATA_SIZE;
if (blockSize % BLOCK_PART_DATA_SIZE)
if ((sizeof(struct blockData) + blockSize) % BLOCK_PART_DATA_SIZE)
partsThisBlock++;
memset(curBlock.requestedParts, 0x00, BLOCK_REQ_PARTS_BYTES);
for (uint8_t c = 0; c < partsThisBlock; c++) {
@@ -952,6 +952,9 @@ bool processImageDataAvail(struct AvailDataInfo *avail) {
}
bool processAvailDataInfo(struct AvailDataInfo *avail) {
#ifdef DEBUG_PROTO
printf("PROTO: New dataAvail with type 0x%02X\n", avail->dataType);
#endif
switch (avail->dataType) {
case DATATYPE_IMG_RAW_1BPP:
case DATATYPE_IMG_RAW_2BPP: