summaryrefslogtreecommitdiff
path: root/controller/fw/src/sr_global.h
blob: 97db4e4240ae9c1cd82564ca50f34d90f2d6073f (plain)
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
#ifndef __SR_GLOBAL_H__
#define __SR_GLOBAL_H__

#include <stdint.h>
#include <sys/types.h>

#ifndef SIMULATION
#include <stm32f407xx.h>
#include <stm32f4_isr.h>
#endif

#define UNUSED(x) ((void) x)
#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))

#define unused_a __attribute__((unused))

extern unsigned int sysclk_speed;
extern unsigned int apb1_speed;
extern unsigned int apb2_speed;
extern unsigned int auxclk_speed;
extern unsigned int apb1_timer_speed;
extern unsigned int apb2_timer_speed;

extern struct leds {
    unsigned int comm_tx;
} leds;
static inline uint16_t htole(uint16_t val) { return val; }

void __libc_init_array(void);

static inline void panic(void) {
    asm volatile ("bkpt");
}

#endif /* __SR_GLOBAL_H__ */