Skip to content

Commit

Permalink
Adjust max_size for lispUpload
Browse files Browse the repository at this point in the history
  • Loading branch information
r3n33 committed Jan 15, 2025
1 parent 4a93a66 commit 5fe294a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions codeloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,11 @@ bool CodeLoader::lispUpload(VByteArray vb)
data.append(vb);

// The ESP32 partition table has 512k space for lisp scripts. The STM32
// has one 128k flash page.
// has one 128k flash page. Subtract 6 bytes for fw size and crc.
auto fwParams = mVesc->getLastFwRxParams();
int max_size = 1024 * 500;
int max_size = 1024 * 512 - 6;
if (fwParams.hwType == HW_TYPE_VESC) {
max_size = 1024 * 120;
max_size = 1024 * 128 - 6;
}

if (data.size() > max_size) {
Expand Down

0 comments on commit 5fe294a

Please sign in to comment.