Change the Pixhawk microprocessor

Hello.
I’m going to change the Pixhawk processor. How do I change the code to be compatible with the new processor?
Any help would be appreciated.
Thanks.