Teensy 4.0 / 4.1 startup delay of 300 ms

Status
Not open for further replies.

profor

Active member
Hello all,

probably question for @PaulStoffregen, is this delay in startup.c in ResetHandler funcrion really neccessary?

Code:
	startup_early_hook();
	while (millis() < 20) ; // wait at least 20ms before starting USB
	usb_init();
	analog_init();
	pwm_init();
	tempmon_init();

	startup_late_hook();
[B]	while (millis() < 300) ; // wait at least 300ms before calling user code[/B]
	//printf("before C++ constructors\n");
	__libc_init_array();
	//printf("after C++ constructors\n");
	//printf("before setup\n");
	main();

The thing is that i am using Teensy 4.0 as CAN gateway in my car and during 300 ms i will miss several important messages that needs to be forwarded to rest two CAN ports (i am using all three).
Can i change it down to let say 40 ms so Teensy will "get up" faster?

Thank You very much.
 
Usually the startup delay can be removed. It's there because some devices like MEMS motion sensor chips need time to start up. Many Arduino libraries and projects depend on Arduino's normal slow startup because they don't properly wait for the chips they use to become ready. That's why we have the 300ms delay, so all that stuff will "just work" with Teensy.
 
Status
Not open for further replies.
Back
Top