First, I have to say the the prjc.com site has a lot of documentation for their products. However, after reading the programming manual for Freescale MKL26Z64, I am confused. The manual says a software restart can be done. The problem is the manual refers to another document for the ARM processor. I did do a Google search for information on "Teensy LC restart" without any luck.
I am using this code for the same function with Teensy 3.1:
I suspect the same code could be used, but, with a different register location and value. Thank you in advance for any help on this one.
Enjoy Life, Greg
Live Well, Laugh Often, Love Much
I am using this code for the same function with Teensy 3.1:
Code:
#define SCB_AIRCR (*(volatile uint32_t *)0xE000ED0C) // Application Interrupt and Reset Control location
void softRestart(int pinUsed) {
int test1 = HIGH;
int test2 = LOW;
test1 = digitalRead(pinUsed);
delay(100); //for debounce
test2 = digitalRead(pinUsed);
if ((test1 == test2) && (test1 == LOW)) {
delay(1000); //allow human to release button
Serial.end(); //clears the serial monitor if used
//turn off serial for restart, it will be properly turned after restart with IDE serial monitor
//However, microcom and putty serial connection is killed after restart with or without serial.end()!
SCB_AIRCR = 0x05FA0004; //write value for restart
}
I suspect the same code could be used, but, with a different register location and value. Thank you in advance for any help on this one.
Enjoy Life, Greg
Live Well, Laugh Often, Love Much