Endurance w/ Max Sprint

Today I had the 3 hour endurance ride with 10x 8 sec max sprints every 15 minutes. And after the 2nd sprint I had to stop as each sprint felt like I was hitting a brick wall. If it is possible can the workout for that 8 seconds turn ERG mode off. If that isn’t possible because 8 seconds is too short of a time then push it out to 10-20 seconds or whatever time is needed to turn ERG mode off for the sprint and then back on to continue with the ride. Please don’t get me wrong I don’t want to make the workout easier, I just don’t want to hit a brick wall every 15 minutes. Thank you.