I don`t know how do you call the function videomode. You call it in a while(1) loop? if not, set the while(1) loop in the function videomode itself.