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

watchdogReset / watchdogEnable compile error if NOT __SAMD51__ ? and more #70

Open
fanno opened this issue May 21, 2022 · 1 comment
Open

Comments

@fanno
Copy link

fanno commented May 21, 2022

Started work on looking throw code to try and adde a different position system than GPS.

I only have a MEGA arduino atm so not sure if thats the fault or nor so i added a new "MEGA" definition i dont know the "real" defenition it should have. how throw this i "may" have founed some problems. pehaps there is a reason you dont use mega if så let me know and i will have to get a replacment.

in map.cpp / motor.cpp / robot.cpp

watchdogReset();
TO:
#if defined(SAMD51)
watchdogReset();
#endif

watchdogEnable(...)

#if defined(SAMD51)
watchdogEnable(...)
#endif

others:
analogReadResolution()
is not in mega bard so i understand this one comes up. again i can change it so it just dont call if "MEGA"
but again i dont know the reson for this i am just starting out so something else me need to be done here

PINS_COUNT
i am not enterly sure about this one but it is undefined ?

i am guessing it is similar to

I was also missing: SD.h
not sure if it is this one. https://registry.platformio.org/libraries/arduino-libraries/SD/installation

i fixed a few other thinhs that may or may not be related. i have no more problems in the files on build
when i try ot buid i get: did have to rename sunray.ino to sunray.cpp as i am using VSC (dont think thats the proble tho)
Linking .pio\build\megaatmega2560\firmware.elf
...
...
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\megaatmega2560\firmware.elf] Error 1

Not sure IF a mega version could be creted or not (eg if there is a reason why you are not using that.)

-Thanks
Morten Hundevad

P.S. do you have a discoard or e-mail group i could join for things like this that "may or may NOT" be a "bug"
[email protected]

@fanno
Copy link
Author

fanno commented May 21, 2022

fined the reason why it did not compile

had to add this, (not sure what konsequence this has tho.) just so i can compile it.
reason was missing "sbrk"

int freeMemory() {
#ifdef linux
return 1000000;
#elif MEGA <<<<<<<
return 1000000; <<<<<<<
#else
char top;
return &top - reinterpret_cast<char*>(sbrk(0));
#endif
}

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

1 participant