Skip to content

Commit

Permalink
Merge pull request #696 from bitcraze/feature_echodelay
Browse files Browse the repository at this point in the history
Add crtpsrv.echoDelay parameter
  • Loading branch information
ataffanel authored Feb 12, 2021
2 parents 85a0ebe + c16ad49 commit 6e87f6e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/modules/src/crtpservice.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "crtp.h"
#include "crtpservice.h"
#include "static_mem.h"
#include "param.h"


typedef enum {
Expand All @@ -44,6 +45,7 @@ typedef enum {


static bool isInit=false;
static uint16_t echoDelay=0;
STATIC_MEM_TASK_ALLOC_STACK_NO_DMA_CCM_SAFE(crtpSrvTask, CRTP_SRV_TASK_STACKSIZE);

static void crtpSrvTask(void*);
Expand Down Expand Up @@ -76,6 +78,9 @@ static void crtpSrvTask(void* prm)
switch (p.channel)
{
case linkEcho:
if (echoDelay > 0) {
vTaskDelay(M2T(echoDelay));
}
crtpSendPacketBlock(&p);
break;
case linkSource:
Expand All @@ -92,3 +97,7 @@ static void crtpSrvTask(void* prm)
}
}
}

PARAM_GROUP_START(crtpsrv)
PARAM_ADD(PARAM_UINT16, echoDelay, &echoDelay)
PARAM_GROUP_STOP(crtpsrv)

0 comments on commit 6e87f6e

Please sign in to comment.