Skip to content

Commit

Permalink
[Breaking Change] filename and dir name change
Browse files Browse the repository at this point in the history
  • Loading branch information
jason committed Apr 5, 2024
1 parent 5ad556a commit f558093
Show file tree
Hide file tree
Showing 25 changed files with 57 additions and 20 deletions.
27 changes: 23 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "0.2.0",
"configurations": [
{
"name": "cmsis-dap-debug (Windows)",
"name": "dap (Win)",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}\\build\\control-base.elf",
"request": "launch",
Expand All @@ -21,7 +21,7 @@
"preLaunchTask": "build (Windows)" // build before debug
},
{
"name": "stlink-debug (Windows)",
"name": "stlink (Win)",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}\\build\\control-base.elf",
"request": "launch",
Expand All @@ -40,7 +40,7 @@
"preLaunchTask": "build (Windows)" // build before debug
},
{
"name": "cmsis-dap-debug (Darwin)",
"name": "dap",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}/build/control-base.elf",
"request": "launch",
Expand All @@ -56,7 +56,26 @@
"enabled": true,
"samplesPerSecond": 4
},
"preLaunchTask": "build (Darwin)" // build before debug
"preLaunchTask": "build" // build before debug
},
{
"name": "stlink",
"cwd": "${workspaceRoot}",
"executable": "${workspaceRoot}\\build\\control-base.elf",
"request": "launch",
"type": "cortex-debug",
"svdFile": "STM32F407.svd",
"servertype": "openocd", //GDB server
"configFiles": [
"${workspaceRoot}/config/openocd_stlink.cfg" // config
],
//"runToEntryPoint": "main", // stop at main
//"rtos": "FreeRTOS",
"liveWatch": {
"enabled": true,
"samplesPerSecond": 4
},
"preLaunchTask": "build" // build before debug
}
]
}
18 changes: 15 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"version": "2.0.0",
"tasks": [
/* For Unix-Like (Linux and MacOS) */
{
"label": "build (Darwin)",
"label": "build",
"type": "shell",
"command": "make -j24 V=1",
"args": [],
Expand All @@ -24,14 +25,25 @@
}
},
{
"label": "flash (Darwin)",
"label": "flash",
"type": "shell",
"command": "mingw32-make -j24 V=1; mingw32-make download",
"command": "make -j24 V=1; make download",
"group": {
"kind": "build",
"isDefault": false
}
},
{
"label": "rebuild",
"type": "shell",
"command": "git submodule update; make clean_unix; make -j24 V=1",
"group": {
"kind": "build",
"isDefault": false
},
"problemMatcher": [],
},
/* For Windows */
{
"label": "build (Windows)",
"type": "shell",
Expand Down
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ src/bsp/src/bsp_spi.c \
src/bsp/src/bsp_serial.c \
src/bsp/src/bsp_crc.c \
src/bsp/src/bsp_uart.c \
src/devices/src/BMI088driver.c \
src/devices/src/BMI088Middleware.c \
src/devices/src/bmi088driver.c \
src/devices/src/bmi088middleware.c \
src/devices/src/buzzer.c \
src/devices/src/dji_motor.c \
src/devices/src/dm_motor.c \
Expand Down Expand Up @@ -208,8 +208,8 @@ C_INCLUDES = \
-Ilib/CMSIS-DSP/PrivateInclude \
-Isrc/algo/inc \
-Isrc/devices/inc \
-Isrc/bsp/Inc \
-Isrc/app/Inc
-Isrc/bsp/inc \
-Isrc/app/inc

# compile gcc flags
ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -fdata-sections -ffunction-sections
Expand All @@ -234,7 +234,7 @@ LDSCRIPT = $(BOARD_BASE)/$(LINK_SCRIPT_PREFIX)_FLASH.ld
# libraries
LIBS = -lc -lm -lnosys
LIBDIR =
LDFLAGS = $(MCU) -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections -flto -Wl,--no-warn-rwx-segments -Wl,--print-memory-usage -u _printf_float
LDFLAGS = $(MCU) -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections -flto -Wl,--print-memory-usage -u _printf_float

# default action: build all
all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
Expand Down Expand Up @@ -274,7 +274,9 @@ $(BUILD_DIR):
#######################################
clean:
rd $(BUILD_DIR) /s/q


clean_unix:
rm -rf $(BUILD_DIR)
#######################################
# dependencies
#######################################
Expand All @@ -299,8 +301,8 @@ download_powershell:


# Unix-Like (Linux, MacOS)
ECHO_WARNING=@echo -e "\033[33m[Warning]\033[0m"
ECHO_SUCCESS=@echo -e "\033[32m[Success]\033[0m"
ECHO_WARNING=echo "\033[33m[Warning]\033[0m"
ECHO_SUCCESS=echo "\033[32m[Success]\033[0m"

download:
@echo "Attempting to use CMSIS-DAP..."
Expand All @@ -311,4 +313,7 @@ download:
($(ECHO_SUCCESS) "Successfully programmed the device using STLink.") || \
($(ECHO_WARNING) "Failed to connect using both CMSIS-DAP and STLink. Please check your connections and try again."))

test_download:
openocd -d4 -f config/openocd_cmsis_dap.cfg -c init -c halt -c "program $(BUILD_DIR)/$(TARGET).bin 0x08000000 verify reset" -c "reset run" -c shutdown

# *** EOF ***
1 change: 0 additions & 1 deletion src/bsp/Inc/bsp_can.h → src/bsp/inc/bsp_can.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "FreeRTOS.h"
#include "can.h"
#include "freertos.h"
#include "queue.h"
#include "cmsis_os.h"
#include <stdint.h>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "BMI088driver.h"
#include "BMI088reg.h"
#include "BMI088Middleware.h"
#include "bmi088driver.h"
#include "bmi088reg.h"
#include "bmi088middleware.h"


float BMI088_ACCEL_SEN = BMI088_ACCEL_3G_SEN;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "BMI088Middleware.h"
#include "bmi088middleware.h"
#include "main.h"
#include "cmsis_os.h"
#include "bsp_delay.h"
Expand Down
2 changes: 2 additions & 0 deletions src/devices/src/imu_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,11 @@ void IMU_Task_Temp() {
switch (start_complete)
{
case 1:
{
uint16_t temp_pwm = (uint16_t) PID(&g_imu_temp_pid, 40 - g_imu.bmi088_raw.temp);
__HAL_TIM_SetCompare(&htim10, TIM_CHANNEL_1, temp_pwm);
break;
}
case 0:
__HAL_TIM_SetCompare(&htim10, TIM_CHANNEL_1, 4999);
break;
Expand Down

0 comments on commit f558093

Please sign in to comment.