Phase Shift
You inherited SPI driver code for an accelerometer on SPI1. The chip-select wiring, clock setup, and register read sequence all look correct, but the WHO_AM_I register returns garbage instead of the sensor's real ID.
The sensor uses standard SPI read convention: send (register | 0x80), then clock in one response byte. CS is on PA4, active-low.
Output format (the value is whatever the sensor returns): WHOAMI:0x<id>
The code compiles without warnings. Find and fix the bug so the sensor returns the correct ID.