Problem with anti-spark switch

I tried to connect DC power to my v3.5 board via anti-spark switch,but I have difficulties in connecting board to PC and driving motors.But when I kept the switch on and turned the DC power off and on,above-mentioned issues were gone.
My first guess was the switch had a delay when I powered on,so I edited Odrive source file by adding ‘‘osDelay(1500)’’ in ‘‘odrive_main(void)’’(shown below) and reflashed firmware again.

int odrive_main(void) {
osDelay(1500);
#if HW_VERSION_MAJOR == 3 && HW_VERSION_MINOR >= 3
#endif
#if HW_VERSION_MAJOR == 3 && HW_VERSION_MINOR >= 5
#endif
#if HW_VERSION_MAJOR == 3 && HW_VERSION_MINOR >= 3
#endif
}

It didn’t solved the problem and felt like every commands I odered in the Anaconda were delayed for 1.5s .I also had tested the time in which Odrive board got powered via swtich and DC,and it turned out that both ways spent nearly 1.5s .