Skip to content

Commit 330d2c4

Browse files
authored
Fix compiling on Linux (#46)
1 parent ab28a03 commit 330d2c4

11 files changed

+19
-23
lines changed

Src/FOC.c

-3
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@ char PI_flag=0;
3939

4040
//const q31_t _T = 2048;
4141

42-
TIM_HandleTypeDef htim1;
43-
44-
4542
void FOC_calculation(int16_t int16_i_as, int16_t int16_i_bs, q31_t q31_teta, int16_t int16_i_q_target, MotorState_t* MS_FOC);
4643
void svpwm(q31_t q31_u_alpha, q31_t q31_u_beta);
4744

Src/display_No_2.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2828

2929

3030

31-
UART_HandleTypeDef huart1;
31+
extern UART_HandleTypeDef huart1;
3232
#if (DISPLAY_TYPE == DISPLAY_TYPE_NO2)
3333

3434
void No2_Service(No2_t* No2_ctx);
3535
int calculate_checksum(unsigned char* frame_buf, uint8_t length);
3636

37-
uint8_t lowByte(uint16_t word);
38-
uint8_t highByte(uint16_t word);
37+
static uint8_t lowByte(uint16_t word);
38+
static uint8_t highByte(uint16_t word);
3939

4040
uint8_t pas_tolerance = 0;
4141
uint8_t wheel_magnets = 1;

Src/display_bafang.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3535
#define RXSTATE_INFOMESSAGE 4 //info code received, waiting for info message
3636
#define RXSTATE_DONE 5 //command received
3737

38-
UART_HandleTypeDef huart1;
38+
extern UART_HandleTypeDef huart1;
3939

4040
// Local function prototypes
4141
//static void BAFANG_Service(BAFANG_t* BF_ctx, uint8_t rx);

Src/display_ebics.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#include "print.h"
1111
#include "config.h"
1212

13-
UART_HandleTypeDef huart1;
14-
uint8_t ui8_rx_buffer[12];
15-
uint8_t ui8_tx_buffer[12];
13+
extern UART_HandleTypeDef huart1;
14+
static uint8_t ui8_rx_buffer[12];
15+
static uint8_t ui8_tx_buffer[12];
1616

1717

1818
void ebics_init()

Src/display_kingmeter.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
3434
#define RXSTATE_MSGBODY 2
3535
#define RXSTATE_DONE 3
3636
uint8_t FirstRunFlag = 0;
37-
UART_HandleTypeDef huart1;
38-
UART_HandleTypeDef huart3;
37+
extern UART_HandleTypeDef huart1;
3938

4039

4140
#if (DISPLAY_TYPE == DISPLAY_TYPE_KINGMETER_618U)
@@ -126,8 +125,8 @@ static void KM_618U_Service(KINGMETER_t* KM_ctx);
126125
static void KM_901U_Service(KINGMETER_t* KM_ctx);
127126
#endif
128127

129-
uint8_t lowByte(uint16_t word);
130-
uint8_t highByte(uint16_t word);
128+
static uint8_t lowByte(uint16_t word);
129+
static uint8_t highByte(uint16_t word);
131130

132131
uint8_t pas_tolerance = 0;
133132
uint8_t wheel_magnets = 1;

Src/display_kunteng.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
#include "stm32f1xx_hal.h"
1111
#include "eeprom.h"
1212

13-
uint8_t ui8_tx_buffer[12];
13+
static uint8_t ui8_tx_buffer[12];
1414
uint8_t ui8_j;
1515
uint8_t ui8_crc;
1616
uint8_t ui8_last_XOR;
1717
uint16_t ui16_wheel_period_ms =4500;
1818
uint32_t ui32_battery_volts= 36;
1919
uint8_t ui8_battery_soc = 12;
2020
uint8_t ui16_error;
21-
uint8_t ui8_rx_buffer[13];
21+
static uint8_t ui8_rx_buffer[13];
2222
uint8_t ui8_rx_initial_buffer[13];
2323
uint8_t ui8_rx_buffer_counter = 0;
2424
uint8_t ui8_byte_received;
@@ -30,7 +30,7 @@ uint8_t ui8_gear_ratio = GEAR_RATIO;
3030

3131
volatile struc_lcd_configuration_variables lcd_configuration_variables;
3232

33-
UART_HandleTypeDef huart1;
33+
extern UART_HandleTypeDef huart1;
3434
void check_recent(void);
3535

3636
void kunteng_init()

build/.keep

Whitespace-only changes.

make/objects.list

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
"Src/stm32f1xx_hal_msp.o"
2626
"Src/stm32f1xx_it.o"
2727
"Src/system_stm32f1xx.o"
28-
"startup/startup_stm32f103x6.o"
28+
"Startup/startup_stm32f103x6.o"

make/subdir_drivers.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ C_DEPS += \
5757
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.d \
5858
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.d
5959

60-
INC_PATH = ../INC
60+
INC_PATH = ../Inc
6161
DRIVERS_PATH = ../Drivers/STM32F1xx_HAL_Driver/Inc
6262
LEGACY_PATH = ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy
6363
DEVICE_PATH = ../Drivers/CMSIS/Device/ST/STM32F1xx/Include

make/subdir_src.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ C_DEPS += \
4242
./Src/stm32f1xx_it.d \
4343
./Src/system_stm32f1xx.d
4444

45-
INC_PATH = ../INC
45+
INC_PATH = ../Inc
4646
DRIVERS_PATH = ../Drivers/STM32F1xx_HAL_Driver/Inc
4747
LEGACY_PATH = ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy
4848
DEVICE_PATH = ../Drivers/CMSIS/Device/ST/STM32F1xx/Include

make/subdir_startup.mk

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
# Add inputs and outputs from these tool invocations to the build variables
66
S_SRCS += \
7-
../startup/startup_stm32f103x6.s
7+
../Startup/startup_stm32f103x6.s
88

99
OBJS += \
10-
./startup/startup_stm32f103x6.o
10+
./Startup/startup_stm32f103x6.o
1111

1212

1313
# Each subdirectory must supply rules for building sources it contributes
14-
startup/%.o: ../startup/%.s
14+
Startup/%.o: ../Startup/%.s
1515
@echo 'Building file: $<'
1616
@echo 'Invoking: MCU GCC Assembler'
1717
@echo $(PWD)

0 commit comments

Comments
 (0)