aboutsummaryrefslogtreecommitdiffstats
path: root/usr/ble_tst/src/experimental.c
blob: fdc2581c3bc6726fe1a0e780e0c826b598b3648d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#include "rwip_config.h"
#include "rwip.h"
#include "ble_reg_access.h"
#include "reg_blecore.h"
#include "em_map_ble.h"
#include "reg_ble_em_cs.h"
#include "reg_ble_em_rx_buffer.h"
#include "reg_ble_em_rx_desc.h"
#include "reg_ble_em_tx_buffer_cntl.h"
#include "reg_ble_em_tx_desc.h"
#include "reg_ble_em_tx_buffer_data.h"
#include "ecc_p256.h"
#include "llm.h"
#include "llm_util.h"
#include "lld.h"
#include "lld_evt.h"
#include "lld_pdu.h"
#include "lld_util.h"
#include "RomCallFlash.h"
#include "em_buf.h"
#include "ea.h"
#include "common_utils.h"
#include "common_hci.h"
#include "common_llcp.h"

int func1 (int);
int func2 (int);

static int (*(farray[2])) (int) = { func1, func2 };

struct st
{
  void *str;
  uint32_t a;
};

struct st arr[2] = { {"A1", 0}, {"A2", 0} };

int
func1 (int inp)
{
  return inp * inp;
}

int
func2 (int inp)
{
  uint32_t clk2, clk1;

  clk1 = 2 * inp;
  clk2 = inp + 1;

  clk1 = CLK_ADD_3 (clk1, 3, clk2) & SYNC_TRAIN_TO_MAX;
  return clk1 + arr[inp].a;
}

int
func3 (int i)
{
  return farray[i] (11);
}