A method comprising: generating a first ramp signal for controlling a buck converter portion of a buck-boost converter, wherein the buck-boost converter comprises: a first high-side switch and a first low-side switch connected in series across an input capacitor; a second high-side switch and a second low-side switch connected in series across an output capacitor (Co); and an inductor coupled between a common node of the first high-side switch and the first low-side switch, and a common node of the second high-side switch and the second low-side switch; generating a second ramp signal for controlling a boost converter portion of the buck-boost converter; comparing the first ramp signal and the second ramp signal to a control signal; controlling a state of the first high-side switch using the comparing the first ramp signal to the control signal and a state of the second low-side switch using the comparing the second ramp signal to the control signal; comparing a current flowing through the inductor to a current threshold; and terminating a switching cycle based upon the comparing the current flowing through the inductor to the current threshold; adding an offset into the first ramp signal or into the second ramp signal; characterized in that the method further comprises: in response to a to-be-delivered output voltage (Vo) being approximately equal to an input voltage (Vin) of the buck-boost converter: turning off the second low-side switch, turning on the second high-side switch and resetting the second ramp signal to its starting value when the second ramp signal is equal to the control signal; turning off the first high-side switch, turning on the first low-side switch and resetting the first ramp signal to its starting value when the first ramp signal is equal to the control signal; turning off the first low-side switch and the second high-side switch, and turning on the first high-side switch and the second low-side switch when the current flowing through the inductor is equal to the current threshold, thereby terminating the switching cycle. generating a first ramp signal for controlling a buck converter portion of a buck-boost converter, wherein the buck-boost converter comprises: a first high-side switch and a first low-side switch connected in series across an input capacitor; a second high-side switch and a second low-side switch connected in series across an output capacitor (Co); and an inductor coupled between a common node of the first high-side switch and the first low-side switch, and a common node of the second high-side switch and the second low-side switch; a first high-side switch and a first low-side switch connected in series across an input capacitor; a second high-side switch and a second low-side switch connected in series across an output capacitor (Co); and an inductor coupled between a common node of the first high-side switch and the first low-side switch, and a common node of the second high-side switch and the second low-side switch; generating a second ramp signal for controlling a boost converter portion of the buck-boost converter; comparing the first ramp signal and the second ramp signal to a control signal; controlling a state of the first high-side switch using the comparing the first ramp signal to the control signal and a state of the second low-side switch using the comparing the second ramp signal to the control signal; comparing a current flowing through the inductor to a current threshold; and terminating a switching cycle based upon the comparing the current flowing through the inductor to the current threshold; adding an offset into the first ramp signal or into the second ramp signal; characterized in that the method further comprises: in response to a to-be-delivered output voltage (Vo) being approximately equal to an input voltage (Vin) of the buck-boost converter: turning off the second low-side switch, turning on the second high-side switch and resetting the second ramp signal to its starting value when the second ramp signal is equal to the control signal; turning off the first high-side switch, turning on the first low-side switch and resetting the first ramp signal to its starting value when the first ramp signal is equal to the control signal; turning off the first low-side switch and the second high-side switch, and turning on the first high-side switch and the second low-side switch when the current flowing through the inductor is equal to the current threshold, thereby terminating the switching cycle. turning off the second low-side switch, turning on the second high-side switch and resetting the second ramp signal to its starting value when the second ramp signal is equal to the control signal; turning off the first high-side switch, turning on the first low-side switch and resetting the first ramp signal to its starting value when the first ramp signal is equal to the control signal; turning off the first low-side switch and the second high-side switch, and turning on the first high-side switch and the second low-side switch when the current flowing through the inductor is equal to the current threshold, thereby terminating the switching cycle.