Skip to content

Commit 261e1ba

Browse files
committed
nrf: clean up code after CGo improvements
Make use of a few new features in TinyGo: * Functions and globals in header files are supported. * Static functions are supported. This allows us to remove workarounds specifically used for the lack of support for static functions.
1 parent e758117 commit 261e1ba

19 files changed

+12
-139
lines changed

adapter_nrf51.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
package bluetooth
44

55
/*
6-
// Define SoftDevice functions as regular function declarations (not inline
7-
// static functions).
8-
#define SVCALL_AS_NORMAL_FUNCTION
9-
106
#include "nrf_sdm.h"
117
#include "ble.h"
128
#include "ble_gap.h"

adapter_nrf528xx-full.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ package bluetooth
66
// both central and peripheral mode. This includes S132 and S140.
77

88
/*
9-
// Define SoftDevice functions as regular function declarations (not inline
10-
// static functions).
11-
#define SVCALL_AS_NORMAL_FUNCTION
12-
139
#include "nrf_sdm.h"
1410
#include "nrf_nvic.h"
1511
#include "ble.h"

adapter_nrf528xx-peripheral.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ package bluetooth
66
// mode support. This includes the S113.
77

88
/*
9-
// Define SoftDevice functions as regular function declarations (not inline
10-
// static functions).
11-
#define SVCALL_AS_NORMAL_FUNCTION
12-
139
#include "nrf_sdm.h"
1410
#include "nrf_nvic.h"
1511
#include "ble.h"

adapter_nrf528xx.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ package bluetooth
55
// This file defines the SoftDevice adapter for all nrf52-series chips.
66

77
/*
8-
// Define SoftDevice functions as regular function declarations (not inline
9-
// static functions).
10-
#define SVCALL_AS_NORMAL_FUNCTION
11-
128
#include "nrf_sdm.h"
139
#include "nrf_nvic.h"
1410
#include "ble.h"

adapter_s110.c

Lines changed: 0 additions & 11 deletions
This file was deleted.

adapter_s113v7.c

Lines changed: 0 additions & 22 deletions
This file was deleted.

adapter_s113v7.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ package bluetooth
66
// Add the correct SoftDevice include path to CFLAGS, so #include will work as
77
// expected.
88
#cgo CFLAGS: -Is113_nrf52_7.0.1/s113_nrf52_7.0.1_API/include
9+
10+
#include "nrf_nvic.h"
11+
nrf_nvic_state_t nrf_nvic_state = {0};
912
*/
1013
import "C"

adapter_s132.c

Lines changed: 0 additions & 22 deletions
This file was deleted.

adapter_s132.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ package bluetooth
66
// Add the correct SoftDevice include path to CFLAGS, so #include will work as
77
// expected.
88
#cgo CFLAGS: -Is132_nrf52_6.1.1/s132_nrf52_6.1.1_API/include
9+
10+
#include "nrf_nvic.h"
11+
nrf_nvic_state_t nrf_nvic_state = {0};
912
*/
1013
import "C"

adapter_s140v6.c

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)