mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-16 15:07:53 +00:00
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:
committed by
Andrzej Kaczmarek
parent
1a5d0bf1c3
commit
88758a8107
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user