-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGlobalInit_functions.c
85 lines (65 loc) · 1.6 KB
/
GlobalInit_functions.c
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include "nrf51.h"
#include "nrf51422_peripherals.h"
#include "nrf51_bitfields.h"
#include "stdio.h"
#include "stdlib.h"
#include "nrf_gpio.h"
#include "SEGGER_RTT.h"
#include "nrf_temp.h"
#include <stdio.h>
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "app_error.h"
#include "nrf.h"
#include "ant_interface.h"
#include "ant_parameters.h"
#include "nrf_soc.h"
#include "nrf_sdm.h"
#include "nrf_delay.h"
#include "nrf_gpio.h"
#include "boards.h"
#include "PSK.h"
#include "Universal.h"
#include "ISO7816.h"
uint8_t button_value=0;
void SetLEDS(uint8_t);
void ENC_DEC_Test(void);
void PrepareLEDS(void);
void PrepareButtons(void);
void init() {
Segger_write_string("Segger RTT Console, nrf51422 Debug.\n");
Segger_write_string("Preparing LEDS!\n");
PrepareLEDS();
Segger_write_string("Preparing Buttons!\n");
PrepareButtons();
Bootloader();
Segger_write_string("Preparing Message segmenter!\n");
init_RF_segmenter();
#ifdef COMPILE_HW
//init_ISO7816_pins();
Segger_write_string("Preparing Smart Card interface!\n");
init_Card();
Select_Applet_Wrapper();
#endif
//PrepareTemp();
// Debug strings Segger
Segger_write_string("PSK: ");
for(int i=0; i<16; i++)
Segger_write_one_hex_value(PSK[i]);
Segger_write_string("\n");
Segger_write_string("VECTOR: ");
for(int i=0; i<16; i++)
Segger_write_one_hex_value(IVECTOR[i]);
Segger_write_string("\n");
// Test Encryption/Decryption
#ifdef COMPILE_SW
ENC_DEC_Test();
ENC_DEC_Test();
#endif
Segger_write_string("\n");
}