mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 03:04:25 +01:00
Fixed transfers that wouldn't validate properly if size%99==0
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user