Skip to content

Commit

Permalink
Rename stm32fx/ -> stm32f4/ (#1898)
Browse files Browse the repository at this point in the history
* Rename stm32fx/ -> stm32f4/

* jungle too
  • Loading branch information
adeebshihadeh authored Mar 11, 2024
1 parent 6dfd4db commit 895a700
Show file tree
Hide file tree
Showing 30 changed files with 22 additions and 22 deletions.
6 changes: 3 additions & 3 deletions SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def build_project(project_name, project, extra_flags):
'..',
panda_root,
f"{panda_root}/board/",
f"{panda_root}/board/stm32fx/inc",
f"{panda_root}/board/stm32f4/inc",
f"{panda_root}/board/stm32h7/inc",
]

Expand Down Expand Up @@ -130,8 +130,8 @@ def build_project(project_name, project, extra_flags):

base_project_f4 = {
"MAIN": "main.c",
"STARTUP_FILE": File("./board/stm32fx/startup_stm32f413xx.s"),
"LINKER_SCRIPT": File("./board/stm32fx/stm32f4_flash.ld"),
"STARTUP_FILE": File("./board/stm32f4/startup_stm32f413xx.s"),
"LINKER_SCRIPT": File("./board/stm32f4/stm32f4_flash.ld"),
"APP_START_ADDRESS": "0x8004000",
"PROJECT_FLAGS": [
"-mcpu=cortex-m4",
Expand Down
2 changes: 1 addition & 1 deletion board/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#ifdef STM32H7
#include "stm32h7/stm32h7_config.h"
#elif defined(STM32F4)
#include "stm32fx/stm32fx_config.h"
#include "stm32f4/stm32f4_config.h"
#else
// TODO: uncomment this, cppcheck complains
// building for tests
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions board/stm32fx/board.h → board/stm32f4/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#include "boards/unused_funcs.h"

// ///// Board definition and detection ///// //
#include "stm32fx/lladc.h"
#include "stm32f4/lladc.h"
#include "drivers/harness.h"
#include "drivers/fan.h"
#include "stm32fx/llfan.h"
#include "stm32f4/llfan.h"
#include "drivers/clock_source.h"
#include "boards/white.h"
#include "boards/grey.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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 12 additions & 12 deletions board/stm32fx/stm32fx_config.h → board/stm32f4/stm32f4_config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "stm32fx/inc/stm32f4xx.h"
#include "stm32fx/inc/stm32f4xx_hal_gpio_ex.h"
#include "stm32f4/inc/stm32f4xx.h"
#include "stm32f4/inc/stm32f4xx_hal_gpio_ex.h"
#define MCU_IDCODE 0x463U

// from the linker script
Expand Down Expand Up @@ -50,32 +50,32 @@
#include "drivers/registers.h"
#include "drivers/interrupts.h"
#include "drivers/gpio.h"
#include "stm32fx/peripherals.h"
#include "stm32fx/interrupt_handlers.h"
#include "stm32f4/peripherals.h"
#include "stm32f4/interrupt_handlers.h"
#include "drivers/timers.h"
#include "stm32fx/board.h"
#include "stm32fx/clock.h"
#include "stm32f4/board.h"
#include "stm32f4/clock.h"
#include "drivers/watchdog.h"

#include "drivers/spi.h"
#include "stm32fx/llspi.h"
#include "stm32f4/llspi.h"

#if !defined(BOOTSTUB)
#include "drivers/uart.h"
#include "stm32fx/lluart.h"
#include "stm32f4/lluart.h"
#endif

#if defined(PANDA) && !defined(BOOTSTUB)
#include "stm32fx/llexti.h"
#include "stm32f4/llexti.h"
#endif

#ifdef BOOTSTUB
#include "stm32fx/llflash.h"
#include "stm32f4/llflash.h"
#else
#include "stm32fx/llbxcan.h"
#include "stm32f4/llbxcan.h"
#endif

#include "stm32fx/llusb.h"
#include "stm32f4/llusb.h"

void early_gpio_float(void) {
RCC->AHB1ENR = RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOBEN | RCC_AHB1ENR_GPIOCEN;
Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions tests/misra/test_mutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
'board/obj',
'board/jungle',
'board/stm32h7/inc',
'board/stm32fx/inc',
'board/stm32f4/inc',
'board/fake_stm.h',

# bootstub only files
'board/flasher.h',
'board/bootstub.c',
'board/bootstub_declarations.h',
'board/stm32fx/llflash.h'
'board/stm32f4/llflash.h'
)

mutations = [
# default
(None, None, False),
# F4 only
("board/stm32fx/llbxcan.h", "s/1U/1/g", True),
("board/stm32f4/llbxcan.h", "s/1U/1/g", True),
# H7 only
("board/stm32h7/llfdcan.h", "s/return ret;/if (true) { return ret; } else { return false; }/g", True),
# general safety
Expand Down Expand Up @@ -60,7 +60,7 @@

all_files = glob.glob('board/**', root_dir=ROOT, recursive=True)
files = [f for f in all_files if f.endswith(('.c', '.h')) and not f.startswith(IGNORED_PATHS)]
assert len(files) > 70, all(d in files for d in ('board/main.c', 'board/stm32fx/llbxcan.h', 'board/stm32h7/llfdcan.h', 'board/safety/safety_toyota.h'))
assert len(files) > 70, all(d in files for d in ('board/main.c', 'board/stm32f4/llbxcan.h', 'board/stm32h7/llfdcan.h', 'board/safety/safety_toyota.h'))

for p in patterns:
mutations.append((random.choice(files), p, True))
Expand Down

0 comments on commit 895a700

Please sign in to comment.