Skip to content

Commit 2254f32

Browse files
committed
Use SpiDrv::available() to speed up ServerDrv::getDataBuf(...) in no socket data scenario
1 parent 227b2c8 commit 2254f32

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utility/server_drv.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@ bool ServerDrv::getData(uint8_t sock, uint8_t *data, uint8_t peek)
323323

324324
bool ServerDrv::getDataBuf(uint8_t sock, uint8_t *_data, uint16_t *_dataLen)
325325
{
326+
if (!SpiDrv::available())
327+
{
328+
*_dataLen = 0;
329+
return false;
330+
}
331+
326332
WAIT_FOR_SLAVE_SELECT();
327333
// Send Command
328334
SpiDrv::sendCmd(GET_DATABUF_TCP_CMD, PARAM_NUMS_2);

0 commit comments

Comments
 (0)