Text this: Photonic Generation of Flexible and Adjustable Triangular and Square Waveforms Based on a Comparator