Regulation of atmospheric oxygen during the Proterozoic