porting/nuttx/example: perform initialization if not done by NSH

For example, when Nimble NuttX example is the entry point for users applications.
This commit is contained in:
raiden00pl
2023-03-14 01:17:11 +01:00
committed by Andrzej Kaczmarek
parent 1a5d0bf1c3
commit 88758a8107
+15
View File
@@ -24,6 +24,9 @@
#include <stdio.h>
#include <pthread.h>
#include <unistd.h>
#include <sys/boardctl.h>
#include "netutils/netinit.h"
#include "nimble/nimble_npl.h"
#include "nimble/nimble_port.h"
@@ -71,6 +74,18 @@ int main(int argc, char *argv[])
ble_hci_sock_set_device(atoi(argv[1]));
}
#ifndef CONFIG_NSH_ARCHINIT
/* Perform architecture-specific initialization */
boardctl(BOARDIOC_INIT, 0);
#endif
#ifndef CONFIG_NSH_NETINIT
/* Bring up the network */
netinit_bringup();
#endif
printf("port init\n");
nimble_port_init();