softdevice: make code more flexible for other SoftDevices
This is required for adding S140 support. It relies on the following TinyGo PR: https://github.com/tinygo-org/tinygo/pull/942
This commit is contained in:
parent
00e2592aff
commit
f86fd36240
7 changed files with 21 additions and 11 deletions
10
adapter_s132.go
Normal file
10
adapter_s132.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
// +build softdevice,s132v6
|
||||
|
||||
package bluetooth
|
||||
|
||||
/*
|
||||
// Add the correct SoftDevice include path to CFLAGS, so #include will work as
|
||||
// expected.
|
||||
#cgo CFLAGS: -Is132_nrf52_6.1.1/s132_nrf52_6.1.1_API/include
|
||||
*/
|
||||
import "C"
|
|
@ -1,4 +1,4 @@
|
|||
// +build softdevice,s132v6
|
||||
// +build softdevice
|
||||
|
||||
package bluetooth
|
||||
|
||||
|
@ -7,9 +7,9 @@ package bluetooth
|
|||
// static functions).
|
||||
#define SVCALL_AS_NORMAL_FUNCTION
|
||||
|
||||
#include "s132_nrf52_6.1.1/s132_nrf52_6.1.1_API/include/nrf_sdm.h"
|
||||
#include "s132_nrf52_6.1.1/s132_nrf52_6.1.1_API/include/ble.h"
|
||||
#include "s132_nrf52_6.1.1/s132_nrf52_6.1.1_API/include/ble_gap.h"
|
||||
#include "nrf_sdm.h"
|
||||
#include "ble.h"
|
||||
#include "ble_gap.h"
|
||||
|
||||
void assertHandler(void);
|
||||
*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build softdevice,s132v6
|
||||
// +build softdevice
|
||||
|
||||
package bluetooth
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build softdevice,s132v6
|
||||
// +build softdevice
|
||||
|
||||
package bluetooth
|
||||
|
||||
|
@ -7,7 +7,7 @@ package bluetooth
|
|||
// static functions).
|
||||
#define SVCALL_AS_NORMAL_FUNCTION
|
||||
|
||||
#include "s132_nrf52_6.1.1/s132_nrf52_6.1.1_API/include/ble_gap.h"
|
||||
#include "ble_gap.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build softdevice,s132v6
|
||||
// +build softdevice
|
||||
|
||||
package bluetooth
|
||||
|
||||
|
@ -7,7 +7,7 @@ package bluetooth
|
|||
// static functions).
|
||||
#define SVCALL_AS_NORMAL_FUNCTION
|
||||
|
||||
#include "s132_nrf52_6.1.1/s132_nrf52_6.1.1_API/include/ble_gap.h"
|
||||
#include "ble_gap.h"
|
||||
*/
|
||||
import "C"
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// +build softdevice,s132v6
|
||||
// +build softdevice
|
||||
|
||||
package bluetooth
|
||||
|
||||
|
@ -7,7 +7,7 @@ package bluetooth
|
|||
// static functions).
|
||||
#define SVCALL_AS_NORMAL_FUNCTION
|
||||
|
||||
#include "s132_nrf52_6.1.1/s132_nrf52_6.1.1_API/include/ble.h"
|
||||
#include "ble.h"
|
||||
*/
|
||||
import "C"
|
||||
import "unsafe"
|
||||
|
|
Loading…
Reference in a new issue