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:
Ayke van Laethem 2020-03-06 12:49:05 +01:00
parent 00e2592aff
commit f86fd36240
No known key found for this signature in database
GPG key ID: E97FF5335DFDFDED
7 changed files with 21 additions and 11 deletions

10
adapter_s132.go Normal file
View 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"

View file

@ -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);
*/

View file

@ -1,4 +1,4 @@
// +build softdevice,s132v6
// +build softdevice
package bluetooth

View file

@ -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"

View file

@ -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"

View file

@ -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"