| 42 | } |
| 43 | |
| 44 | uint8_t* getDataForFile(fs::File& file) { |
| 45 | const size_t fileSize = file.size(); |
| 46 | uint8_t* ret = (uint8_t*)malloc(fileSize); |
| 47 | if (ret) { |
| 48 | file.seek(0); |
| 49 | file.readBytes((char*)ret, fileSize); |
| 50 | } else { |
| 51 | Serial.printf("malloc failed for file with size %d\r\n", fileSize); |
| 52 | wsErr("malloc failed while reading file"); |
| 53 | util::printHeap(); |
| 54 | } |
| 55 | return ret; |
| 56 | } |
| 57 | |
| 58 | void prepareCancelPending(const uint8_t dst[8]) { |
| 59 | struct pendingData pending = {0}; |
no test coverage detected