mcudude / mcudude_corefiles Goto Github PK
View Code? Open in Web Editor NEWSubtree for Arduino core files used with MightyCore, MegaCore, MiniCore and MajorCore
Subtree for Arduino core files used with MightyCore, MegaCore, MiniCore and MajorCore
The macros below should be replaced by proper functions, or perhaps template functions for ultimate flexibility.
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(x) ((x)>0?(x):-(x))
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
#define sq(x) ((x)*(x))
More info about why these macros are terrible and should never have been added in the first place can be found here:
https://forum.arduino.cc/index.php?topic=84364.0
A few solutions are provided here:
arduino/Arduino#2069
@SpenceKonde this is relevant for your cores as well
it's announced that the ATmega328PB will be supported in the next "Arduino toolchain". Support for the new *PB series should be considered, with all the bells and whistles they have!
This is just for the books. It all started here.
Maybe we should consider updating the Travis CI script? Right now the current build is failing (caused by a missing directory it seems), and testing for MiniCore is not implemented.
I've committed a change to Tone.cpp, and I'm trying to update MCUdude_corefiles (which is a subtree within MegaCore) without luck. I wrote a simple guide for myself when I worked with this half a year ago, but it somewhat fails. Do you remember how this was done @per1234?
Guide:
# MegaCore must be up to date/identical to the one upstream
(cd into MegaCore folder)
# Add subtree (not sure if this should be done every time?)
$ git remote add -f avr/cores/MCUdude_corefiles https://github.com/MCUdude/MCUdude_corefiles.git
# Fetch
$ git fetch https://github.com/MCUdude/MCUdude_corefiles.git master # --squash
$ git subtree add --prefix avr/cores/MCUdude_corefiles https://github.com/MCUdude/MCUdude_corefiles.git master --squash
# Update subtree
$ git subtree pull --prefix avr/cores/MCUdude_corefiles https://github.com/MCUdude/MCUdude_corefiles.git master --squash
Actual output:
$ git remote add -f avr/cores/MCUdude_corefiles https://github.com/MCUdude/MCUdude_corefiles.git
fatal: remote avr/cores/MCUdude_corefiles already exists.
$ git fetch https://github.com/MCUdude/MCUdude_corefiles.git master # --squash
From https://github.com/MCUdude/MCUdude_corefiles
* branch master -> FETCH_HEAD
$ git subtree add --prefix avr/cores/MCUdude_corefiles https://github.com/MCUdude/MCUdude_corefiles.git master --squash
prefix 'avr/cores/MCUdude_corefiles' already exists.
$ git subtree pull --prefix avr/cores/MCUdude_corefiles https://github.com/MCUdude/MCUdude_corefiles.git master --squash
From https://github.com/MCUdude/MCUdude_corefiles
* branch master -> FETCH_HEAD
Can't squash-merge: 'avr/cores/MCUdude_corefiles' was never added.
@per1234 would you look into this? It seems like its having problems downloading all the different IDE versions.
I've just pushed a commit where I've added accurate micros for these clock frequencies. However, I'm not that good with cycle accurate timing that I feel qualified for this job.
I'm sorry to bother you again @Jackjan4, but you did such a wonderful job with the other clock frequencies a few months ๐ฅ I fully understand if you don't have time or simply don't want to spend time on this, but if you want to contribute I'll promise to do all the testing with my signal generator as clock source.
If this turns out to be a success I'm sure ATTinyCore could benefit from this code as well, since it's missing accurate delayMicroseconds for these frequencies too.
Thanks!
I think this would be the the most important repo to implement tab spacing and line feed checks. Most of the code in this repo is untouched, and I suspect it might contain lots of [tabs] and [CRs].
Arduino specifies a maximum input value to delayMicroseconds of16383. For several of the functions here, the limit is lower since we multiply by numbers greater than 4 (such as 4.125, 5, 6). These roll over, which produces spurious delays.
It would be relatively easy to fix this by adding NOPs to the busy loop and calling it less times, and I wouldn't mind looking into it. It would mean another test cycle for most of the higher clock frequencies though.
I also have three more exact frequencies, namely 16.5 MHz (favorite for overclocking, and contrary to 16 Mhz millis never jumps by 2), 10 MHz (wouldn't have done it but there were comments that needed fixing) and 6 MHz (there is currently a large gap between 7.37 and 4 MHz). Might do this at the same time so we only have to test everything once.
Currently you have minicore, mightycore, majorcore and megacore...
Each of these has one entry in the tools -> board menu for each part...
I have a bold and radical suggestion (and certainly one that I would expect you to think long and hard about...
Why not combine them all into one core? It would cover all the classic megaAVR parts. Replace the board menu entries with the families, ie
"ATmega 328/168/88/48"
"ATmega 1284/644/324/32/16"
and then a tools submenu to choose which part after selecting that board....
That way, people would have to install fewer cores, and there would be less clutter in the tools menu, and you'd only need to maintain one package.
I have another idea for reducing clutter in menus from our board packages too... need to to a bit more research first though..... (and yes, I AM getting sick of the way that my menus are now several screens long, what gave it away?)
But yeah, it's something to think about...
I am working on a project with Atemga8a-pu (DIP-28) controller.
I want to use all the IO pins including Tx and RX pins and without external crystal oscillator,
so I decided to program the controller using ISP method and with internal @ 8Mhz.
The test program is working fine with 16Mhz external crystal and not working with 8 Mhz internal.
please suggest...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.