Skip to content

Commit

Permalink
Add SYSLINK_SYS_NRF_VERSION message
Browse files Browse the repository at this point in the history
Will reply with the version of the NRF51 firmware.

Example:

  2021.06 +1*

Will mean 1 commit from the 2021.06 tag and the * marks it as
"locally modified".
  • Loading branch information
jonasdn committed Sep 1, 2021
1 parent 81372b6 commit f4d0058
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions interface/syslink.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,6 @@ void syslinkReset();
#define SYSLINK_OW_READ 0x22
#define SYSLINK_OW_WRITE 0x23

#define SYSLINK_SYS_NRF_VERSION 0x30

#endif
15 changes: 15 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "systick.h"
#include "nrf_sdm.h"
#include "nrf_soc.h"
#include "version.h"

#include "memory.h"
#include "ownet.h"
Expand Down Expand Up @@ -338,7 +339,21 @@ void mainloop()
// Send the P2P packet immediately without buffer
esbSendP2PPacket(slRxPacket.data[0],&slRxPacket.data[1],slRxPacket.length-1);
break;
case SYSLINK_SYS_NRF_VERSION:{
size_t len = strlen(V_STAG);
slTxPacket.type = SYSLINK_SYS_NRF_VERSION;

memcpy(&slTxPacket.data[0], V_STAG, len);

if (V_MODIFIED) {
slTxPacket.data[len] = '*';
len += 1;
}

slTxPacket.data[len] = '\0';
slTxPacket.length = len + 1;
syslinkSend(&slTxPacket);
} break;
}
}

Expand Down

0 comments on commit f4d0058

Please sign in to comment.