Skip to content

Commit

Permalink
Fix compiling on Linux (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
jussike authored Jan 4, 2025
1 parent ab28a03 commit 330d2c4
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 23 deletions.
3 changes: 0 additions & 3 deletions Src/FOC.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ char PI_flag=0;

//const q31_t _T = 2048;

TIM_HandleTypeDef htim1;


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);
void svpwm(q31_t q31_u_alpha, q31_t q31_u_beta);

Expand Down
6 changes: 3 additions & 3 deletions Src/display_No_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.



UART_HandleTypeDef huart1;
extern UART_HandleTypeDef huart1;
#if (DISPLAY_TYPE == DISPLAY_TYPE_NO2)

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

uint8_t lowByte(uint16_t word);
uint8_t highByte(uint16_t word);
static uint8_t lowByte(uint16_t word);
static uint8_t highByte(uint16_t word);

uint8_t pas_tolerance = 0;
uint8_t wheel_magnets = 1;
Expand Down
2 changes: 1 addition & 1 deletion Src/display_bafang.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RXSTATE_INFOMESSAGE 4 //info code received, waiting for info message
#define RXSTATE_DONE 5 //command received

UART_HandleTypeDef huart1;
extern UART_HandleTypeDef huart1;

// Local function prototypes
//static void BAFANG_Service(BAFANG_t* BF_ctx, uint8_t rx);
Expand Down
6 changes: 3 additions & 3 deletions Src/display_ebics.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include "print.h"
#include "config.h"

UART_HandleTypeDef huart1;
uint8_t ui8_rx_buffer[12];
uint8_t ui8_tx_buffer[12];
extern UART_HandleTypeDef huart1;
static uint8_t ui8_rx_buffer[12];
static uint8_t ui8_tx_buffer[12];


void ebics_init()
Expand Down
7 changes: 3 additions & 4 deletions Src/display_kingmeter.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RXSTATE_MSGBODY 2
#define RXSTATE_DONE 3
uint8_t FirstRunFlag = 0;
UART_HandleTypeDef huart1;
UART_HandleTypeDef huart3;
extern UART_HandleTypeDef huart1;


#if (DISPLAY_TYPE == DISPLAY_TYPE_KINGMETER_618U)
Expand Down Expand Up @@ -126,8 +125,8 @@ static void KM_618U_Service(KINGMETER_t* KM_ctx);
static void KM_901U_Service(KINGMETER_t* KM_ctx);
#endif

uint8_t lowByte(uint16_t word);
uint8_t highByte(uint16_t word);
static uint8_t lowByte(uint16_t word);
static uint8_t highByte(uint16_t word);

uint8_t pas_tolerance = 0;
uint8_t wheel_magnets = 1;
Expand Down
6 changes: 3 additions & 3 deletions Src/display_kunteng.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
#include "stm32f1xx_hal.h"
#include "eeprom.h"

uint8_t ui8_tx_buffer[12];
static uint8_t ui8_tx_buffer[12];
uint8_t ui8_j;
uint8_t ui8_crc;
uint8_t ui8_last_XOR;
uint16_t ui16_wheel_period_ms =4500;
uint32_t ui32_battery_volts= 36;
uint8_t ui8_battery_soc = 12;
uint8_t ui16_error;
uint8_t ui8_rx_buffer[13];
static uint8_t ui8_rx_buffer[13];
uint8_t ui8_rx_initial_buffer[13];
uint8_t ui8_rx_buffer_counter = 0;
uint8_t ui8_byte_received;
Expand All @@ -30,7 +30,7 @@ uint8_t ui8_gear_ratio = GEAR_RATIO;

volatile struc_lcd_configuration_variables lcd_configuration_variables;

UART_HandleTypeDef huart1;
extern UART_HandleTypeDef huart1;
void check_recent(void);

void kunteng_init()
Expand Down
Empty file added build/.keep
Empty file.
2 changes: 1 addition & 1 deletion make/objects.list
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
"Src/stm32f1xx_hal_msp.o"
"Src/stm32f1xx_it.o"
"Src/system_stm32f1xx.o"
"startup/startup_stm32f103x6.o"
"Startup/startup_stm32f103x6.o"
2 changes: 1 addition & 1 deletion make/subdir_drivers.mk
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ C_DEPS += \
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.d \
./Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.d

INC_PATH = ../INC
INC_PATH = ../Inc
DRIVERS_PATH = ../Drivers/STM32F1xx_HAL_Driver/Inc
LEGACY_PATH = ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy
DEVICE_PATH = ../Drivers/CMSIS/Device/ST/STM32F1xx/Include
Expand Down
2 changes: 1 addition & 1 deletion make/subdir_src.mk
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ C_DEPS += \
./Src/stm32f1xx_it.d \
./Src/system_stm32f1xx.d

INC_PATH = ../INC
INC_PATH = ../Inc
DRIVERS_PATH = ../Drivers/STM32F1xx_HAL_Driver/Inc
LEGACY_PATH = ../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy
DEVICE_PATH = ../Drivers/CMSIS/Device/ST/STM32F1xx/Include
Expand Down
6 changes: 3 additions & 3 deletions make/subdir_startup.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

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

OBJS += \
./startup/startup_stm32f103x6.o
./Startup/startup_stm32f103x6.o


# Each subdirectory must supply rules for building sources it contributes
startup/%.o: ../startup/%.s
Startup/%.o: ../Startup/%.s
@echo 'Building file: $<'
@echo 'Invoking: MCU GCC Assembler'
@echo $(PWD)
Expand Down

0 comments on commit 330d2c4

Please sign in to comment.