Skip to content

Commit a0d11a2

Browse files
committed
Squashed 'avr/cores/MCUdude_corefiles/' changes from d6d417b..9108614
9108614 Fix issue with PWM on pin D2 with 328PB This kinda ugly fix is necessary to get PWM working properly when using timer3b or timer4b on ATmega328PB. It's strange, but the PWM functionality gets disabled when PORTD bit 2 is set to zero 2245d4c Merge branch 'master' of https://github.com/MCUdude/MCUdude_corefiles 47ce3a3 Add support for the new *PB variants 903e61b Merge pull request #9 from per1234/test-mightycore 9df002b Update MightyCore core folder name 75464f9 Fix typos in .travis.yml comments a4026bc Update README.md 090c9de Merge pull request #8 from per1234/test-minicore 6c244c7 Merge pull request #7 from per1234/fix-travis ea9f095 Test against MiniCore 57a3c9a Update MajorCore core folder name in .travis.yml git-subtree-dir: avr/cores/MCUdude_corefiles git-subtree-split: 91086148c25fc02bc148374ed180ead001b2d9d7
1 parent 8b4d7aa commit a0d11a2

File tree

5 files changed

+42
-32
lines changed

5 files changed

+42
-32
lines changed

.travis.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ install:
2424
- set_application_folder "$APPLICATION_FOLDER"
2525
- set_sketchbook_folder "$SKETCHBOOK_FOLDER"
2626

27-
# The oldest version of the Aruino IDE that MightyCore's platform.txt is compatible with is 1.6.2 but that IDE version has a bug that interferes with other installations of the IDE so I'm starting from 1.6.3
27+
# The oldest version of the Arduino IDE that MightyCore's platform.txt is compatible with is 1.6.2 but that IDE version has a bug that interferes with other installations of the IDE so I'm starting from 1.6.3
2828
- install_ide "1.6.3" "newest"
2929

3030
# Install MightyCore
3131
- install_package "https://github.com/MCUdude/MightyCore/archive/master.zip"
3232
# Replace the core with the current version from this repository
33-
- rm --force --recursive --verbose "${SKETCHBOOK_FOLDER}/hardware/MightyCore-master/avr/cores/MightyCore/*"
34-
- cp --force --recursive --verbose "$TRAVIS_BUILD_DIR"/* "${SKETCHBOOK_FOLDER}/hardware/MightyCore-master/avr/cores/MightyCore"
33+
- rm --force --recursive --verbose "${SKETCHBOOK_FOLDER}/hardware/MightyCore-master/avr/cores/MCUdude_corefiles/*"
34+
- cp --force --recursive --verbose "$TRAVIS_BUILD_DIR"/* "${SKETCHBOOK_FOLDER}/hardware/MightyCore-master/avr/cores/MCUdude_corefiles"
3535

3636
# MegaCore
3737
- install_package "https://github.com/MCUdude/MegaCore/archive/master.zip"
@@ -40,13 +40,13 @@ install:
4040

4141
# MajorCore
4242
- install_package "https://github.com/MCUdude/MajorCore/archive/master.zip"
43-
- rm --force --recursive --verbose "${SKETCHBOOK_FOLDER}/hardware/MajorCore-master/avr/cores/majorcore/*"
44-
- cp --force --recursive --verbose "$TRAVIS_BUILD_DIR"/* "${SKETCHBOOK_FOLDER}/hardware/MajorCore-master/avr/cores/majorcore"
43+
- rm --force --recursive --verbose "${SKETCHBOOK_FOLDER}/hardware/MajorCore-master/avr/cores/MCUdude_corefiles/*"
44+
- cp --force --recursive --verbose "$TRAVIS_BUILD_DIR"/* "${SKETCHBOOK_FOLDER}/hardware/MajorCore-master/avr/cores/MCUdude_corefiles"
4545

46-
# MiniCore (disabled until build.core value is changed in MiniCore's boards.txt)
47-
#- install_package "https://github.com/MCUdude/MiniCore/archive/master.zip"
48-
#- rm --force --recursive --verbose "${SKETCHBOOK_FOLDER}/hardware/MiniCore-master/avr/cores/MCUdude_corefiles/*"
49-
#- cp --force --recursive --verbose "$TRAVIS_BUILD_DIR"/* "${SKETCHBOOK_FOLDER}/hardware/MiniCore-master/avr/cores/MCUdude_corefiles"
46+
# MiniCore
47+
- install_package "https://github.com/MCUdude/MiniCore/archive/master.zip"
48+
- rm --force --recursive --verbose "${SKETCHBOOK_FOLDER}/hardware/MiniCore-master/avr/cores/MCUdude_corefiles/*"
49+
- cp --force --recursive --verbose "$TRAVIS_BUILD_DIR"/* "${SKETCHBOOK_FOLDER}/hardware/MiniCore-master/avr/cores/MCUdude_corefiles"
5050

5151

5252
script:
@@ -70,18 +70,18 @@ script:
7070
- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MajorCore-master:avr:162:BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
7171
- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MajorCore-master:avr:8515:BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
7272

73-
#- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MiniCore-master:avr:328:variant=modelP,BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
74-
#- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MiniCore-master:avr:168:variant=modelP,BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
75-
#- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MiniCore-master:avr:88:variant=modelP,BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
76-
#- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MiniCore-master:avr:48:variant=modelP,BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
77-
#- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MiniCore-master:avr:8:BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
73+
- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MiniCore-master:avr:328:variant=modelP,BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
74+
- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MiniCore-master:avr:168:variant=modelP,BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
75+
- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MiniCore-master:avr:88:variant=modelP,BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
76+
- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MiniCore-master:avr:48:variant=modelP,BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
77+
- build_sketch "${APPLICATION_FOLDER}/arduino/examples/01.Basics/BareMinimum/BareMinimum.ino" "MiniCore-master:avr:8:BOD=2v7,LTO=Os,clock=16MHz_external" "false" "all"
7878

7979

8080
after_script:
8181
# Determine user name and repository name from TRAVIS_REPO_SLUG so the configuration will automatically adjust to forks
8282
- USER_NAME="$(echo "$TRAVIS_REPO_SLUG" | cut -d'/' -f 1)"
8383
- REPOSITORY_NAME="$(echo "$TRAVIS_REPO_SLUG" | cut -d'/' -f 2)"
84-
# Commit a report of the job results to a folder named with the build number in the MegaCore branch of the Travis-build-outputs repository
84+
# Commit a report of the job results to a folder named with the build number in the MCUdude_corefiles branch of the CI-reports repository
8585
- publish_report_to_repository "$REPORT_GITHUB_TOKEN" "https://github.com/${USER_NAME}/CI-reports.git" "$REPOSITORY_NAME" "build_$(printf "%05d\n" "${TRAVIS_BUILD_NUMBER}")" "false"
8686

8787
# Print a tab separated report of all sketch verification results to the log

Arduino.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ void yield(void);
7272
#define INTERNAL2V56 3
7373
#define INTERNAL 3
7474

75-
// ATmega48/P, ATmega88/P, ATmega168/P, ATmega328/P
76-
#elif defined(__AVR_ATmega48__) || defined(__AVR_ATmega48P__) || defined(__AVR_ATmega88__) \
77-
|| defined(__AVR_ATmega88P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) \
78-
|| defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
75+
// ATmega48/P/PB, ATmega88/P/PB, ATmega168/P/PB, ATmega328/P/PB
76+
#elif defined(__AVR_ATmega48__) || defined(__AVR_ATmega48P__) || defined(__AVR_ATmega48PB__) \
77+
|| defined(__AVR_ATmega88__) || defined(__AVR_ATmega88P__) || defined(__AVR_ATmega88PB__) \
78+
|| defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega168PB__) \
79+
|| defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328PB__)
7980
#define EXTERNAL 0
8081
#define DEFAULT 1 // Default -> AVCC with external capacitor at AREF pin
8182
#define INTERNAL1V1 3

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Arduino core files for MCUdude's cores
22
[![Build Status](https://travis-ci.org/MCUdude/MCUdude_corefiles.svg?branch=master)](https://travis-ci.org/MCUdude/MCUdude_corefiles)
33

4-
This repo contains the Arduino corefiles used with [MightyCore](https://github.com/MCUdude/MightyCore), [MegaCore](https://github.com/MCUdude/MegaCore) and [MajorCore](https://github.com/MCUdude/MightyCore).
4+
This repo contains the Arduino corefiles used with [MightyCore](https://github.com/MCUdude/MightyCore), [MegaCore](https://github.com/MCUdude/MegaCore), [MiniCore](https://github.com/MCUdude/MiniCore) and [MajorCore](https://github.com/MCUdude/MightyCore).
55

66
## Supported devices
77
* ATmega640, ATmega1280, ATmega2560

WInterrupts.c

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,11 @@ void attachInterrupt(uint8_t interruptNum, void (*userFunc)(void), int mode)
213213
EIMSK |= (1 << INT2);
214214
break;
215215

216-
// ATmega48/P, ATmega88/P, ATmega168/P, ATmega328/P
217-
#elif defined(__AVR_ATmega48__) || defined(__AVR_ATmega48P__) || defined(__AVR_ATmega88__) \
218-
|| defined(__AVR_ATmega88P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) \
219-
|| defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
216+
// ATmega48/P/PB, ATmega88/P/PB, ATmega168/P/PB, ATmega328/P/PB
217+
#elif defined(__AVR_ATmega48__) || defined(__AVR_ATmega48P__) || defined(__AVR_ATmega48PB__) \
218+
|| defined(__AVR_ATmega88__) || defined(__AVR_ATmega88P__) || defined(__AVR_ATmega88PB__) \
219+
|| defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega168PB__) \
220+
|| defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328PB__)
220221
case 0:
221222
EICRA = (EICRA & ~((1 << ISC00) | (1 << ISC01))) | (mode << ISC00);
222223
EIMSK |= (1 << INT0);
@@ -349,10 +350,11 @@ void detachInterrupt(uint8_t interruptNum)
349350
EIMSK &= ~(1 << INT2);
350351
break;
351352

352-
// ATmega48/P, ATmega88/P, ATmega168/P, ATmega328/P
353-
#elif defined(__AVR_ATmega48__) || defined(__AVR_ATmega48P__) || defined(__AVR_ATmega88__) \
354-
|| defined(__AVR_ATmega88P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) \
355-
|| defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
353+
// ATmega48/P/PB, ATmega88/P/PB, ATmega168/P/PB, ATmega328/P/PB
354+
#elif defined(__AVR_ATmega48__) || defined(__AVR_ATmega48P__) || defined(__AVR_ATmega48PB__) \
355+
|| defined(__AVR_ATmega88__) || defined(__AVR_ATmega88P__) || defined(__AVR_ATmega88PB__) \
356+
|| defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega168PB__) \
357+
|| defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328PB__)
356358
case 0:
357359
EIMSK &= ~(1 << INT0);
358360
break;
@@ -422,10 +424,11 @@ void detachInterrupt(uint8_t interruptNum)
422424
IMPLEMENT_ISR(INT1_vect, EXTERNAL_INT_1)
423425
IMPLEMENT_ISR(INT2_vect, EXTERNAL_INT_2)
424426

425-
// ATmega48/P, ATmega88/P, ATmega168/P, ATmega328/P
426-
#elif defined(__AVR_ATmega48__) || defined(__AVR_ATmega48P__) || defined(__AVR_ATmega88__) \
427-
|| defined(__AVR_ATmega88P__) || defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) \
428-
|| defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__)
427+
// ATmega48/P/PB, ATmega88/P/PB, ATmega168/P/PB, ATmega328/P/PB
428+
#elif defined(__AVR_ATmega48__) || defined(__AVR_ATmega48P__) || defined(__AVR_ATmega48PB__) \
429+
|| defined(__AVR_ATmega88__) || defined(__AVR_ATmega88P__) || defined(__AVR_ATmega88PB__) \
430+
|| defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega168PB__) \
431+
|| defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega328PB__)
429432
IMPLEMENT_ISR(INT0_vect, EXTERNAL_INT_0)
430433
IMPLEMENT_ISR(INT1_vect, EXTERNAL_INT_1)
431434

wiring_analog.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ void analogWrite(uint8_t pin, int val)
210210
#if defined(TCCR3A) && defined(COM3B1)
211211
case TIMER3B:
212212
// connect pwm to pin on timer 3, channel B
213+
#if defined(__AVR_ATmega328PB__) // Fix ATmega328PB silicon bug
214+
sbi(PORTD, PD2);
215+
#endif
213216
sbi(TCCR3A, COM3B1);
214217
OCR3B = val; // set pwm duty
215218
break;
@@ -237,6 +240,9 @@ void analogWrite(uint8_t pin, int val)
237240
#if defined(TCCR4A) && defined(COM4B1)
238241
case TIMER4B:
239242
// connect pwm to pin on timer 4, channel B
243+
#if defined(__AVR_ATmega328PB__) // Fix ATmega328PB silicon bug
244+
sbi(PORTD, PD2);
245+
#endif
240246
sbi(TCCR4A, COM4B1);
241247
OCR4B = val; // set pwm duty
242248
break;

0 commit comments

Comments
 (0)