Skip to content

Commit 3399d54

Browse files
committed
Merge remote-tracking branch 'origin/master' into jerryn_tick
2 parents e09d950 + 321fa20 commit 3399d54

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+685
-144
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ env:
1616
- TRAVIS_BOARD=itsybitsy_m4_express
1717
- TRAVIS_BOARD=metro_m0_express
1818
- TRAVIS_BOARD=metro_m4_express
19-
- TRAVIS_BOARD=metro_m4_express_revb
2019
- TRAVIS_BOARD=pirkey_m0
2120
- TRAVIS_BOARD=trinket_m0
2221
- TRAVIS_BOARD=gemma_m0

ports/atmel-samd/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ INC += -I. \
3939
-Iasf4/$(CHIP_FAMILY)/hpl/gclk \
4040
-Iasf4/$(CHIP_FAMILY)/hpl/pm \
4141
-Iasf4/$(CHIP_FAMILY)/hpl/port \
42+
-Iasf4/$(CHIP_FAMILY)/hpl/rtc \
4243
-Iasf4/$(CHIP_FAMILY)/hpl/tc \
4344
-Iasf4/$(CHIP_FAMILY)/include \
4445
-Iasf4/$(CHIP_FAMILY)/CMSIS/Include \
@@ -173,6 +174,7 @@ SRC_ASF := \
173174
gcc/system_$(CHIP_FAMILY).c \
174175
hal/src/hal_adc_sync.c \
175176
hal/src/hal_atomic.c \
177+
hal/src/hal_calendar.c \
176178
hal/src/hal_dac_sync.c \
177179
hal/src/hal_delay.c \
178180
hal/src/hal_flash.c \
@@ -278,13 +280,17 @@ SRC_COMMON_HAL = \
278280
microcontroller/Processor.c \
279281
neopixel_write/__init__.c \
280282
os/__init__.c \
283+
rtc/__init__.c \
284+
rtc/RTC.c \
281285
storage/__init__.c \
282286
supervisor/__init__.c \
283287
supervisor/Runtime.c \
284288
time/__init__.c \
285289
analogio/__init__.c \
286290
analogio/AnalogIn.c \
287291
analogio/AnalogOut.c \
292+
nvm/__init__.c \
293+
nvm/ByteArray.c \
288294
pulseio/__init__.c \
289295
pulseio/PulseIn.c \
290296
pulseio/PulseOut.c \
@@ -293,9 +299,7 @@ SRC_COMMON_HAL = \
293299
usb_hid/Device.c \
294300
audioio/__init__.c \
295301
audioio/AudioOut.c \
296-
# nvm/__init__.c \
297-
audiobusio/PDMIn.c \
298-
nvm/ByteArray.c \
302+
# audiobusio/PDMIn.c \
299303
touchio/__init__.c \
300304
touchio/TouchIn.c \
301305

ports/atmel-samd/asf4_conf/samd21/hpl_gclk_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@
190190
// <i> Indicates whether generic clock 2 configuration is enabled or not
191191
// <id> enable_gclk_gen_2
192192
#ifndef CONF_GCLK_GENERATOR_2_CONFIG
193-
#define CONF_GCLK_GENERATOR_2_CONFIG 0
193+
#define CONF_GCLK_GENERATOR_2_CONFIG 1
194194
#endif
195195

196196
// <h> Generic Clock Generator Control
@@ -205,7 +205,7 @@
205205
// <i> Indicates whether Divide Selection is enabled or not
206206
// <id> gclk_gen_2_div_sel
207207
#ifndef CONF_GCLK_GEN_2_DIVSEL
208-
#define CONF_GCLK_GEN_2_DIVSEL 0
208+
#define CONF_GCLK_GEN_2_DIVSEL 1
209209
#endif
210210

211211
// <q> Output Enable
@@ -233,7 +233,7 @@
233233
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
234234
// <id> gclk_arch_gen_2_enable
235235
#ifndef CONF_GCLK_GEN_2_GENEN
236-
#define CONF_GCLK_GEN_2_GENEN 0
236+
#define CONF_GCLK_GEN_2_GENEN 1
237237
#endif
238238

239239
// <y> Generic clock generator 2 source
@@ -268,7 +268,7 @@
268268
// <i>
269269
// <id> gclk_gen_2_div
270270
#ifndef CONF_GCLK_GEN_2_DIV
271-
#define CONF_GCLK_GEN_2_DIV 1
271+
#define CONF_GCLK_GEN_2_DIV 4
272272
#endif
273273

274274
// </h>

ports/atmel-samd/asf4_conf/samd21/hpl_rtc_config.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
#define CONF_RTC_ENABLE 1
1111
#endif
1212

13+
// <q> Force reset RTC on initialization
14+
// <i> Force RTC to reset on initialization, else init is not going on if RTC is already enabled.
15+
// <i> Note that the previous power down data in RTC is lost if it's enabled.
16+
// <id> rtc_arch_init_reset
17+
#ifndef CONF_RTC_INIT_RESET
18+
#define CONF_RTC_INIT_RESET 0
19+
#endif
20+
1321
// <o> Prescaler configuration
1422
// <0x0=>Peripheral clock divided by 1
1523
// <0x1=>Peripheral clock divided by 2
@@ -25,7 +33,7 @@
2533
// <i> These bits define the RTC clock relative to the peripheral clock
2634
// <id> rtc_arch_prescaler
2735
#ifndef CONF_RTC_PRESCALER
28-
#define CONF_RTC_PRESCALER 0x0
36+
#define CONF_RTC_PRESCALER 0xa
2937

3038
#endif
3139

ports/atmel-samd/asf4_conf/samd21/hpl_sysctrl_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
// <i> Default: 122 us
275275
// <id> xosc32k_arch_startup
276276
#ifndef CONF_XOSC32K_STARTUP
277-
#define CONF_XOSC32K_STARTUP CONF_XOSC32K_STARTUP_TIME_122MCS
277+
#define CONF_XOSC32K_STARTUP CONF_XOSC32K_STARTUP_TIME_2000092MCS
278278
#endif
279279

280280
// </h>

ports/atmel-samd/asf4_conf/samd21/peripheral_clk_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321

322322
// <i> Select the clock source for RTC.
323323
#ifndef CONF_GCLK_RTC_SRC
324-
#define CONF_GCLK_RTC_SRC GCLK_CLKCTRL_GEN_GCLK0_Val
324+
#define CONF_GCLK_RTC_SRC GCLK_CLKCTRL_GEN_GCLK2_Val
325325
#endif
326326

327327
/**

ports/atmel-samd/asf4_conf/samd51/hpl_gclk_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
// <i> Indicates whether generic clock 2 configuration is enabled or not
173173
// <id> enable_gclk_gen_2
174174
#ifndef CONF_GCLK_GENERATOR_2_CONFIG
175-
#define CONF_GCLK_GENERATOR_2_CONFIG 0
175+
#define CONF_GCLK_GENERATOR_2_CONFIG 1
176176
#endif
177177

178178
// <h> Generic Clock Generator Control
@@ -188,7 +188,7 @@
188188
// <i> This defines the clock source for generic clock generator 2
189189
// <id> gclk_gen_2_oscillator
190190
#ifndef CONF_GCLK_GEN_2_SOURCE
191-
#define CONF_GCLK_GEN_2_SOURCE GCLK_GENCTRL_SRC_XOSC1
191+
#define CONF_GCLK_GEN_2_SOURCE GCLK_GENCTRL_SRC_OSCULP32K
192192
#endif
193193

194194
// <q> Run in Standby
@@ -230,15 +230,15 @@
230230
// <i> Indicates whether Generic Clock Generator Enable is enabled or not
231231
// <id> gclk_arch_gen_2_enable
232232
#ifndef CONF_GCLK_GEN_2_GENEN
233-
#define CONF_GCLK_GEN_2_GENEN 0
233+
#define CONF_GCLK_GEN_2_GENEN 1
234234
#endif
235235
// </h>
236236

237237
//<h> Generic Clock Generator Division
238238
//<o> Generic clock generator 2 division <0x0000-0xFFFF>
239239
// <id> gclk_gen_2_div
240240
#ifndef CONF_GCLK_GEN_2_DIV
241-
#define CONF_GCLK_GEN_2_DIV 1
241+
#define CONF_GCLK_GEN_2_DIV 4
242242
#endif
243243
// </h>
244244
// </e>

ports/atmel-samd/asf4_conf/samd51/hpl_rtc_config.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@
1010
#define CONF_RTC_ENABLE 1
1111
#endif
1212

13+
// <q> Force reset RTC on initialization
14+
// <i> Force RTC to reset on initialization.
15+
// <i> Note that the previous power down data in RTC is lost if it's enabled.
16+
// <id> rtc_arch_init_reset
17+
#ifndef CONF_RTC_INIT_RESET
18+
#define CONF_RTC_INIT_RESET 0
19+
#endif
20+
1321
// <o> Prescaler configuration
1422
// <0x0=>OFF(Peripheral clock divided by 1)
1523
// <0x1=>Peripheral clock divided by 1
@@ -26,7 +34,7 @@
2634
// <i> These bits define the RTC clock relative to the peripheral clock
2735
// <id> rtc_arch_prescaler
2836
#ifndef CONF_RTC_PRESCALER
29-
#define CONF_RTC_PRESCALER 0x0
37+
#define CONF_RTC_PRESCALER 0xb
3038

3139
#endif
3240

ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@
4242

4343
// If you change this, then make sure to update the linker scripts as well to
4444
// make sure you don't overwrite code.
45-
// #define CIRCUITPY_INTERNAL_NVM_SIZE 256
46-
#define CIRCUITPY_INTERNAL_NVM_SIZE 0
45+
#define CIRCUITPY_INTERNAL_NVM_SIZE 256
4746

4847
#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE)
4948

0 commit comments

Comments
 (0)