This may be correctly defining a function which when called will start at 0, causing reset, or some of what reset does at least:
void(* resetFunc) (void) = 0;//declare reset function at address 0
but it shouldn't be local to setup().
Move that line out of setup() so it can be seen everywhere,
a7