Rotational energy transfers in proton collisions with CO2 and HF targets