mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 11:06:49 +01:00
fixed block transfer for OTA LUT and NFC
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1
zbs243_Tag_FW/i2cdevices.h
Normal file → Executable file
1
zbs243_Tag_FW/i2cdevices.h
Normal file → Executable file
@@ -6,5 +6,6 @@ bool supportsNFCWake();
|
||||
void loadURLtoNTag();
|
||||
void loadRawNTag(uint16_t blocksize);
|
||||
bool i2cCheckDevice(uint8_t address);
|
||||
void i2cBusScan();
|
||||
|
||||
#endif
|
||||
@@ -180,6 +180,9 @@ void main() {
|
||||
pr("BOOTED> %d.%d.%d%s\n", fwVersion / 100, (fwVersion % 100) / 10, (fwVersion % 10), fwVersionSuffix);
|
||||
|
||||
powerUp(INIT_I2C);
|
||||
|
||||
//i2cBusScan();
|
||||
|
||||
if (i2cCheckDevice(0x55)) {
|
||||
powerDown(INIT_I2C);
|
||||
capabilities |= CAPABILITY_HAS_NFC;
|
||||
|
||||
@@ -822,15 +822,14 @@ bool processAvailDataInfo(struct AvailDataInfo *__xdata avail) {
|
||||
powerDown(INIT_RADIO);
|
||||
return true;
|
||||
}
|
||||
curBlock.blockId = 0;
|
||||
xMemCopy8(&(curBlock.ver), &(avail->dataVer));
|
||||
curBlock.type = avail->dataType;
|
||||
xMemCopyShort(&curDataInfo, (void *)avail, sizeof(struct AvailDataInfo));
|
||||
uint16_t __xdata nfcsize = avail->dataSize;
|
||||
wdt10s();
|
||||
if (getDataBlock(avail->dataSize)) {
|
||||
powerUp(INIT_RADIO);
|
||||
sendXferComplete();
|
||||
powerDown(INIT_RADIO);
|
||||
|
||||
curDataInfo.dataSize = 0; // mark as transfer not pending
|
||||
|
||||
powerUp(INIT_I2C);
|
||||
if (avail->dataType == DATATYPE_NFC_URL_DIRECT) {
|
||||
// only one URL (handle NDEF records on the tag)
|
||||
@@ -839,7 +838,11 @@ bool processAvailDataInfo(struct AvailDataInfo *__xdata avail) {
|
||||
// raw NFC data upload to the NFC IC
|
||||
loadRawNTag(nfcsize);
|
||||
}
|
||||
timerDelay(13330);
|
||||
powerDown(INIT_I2C);
|
||||
powerUp(INIT_RADIO);
|
||||
sendXferComplete();
|
||||
powerDown(INIT_RADIO);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -864,14 +867,17 @@ bool processAvailDataInfo(struct AvailDataInfo *__xdata avail) {
|
||||
powerDown(INIT_RADIO);
|
||||
return true;
|
||||
}
|
||||
curBlock.blockId = 0;
|
||||
xMemCopy8(&(curBlock.ver), &(avail->dataVer));
|
||||
curBlock.type = avail->dataType;
|
||||
xMemCopyShort(&curDataInfo, (void *)avail, sizeof(struct AvailDataInfo));
|
||||
|
||||
wdt10s();
|
||||
if (getDataBlock(avail->dataSize)) {
|
||||
curDataInfo.dataSize = 0; // mark as transfer not pending
|
||||
memcpy(customLUT, sizeof(struct blockData) + blockXferBuffer, dispLutSize * 10);
|
||||
powerUp(INIT_RADIO);
|
||||
sendXferComplete();
|
||||
powerDown(INIT_RADIO);
|
||||
curDataInfo.dataSize = 0; // mark as transfer not pending
|
||||
memcpy(customLUT, sizeof(struct blockData) + blockXferBuffer, dispLutSize * 10);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user