Code for a flyback SMPS