Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
8f2a825b
You need to sign in or sign up before continuing.
Commit
8f2a825b
authored
6 years ago
by
Hauke Petersen
Browse files
Options
Downloads
Patches
Plain Diff
pkg/nimble: ipmrove host initialization
parent
fa520a09
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/nimble/contrib/include/nimble_riot.h
+24
-3
24 additions, 3 deletions
pkg/nimble/contrib/include/nimble_riot.h
pkg/nimble/contrib/nimble_riot.c
+71
-0
71 additions, 0 deletions
pkg/nimble/contrib/nimble_riot.c
with
95 additions
and
3 deletions
pkg/nimble/contrib/include/nimble_riot.h
+
24
−
3
View file @
8f2a825b
...
...
@@ -24,7 +24,7 @@ extern "C" {
#endif
/**
* @brief
Define the p
riority used for NimBLE's controller thread
* @brief
P
riority used for NimBLE's controller thread
*
* This should be as high as possible.
*/
...
...
@@ -33,9 +33,30 @@ extern "C" {
#endif
/**
* @brief Sta
rts a thread running
NimBLE's controller
* @brief Sta
cksize used for
NimBLE's controller
thread
*/
void
nimble_riot_controller_init
(
void
);
#ifndef NIMBLE_CONTROLLER_STACKSIZE
#define NIMBLE_CONTROLLER_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#endif
/**
* @brief Priority used for NimBLE's host thread
*/
#ifndef NIMBLE_HOST_PRIO
#define NIMBLE_HOST_PRIO (THREAD_PRIORITY_MAIN - 2)
#endif
/**
* @brief Stacksize used for NimBLE's host thread
*/
#ifndef NIMBLE_HOST_STACKSIZE
#define NIMBLE_HOST_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#endif
/**
* @brief Setup and run NimBLE's controller and host threads
*/
void
nimble_riot_init
(
void
);
#ifdef __cplusplus
}
...
...
This diff is collapsed.
Click to expand it.
pkg/nimble/contrib/
controller_ini
t.c
→
pkg/nimble/contrib/
nimble_rio
t.c
+
71
−
0
View file @
8f2a825b
...
...
@@ -11,7 +11,7 @@
* @{
*
* @file
* @brief
Initialization of the nimble controller
* @brief
Glue code for running NimBLE for RIOT
*
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*
...
...
@@ -23,24 +23,49 @@
#include
"nimble/nimble_port.h"
#include
"services/gap/ble_svc_gap.h"
#include
"services/gatt/ble_svc_gatt.h"
#ifdef CPU_FAM_NRF52
#include
"nrf_clock.h"
#endif
static
char
stack
[
THREAD_STACKSIZE_DEFAULT
];
static
char
_stack_controller
[
NIMBLE_CONTROLLER_STACKSIZE
];
static
char
_stack_host
[
NIMBLE_HOST_STACKSIZE
];
static
void
*
_host_thread
(
void
*
arg
)
{
(
void
)
arg
;
nimble_port_init
();
nimble_port_run
();
void
nimble_riot_controller_init
(
void
)
/* never reached */
return
NULL
;
}
void
nimble_riot_init
(
void
)
{
/* XXX: NimBLE needs the nRF5x's LF clock to run */
#ifdef CPU_FAM_NRF52
clock_start_lf
();
#endif
/*
/* Run the controller
*
* Create task where NimBLE LL will run. This one is required as LL has its
* own event queue and should have highest priority.
*/
thread_create
(
stack
,
sizeof
(
stack
),
NIMBLE_CONTROLLER_PRIO
,
thread_create
(
_stack_controller
,
sizeof
(
_stack_controller
),
NIMBLE_CONTROLLER_PRIO
,
THREAD_CREATE_STACKTEST
,
(
thread_task_func_t
)
nimble_port_ll_task_func
,
NULL
,
"nimble_ctrl"
);
/* and finally initialize and run the host */
thread_create
(
_stack_host
,
sizeof
(
_stack_host
),
NIMBLE_HOST_PRIO
,
THREAD_CREATE_STACKTEST
,
_host_thread
,
NULL
,
"nimble_host"
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment