serprog: Move synchronicity test into separate function

Extract the sequence to test for synchronicity into a new
function sp_test_sync().

Change-Id: I9e4aac5b8ac524804a3a8989c2794cdfaacb7b32
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/72994
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-by: Riku Viitanen <riku.viitanen@protonmail.com>
1 file changed