prototooth/adapter_s113v7.c
Ayke van Laethem bb8767730c nrf: add support for S113 SoftDevice
This SoftDevice is used by default on the BBC micro:bit v2 so it's a
good idea to add support here.

Unfortunately this SoftDevice does not support scanning and connecting
to other devices. This means that I unfortunately had to duplicate the
event handler. I managed to refactor most other code to avoid
duplicating much more. (This is when macros would have been useful in
Go...)
2021-04-15 15:37:36 +02:00

23 lines
810 B
C

// +build softdevice,s113v7
// This file is necessary to define SVCall wrappers, because TinyGo does not yet
// support static functions in the preamble.
// Discard all 'static' attributes to define functions normally.
#define static
// Get rid of all __STATIC_INLINE symbols.
// This is a bit less straightforward: we first need to include the header that
// defines it, and then redefine it.
#include "nrf.h"
#undef __STATIC_INLINE
#define __STATIC_INLINE
#include "s113_nrf52_7.0.1/s113_nrf52_7.0.1_API/include/nrf_sdm.h"
#include "s113_nrf52_7.0.1/s113_nrf52_7.0.1_API/include/nrf_nvic.h"
#include "s113_nrf52_7.0.1/s113_nrf52_7.0.1_API/include/ble.h"
// Define nrf_nvic_state, which is used by sd_nvic_critical_region_enter and
// sd_nvic_critical_region_exit.
nrf_nvic_state_t nrf_nvic_state = {0};