Skip to content

Commit 7d3940a

Browse files
author
oclyke
committed
Merge branch 'master' into core-ble
2 parents c3a3c8e + 2cc5ab4 commit 7d3940a

File tree

17 files changed

+741
-146
lines changed

17 files changed

+741
-146
lines changed

Diff for: .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) }}

Diff for: cores/arduino/am_sdk_ap3/mcu/apollo3/hal/am_hal_uart.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ am_hal_uart_transfer_t;
172172

173173
// Flow control
174174
#define AM_HAL_UART_FLOW_CTRL_NONE 0
175-
#define AM_HAL_UART_FLOW_CTRL_CTS_ONLY UART_CR_CTSEN_Msk
176-
#define AM_HAL_UART_FLOW_CTRL_RTS_ONLY UART_CR_RTSEN_Msk
175+
#define AM_HAL_UART_FLOW_CTRL_CTS_ONLY UART0_CR_CTSEN_Msk
176+
#define AM_HAL_UART_FLOW_CTRL_RTS_ONLY UART0_CR_RTSEN_Msk
177177
#define AM_HAL_UART_FLOW_CTRL_RTS_CTS (UART0_CR_CTSEN_Msk | \
178178
UART0_CR_RTSEN_Msk)
179179
// FIFO enable/disable.

Diff for: 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,

Diff for: cores/arduino/ard_sup/uart/ap3_uart.cpp

+18-2
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,22 @@ ap3_err_t Uart::set_config(HardwareSerial_Config_e HWSconfig)
296296
retval = AP3_INVALID_ARG;
297297
break;
298298
}
299+
300+
//Setup flow control
301+
_config.ui32FlowControl = AM_HAL_UART_FLOW_CTRL_NONE;
302+
if(_pinRTS != AP3_UART_PIN_UNUSED && _pinCTS != AP3_UART_PIN_UNUSED)
303+
{
304+
_config.ui32FlowControl = AM_HAL_UART_FLOW_CTRL_RTS_CTS;
305+
}
306+
else if(_pinRTS != AP3_UART_PIN_UNUSED)
307+
{
308+
_config.ui32FlowControl = AM_HAL_UART_FLOW_CTRL_RTS_ONLY;
309+
}
310+
else if(_pinCTS != AP3_UART_PIN_UNUSED)
311+
{
312+
_config.ui32FlowControl = AM_HAL_UART_FLOW_CTRL_CTS_ONLY;
313+
}
314+
299315
return retval;
300316
}
301317

@@ -375,7 +391,7 @@ ap3_err_t Uart::_begin(void)
375391

376392
if (_pinRTS != AP3_UART_PIN_UNUSED)
377393
{
378-
retval = ap3_uart_pad_funcsel(_instance, AP3_UART_TX, ap3_gpio_pin2pad(_pinRTS), &funcsel);
394+
retval = ap3_uart_pad_funcsel(_instance, AP3_UART_RTS, ap3_gpio_pin2pad(_pinRTS), &funcsel);
379395
if (retval != AP3_OK)
380396
{
381397
return retval;
@@ -391,7 +407,7 @@ ap3_err_t Uart::_begin(void)
391407

392408
if (_pinCTS != AP3_UART_PIN_UNUSED)
393409
{
394-
retval = ap3_uart_pad_funcsel(_instance, AP3_UART_RX, ap3_gpio_pin2pad(_pinCTS), &funcsel);
410+
retval = ap3_uart_pad_funcsel(_instance, AP3_UART_CTS, ap3_gpio_pin2pad(_pinCTS), &funcsel);
395411
if (retval != AP3_OK)
396412
{
397413
return retval;

Diff for: keywords.txt

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#######################################
2+
# Syntax Coloring Map For Wire
3+
#######################################
4+
5+
#######################################
6+
# Datatypes (KEYWORD1)
7+
#######################################
8+
9+
#######################################
10+
# Methods and Functions (KEYWORD2)
11+
#######################################
12+
13+
enableBurstMode KEYWORD2
14+
disableBurstMode KEYWORD2
15+
getCpuFreqMHz KEYWORD2
16+
17+
getInternalTemp KEYWORD2
18+
19+
analogWriteResolution KEYWORD2
20+
analogWriteFrameWidth KEYWORD2
21+
analogWriteFrequency KEYWORD2
22+
servoWrite KEYWORD2
23+
24+
enableFastShift KEYWORD2
25+
fastShiftOut KEYWORD2
26+
fastShiftIn KEYWORD2
27+
28+
secs KEYWORD2
29+
systicks KEYWORD2
30+
sysoverflows KEYWORD2
31+
32+
#######################################
33+
# Instances (KEYWORD2)
34+
#######################################
35+
36+
#######################################
37+
# Constants (LITERAL1)
38+
#######################################
39+

Diff for: libraries/RTC/examples/Example1_getTime/Example1_getTime.ino renamed to libraries/RTC/examples/Example1_Get_Time/Example1_Get_Time.ino

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
/* Author: Nathan Seidle
1+
/*
2+
Author: Nathan Seidle
23
Created: Septempter 27th, 2019
34
License: MIT. See SparkFun Arduino Apollo3 Project for more information
45
5-
This example demonstrates how to initialize and read from the on board RTC.
6+
This example demonstrates how to initialize and read from the on-board RTC.
7+
68
Most SparkFun Artemis boards have the necessary external 32kHz crystal to
79
enable the RTC. If you are using the Artemis module bare you will either
810
need an external 32kHz xtal or use the internal LFRC. Read the datasheet
@@ -11,16 +13,19 @@
1113
This example is based on the Ambiq SDK EVB2 RTC example.
1214
*/
1315

14-
#include "RTC.h" //Include RTC library included with the Aruino_Apollo3 core
15-
APM3_RTC myRTC; //Create instance of RTC class
16+
#include "RTC.h" // Include RTC library included with the Aruino_Apollo3 core
17+
APM3_RTC myRTC; // Create instance of RTC class
1618

1719
void setup()
1820
{
1921
Serial.begin(115200);
2022
Serial.println("SparkFun RTC Example");
2123

22-
myRTC.setToCompilerTime(); //Easily set RTC using the system __DATE__ and __TIME__ macros from compiler
23-
//myRTC.setTime(7, 28, 51, 0, 21, 10, 15); //Manually set RTC back to the future: Oct 21st, 2015 at 7:28.51 AM
24+
// Easily set RTC using the system __DATE__ and __TIME__ macros from compiler
25+
myRTC.setToCompilerTime();
26+
27+
// Manually set RTC date and time
28+
//myRTC.setTime(12, 59, 50, 0, 3, 6, 20); // 12:59:50.000, June 3rd, 2020 (hund, ss, mm, hh, dd, mm, yy)
2429
}
2530

2631
void loop()

Diff for: libraries/RTC/examples/Example2_RTCwithSleep/Example2_RTCwithSleep.ino

-81
This file was deleted.

0 commit comments

Comments
 (0)