Skip to content

Commit 1287ee0

Browse files
author
Owen
authored
Merge pull request #232 from sparkfun/release-candidate
2 parents 33bd2d9 + 4d4db9c commit 1287ee0

File tree

3 files changed

+95
-8
lines changed

3 files changed

+95
-8
lines changed

.github/workflows/TestCompile.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# TestCompile.yml
2+
# Github workflow script to test compile all examples of an Arduino library repository.
3+
#
4+
# Copyright (C) 2020 Armin Joachimsmeyer
5+
# https://github.com/ArminJo/Github-Actions
6+
#
7+
8+
# This is the name of the workflow, visible on GitHub UI.
9+
name: TestCompile
10+
on:
11+
push: # see: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
12+
paths:
13+
- '**.ino'
14+
- '**.cpp'
15+
- '**.h'
16+
- '**TestCompile.yml'
17+
pull_request:
18+
jobs:
19+
build:
20+
name: Test compiling examples for Digispark
21+
runs-on: ubuntu-18.04
22+
env:
23+
# Comma separated list without double quotes around the list.
24+
REQUIRED_LIBRARIES: SparkFun MS5637 Barometric Pressure Library,SparkFun MMA8452Q Accelerometer
25+
PLATFORM_DEFAULT_URL: https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json
26+
27+
strategy:
28+
matrix:
29+
# The matrix will produce one job for each configuration parameter of type `arduino-boards-fqbn`
30+
# In the Arduino IDE, the fqbn is printed in the first line of the verbose output for compilation as parameter -fqbn=... for the "arduino-builder -dump-prefs" command
31+
#
32+
# Examples: arduino:avr:uno, arduino:avr:leonardo, arduino:avr:nano, arduino:avr:mega
33+
# arduino:sam:arduino_due_x, arduino:samd:arduino_zero_native"
34+
# ATTinyCore:avr:attinyx5:chip=85,clock=1internal, digistump:avr:digispark-tiny, digistump:avr:digispark-pro
35+
# STM32:stm32:GenF1:pnum=BLUEPILL_F103C8
36+
# esp8266:esp8266:huzzah:eesz=4M3M,xtal=80, esp32:esp32:featheresp32:FlashFreq=80
37+
# You may add a suffix behind the fqbn with "|" to specify one board for e.g. different compile options like arduino:avr:uno|trace
38+
#############################################################################################################
39+
arduino-boards-fqbn:
40+
- SparkFun:apollo3:artemis
41+
- SparkFun:apollo3:amap3redboard
42+
- SparkFun:apollo3:amap3nano
43+
- SparkFun:apollo3:amap3atp
44+
- SparkFun:apollo3:amap3thing
45+
- SparkFun:apollo3:edge
46+
- SparkFun:apollo3:edge2
47+
48+
49+
# Specify parameters for each board.
50+
# With examples-exclude you may exclude specific examples for a board. Use a comma separated list.
51+
#############################################################################################################
52+
include:
53+
- arduino-boards-fqbn: SparkFun:apollo3:artemis
54+
examples-exclude: Example4_analogRead,LowPower_WithWork,Example2_Serial,Example2_MoreSPIPorts,Example6_19servos,Example7_29servos
55+
56+
- arduino-boards-fqbn: SparkFun:apollo3:amap3redboard
57+
examples-exclude: Example2_MoreSPIPorts
58+
59+
- arduino-boards-fqbn: SparkFun:apollo3:amap3nano
60+
examples-exclude: Example6_19servos,Example7_29servos
61+
62+
- arduino-boards-fqbn: SparkFun:apollo3:amap3atp
63+
examples-exclude: Example4_analogRead,Example6_19servos
64+
65+
- arduino-boards-fqbn: SparkFun:apollo3:amap3thing
66+
67+
- arduino-boards-fqbn: SparkFun:apollo3:edge
68+
examples-exclude: Example4_analogRead,LowPower_WithWork,Example2_Serial,Example6_19servos,Example7_29servos
69+
70+
- arduino-boards-fqbn: SparkFun:apollo3:edge2
71+
examples-exclude: Example4_analogRead,LowPower_WithWork,Example2_Serial,Example1_SPI,Example6_19servos,Example7_29servos
72+
73+
# Do not cancel all jobs / architectures if one job fails
74+
fail-fast: false
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@master
78+
79+
- name: Compile all examples
80+
uses: ArminJo/arduino-test-compile@v2
81+
with:
82+
required-libraries: ${{ env.REQUIRED_LIBRARIES }}
83+
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
84+
platform-default-url: ${{ env.PLATFORM_DEFAULT_URL }}
85+
platform-url: ${{ matrix.platform-url }}
86+
examples-exclude: ${{ matrix.examples-exclude }}
87+
examples-build-properties: ${{ toJson(matrix.examples-build-properties) }}

cores/arduino/ard_sup/analog/ap3_analog.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,8 @@ ap3_err_t ap3_pwm_output(uint8_t pin, uint32_t th, uint32_t fw, uint32_t clk)
538538

539539
// if timer is running wait for timer value to roll over (will indicate that at least one pulse has been emitted)
540540
AM_CRITICAL_BEGIN // critical section when reading / writing config registers
541-
if (*((uint32_t *)CTIMERADDRn(CTIMER, timer, CTRL0)) & (CTIMER_CTRL0_TMRA0EN_Msk | CTIMER_CTRL0_TMRB0EN_Msk))
541+
if ((segment == AM_HAL_CTIMER_TIMERA && *((uint32_t *)CTIMERADDRn(CTIMER, timer, CTRL0)) & (CTIMER_CTRL0_TMRA0EN_Msk)) ||
542+
(segment == AM_HAL_CTIMER_TIMERB && *((uint32_t *)CTIMERADDRn(CTIMER, timer, CTRL0)) & (CTIMER_CTRL0_TMRB0EN_Msk)))
542543
{
543544
uint32_t current = 0;
544545
uint32_t last = 0;
@@ -548,11 +549,10 @@ ap3_err_t ap3_pwm_output(uint8_t pin, uint32_t th, uint32_t fw, uint32_t clk)
548549
current = am_hal_ctimer_read(timer, segment);
549550
} while (current >= last);
550551
}
551-
552552
AM_CRITICAL_END // end critical section
553553

554-
// clear timer (also stops the timer)
555-
am_hal_ctimer_clear(timer, segment);
554+
// clear timer (also stops the timer)
555+
am_hal_ctimer_clear(timer, segment);
556556

557557
// Configure the repeated pulse mode with our clock source
558558
am_hal_ctimer_config_single(timer,

libraries/Wire/src/Wire.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -373,17 +373,17 @@ TwoWire Wire1(AP3_Wire1_IOM);
373373
#endif
374374

375375
#if WIRE_INTERFACES_COUNT > 2
376-
TwoWire Wire2(AP3_Wire1_IOM);
376+
TwoWire Wire2(AP3_Wire2_IOM);
377377
#endif
378378

379379
#if WIRE_INTERFACES_COUNT > 3
380-
TwoWire Wire3(AP3_Wire1_IOM);
380+
TwoWire Wire3(AP3_Wire3_IOM);
381381
#endif
382382

383383
#if WIRE_INTERFACES_COUNT > 4
384-
TwoWire Wire4(AP3_Wire1_IOM);
384+
TwoWire Wire4(AP3_Wire4_IOM);
385385
#endif
386386

387387
#if WIRE_INTERFACES_COUNT > 5
388-
TwoWire Wire5(AP3_Wire1_IOM);
388+
TwoWire Wire5(AP3_Wire5_IOM);
389389
#endif

0 commit comments

Comments
 (0)