-
Notifications
You must be signed in to change notification settings - Fork 94
/
conf_general.h
95 lines (72 loc) · 2.43 KB
/
conf_general.h
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
86
87
88
89
90
91
92
93
94
95
/*
Copyright 2019 - 2022 Benjamin Vedder [email protected]
This file is part of the VESC BMS firmware.
The VESC BMS firmware is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
The VESC BMS firmware is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "ch.h"
#include "hal.h"
#include "datatypes.h"
#include <stdint.h>
#include <stdbool.h>
#ifndef CONF_GENERAL_H_
#define CONF_GENERAL_H_
// Firmware version
#define FW_VERSION_MAJOR 6
#define FW_VERSION_MINOR 00
// Set to 0 for building a release and iterate during beta test builds
#define FW_TEST_VERSION_NUMBER 0
// Init codes for the persistent storage. Change the config code when updating the config struct
// in a way that is not backwards compatible.
#define VAR_INIT_CODE 59763258
#define HW_NAME_MAX_CHARS 16
#if !defined(HW_SOURCE) && !defined(HW_HEADER)
//#define HW_HEADER "hw_12s7p_v1.h"
//#define HW_SOURCE "hw_12s7p_v1.c"
//#define HW_HEADER "hw_18s_light.h"
//#define HW_SOURCE "hw_18s_light.c"
//#define HW_18S_LIGHT_MK2
#define HW_18S_LIGHT_LMP
//#define HW_HEADER "hw_stormcore_bms.h"
//#define HW_SOURCE "hw_stormcore_bms.c"
//#define HW_HEADER "hw_rbat.h"
//#define HW_SOURCE "hw_rbat.c"
#define HW_HEADER "hw_lb.h"
#define HW_SOURCE "hw_lb.c"
#endif
/*
* Enable blackmagic probe
*/
#ifndef HAS_BLACKMAGIC
#define HAS_BLACKMAGIC 1
#endif
/*
* MCU
*/
#define SYSTEM_CORE_CLOCK 168000000
#define STM32_UUID ((uint32_t*)0x1FFF7590)
#define STM32_UUID_8 ((uint8_t*)0x1FFF7590)
#define STM32_FLASH_SIZE ((uint16_t*)0x1FFF75E0)
#ifndef HW_SOURCE
#error "No hardware source file set"
#endif
#ifndef HW_HEADER
#error "No hardware header file set"
#endif
#include "hw.h"
// Application-specific battery type.
#ifndef CONF_BATTERY_TYPE
#define CONF_BATTERY_TYPE 0xAA
#endif
#include "conf_default.h"
// Functions
void conf_general_apply_hw_limits(main_config_t *config);
#endif /* CONF_GENERAL_H_ */