This code was originally written for use with the CooCox IDE back in 2014. It uses ST StdPeriphLib (SPL) as opposed to HAL.
I have ported this using the built-in board definition for a board that supports the SPL. After making some small changes (mostly to include paths, but also un-inlining a couple function calls) and removing dead code, it appears to compile cleanly.
Actual binary is untested.