If you have a square wave of which you know the amplitude and period, can't you just create the triangle wave from that using simple geometry?
Triangle wave - HandWiki[
^]
If the rise start point of the TW is synced with the rise of the SW, then all you are doing is drawing the diagonal from BL to TR, then TL to BR which is trivial and should be fast and space efficient.
If the sync is "stepped" as per the diagram in the link, then that's just an offset start point you need to cater for - again simple geometry.