Skip to content

Commit

Permalink
Fix problem with BBB strings missing last channel of data if total da…
Browse files Browse the repository at this point in the history
…ta len is between 13K and 25

K
  • Loading branch information
dkulp committed Oct 30, 2019
1 parent 567a490 commit c8133cf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/channeloutput/BBB48String.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ int BBB48StringOutput::SendData(unsigned char *channelData)
}
// second 7.5K to other PRU ram
memcpy(m_pru->other_data_ram + 512, m_curData + 7628, outsize);
fullsize -= outsize;
fullsize -= 7628;
}
if (fullsize > 0) {
int outsize = fullsize;
Expand All @@ -609,11 +609,10 @@ int BBB48StringOutput::SendData(unsigned char *channelData)
}
memcpy(m_pru->shared_ram, m_curData + 7628 + 7628, outsize);
}
int off = 7628 * 2 + 12188;
int off = 7628 * 2 + 12188 - 100;
if (off < m_frameSize) {
// more than what fits in the SRAMs
//don't need to copy the first part as that's in sram, just copy the last parts
off -= 100;
uint8_t * const realout = (uint8_t *)m_pru->ddr + m_frameSize * frame + off;
memcpy(realout, m_curData + off, m_frameSize - off);
}
Expand Down

0 comments on commit c8133cf

Please sign in to comment.