Closed hitech95 closed 3 years ago
Just for reference, power.h does not work with ATmega324PB either.
The following things have to be changed in order to get the power functions working for m324PB and m328PB controller:
power.h
add __AVR_ATmega324PB__
and __AVR_ATmega328PB__
defines
iom324pb.h and iom328pb.h
PRSPI0
-> PRSPI
PRTWI0
-> PRTWI
__AVR_HAVE_PRR0_PRSPI0
-> __AVR_HAVE_PRR0_PRSPI
__AVR_HAVE_PRR0_PRTWI0
-> __AVR_HAVE_PRR0_PRTWI
Huh? That seems like a bad approach - that IS correctly defined in the io header - there are two SPI and TWI peripherals, and as far as I can tell they both get a bit in a PRR register to shut them down... So we should instead leave iom32*pb.h untouched, and add the following to power.h so that it can understand the real register names - and will provide the power management functions for the second SPI and TWI peripherals too
And as you said, add those parts to the list...
Yes, that is also possible. I though to use the existing definitions from the other controllers, but you are right, because __AVR_HAVE_PRR1_PRSPI1
and __AVR_HAVE_PRR1_PRTWI1
are also missing in power.h
.
@SpenceKonde some typos on that code but it's that the path.
Yeah, I was doing it in github off the top of my head shrug
Spence Konde Azzy’S Electronics
New products! Check them out at tindie.com/stores/DrAzzy GitHub: github.com/SpenceKonde ATTinyCore: Arduino support for almost every ATTiny microcontroller Contact: spencekonde@gmail.com
On Sun, May 3, 2020, 08:59 chaveiro notifications@github.com wrote:
@SpenceKonde https://github.com/SpenceKonde some typos that but it's that the path.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arduino/toolchain-avr/issues/66#issuecomment-623106491, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTXEWZMIP4OMUIEFRITAMLRPVTEHANCNFSM4JOUN6KA .
Unfortunately i'm not sure where is the repository for hardware\tools\avr\avr\include\avr\power.h file. Is it part of AVR toolchain from Atmel (now Microchip) ?
https://github.com/arduino/toolchain-avr/ seems just a bunch of scripts that compiles the AVR Toolchain for arduino project, but no source for that file there. If the source comes from here: https://www.microchip.com/mplab/avr-support/avr-and-arm-toolchains-c-compilers
How to report a bug to Microchip ?
I've seen that some changes has been merged. Are those available to general public?
If not how can I test the new patches?
These fixes are in arduino7 version of toolchain, which is included by default on 1.8.13.
This issue should be closed.
Just tested, its working.
I thought it was a problem of MiniCore but after some troubleshooting its not. #117
So far I have found that thoose functions are missing:
But I think that others might also missing. The same code compiled for the 168PB works fine.
I'm using Arduino 1.8.0 that is shipped with: