STM32 Middlewares with PlatformIO

I am trying to use FreeRTOS with my STM32F4Discovery board. I’ve been using this discussion as a guideline, but have not gotten my code to build successfully.
I did what was recommended; set settings to “Other toolchain (GPDSC)” in CubeMX, as well as all of step three in that guide. My output directory differs from the initial answer since I have a “Middlewares” folder as well.
Here’s my current code: GitHub - RyanSchw/PER-Wheel-Module: Wheel module for PER2018

I regularly use STM32CubeMX to change things on my board, so I need to be able to change stuff and hit “build” to rebuild the code from the .ioc file. Unfortunately, that no longer means I can change the directory of the #includes in the code.

As far as the error I am getting, it is giving me errors in files I don’t even touch (auto-generated by STM32CubeMX). How can I fix my setup to allow this code to build successfully?

Compiling .pioenvs/disco_f407vg/src/gpio.o
In file included from lib/Middlewares/portable.h:94:0,
from lib/Middlewares/FreeRTOS.h:104,
from src/freertos.c:50:
lib/Middlewares/portmacro.h:209:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
static portFORCE_INLINE void vPortSetBASEPRI( uint32_t ulBASEPRI )
^~~~
lib/Middlewares/portmacro.h:220:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
static portFORCE_INLINE void vPortRaiseBASEPRI( void )
^~~~
lib/Middlewares/portmacro.h:235:25: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'

Here’s the full build error: https://gist.github.com/RyanSchw/397ab2dc3f1fb6216ac2a9308ef9e0c8