Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler error for SparkFun Pro Micro #5

Open
Jim-2249 opened this issue Jul 4, 2021 · 5 comments
Open

compiler error for SparkFun Pro Micro #5

Jim-2249 opened this issue Jul 4, 2021 · 5 comments

Comments

@Jim-2249
Copy link

Jim-2249 commented Jul 4, 2021

When I compile the example code: Watchdog/examples/WatchdogTester/WatchdogTester.ino as-is for the SparkFun Pro Micro 5V 16MHz, I get the following error:
C:..\libraries\Watchdog\src\Watchdog\WatchdogBaseTeensy2.cpp:17:3: error: 'restart_Teensyduino' was not declared in this scope
I have not found any restart_Teensyduino() anywhere.

Thanks for making this code available! -Jim

@mastersta
Copy link

Same issue with the same board. I simply deleted line 17 in WatchdogBaseTeensy2.cpp and it compiled.

@Jim-2249
Copy link
Author

I simply deleted line 17 in WatchdogBaseTeensy2.cpp

Wouldn't that prevent a watchdog timeout from restarting the processor?

@mastersta
Copy link

Honestly I didn't look that hard at the code, I just figured based on the name of the function that it didn't do anything for the Pro Micro, and the fact that the neither you, nor I, nor the compiler found the function anywhere means that it wasn't going to do anything anyways.

That being said, I did a short test run using the library and it didn't seem to work after deleting the line (I ended up just using the avr/wdt) so obviously something's broken.

@Jim-2249
Copy link
Author

Jim-2249 commented Nov 22, 2021

I simply hacked what I wanted out of some other code. Might have been Janelia's code too. I think it's now processor specific, but I won't be using it on other processors. This is the code I used, and probably should work. It was executed to take the processor out of setup mode. When the switch was turned off, the processor executed while(1); until timeout.

void (* rebootProcessor) (void) = 0; //declare reset function at address 0

//WDT Interrupt which will soft reset the board
ISR(WDT_vect)
{
  wdt_disable();
  rebootProcessor();
}

@peterpolidoro
Copy link
Member

I will take a look at this when I have a chance. I am assuming this issue arises because the SparkFun Pro Micro and one of the Teensy boards use the same processor. You could try installing the Teensyduino modifications to the Arduino IDE or maybe there is a way to differentiate between the boards when compiling to only use the Teensyduino code for official Teensy boards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants