summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Siepert <bsiepert@lbl.gov>2018-02-07 21:23:25 -0800
committerBryan Siepert <bsiepert@lbl.gov>2018-02-07 21:23:25 -0800
commitdfc2b82ede0dc414e4879ac139c7d406cd874188 (patch)
treed2bdbd3ab5877181af92c89781c6c1cdeb3f2f19
parent71128b575f04a218948ee9a402c5ac5d0682cacf (diff)
Added SAMD51G support as per issue #597
-rw-r--r--ports/atmel-samd/samd51_pins.c8
-rw-r--r--ports/atmel-samd/supervisor/port.c13
2 files changed, 15 insertions, 6 deletions
diff --git a/ports/atmel-samd/samd51_pins.c b/ports/atmel-samd/samd51_pins.c
index ecdbc2969..41114fe11 100644
--- a/ports/atmel-samd/samd51_pins.c
+++ b/ports/atmel-samd/samd51_pins.c
@@ -251,7 +251,11 @@ PIN(PB07, EXTINT_CHANNEL(7), NO_ADC, ADC_INPUT(9),
PIN(PB08, EXTINT_CHANNEL(8), ADC_INPUT(2), ADC_INPUT(0), TOUCH(1),
NO_SERCOM,
SERCOM(4, 0),
+ #ifdef TC4
TC(TC4, 0),
+ #else
+ NO_TIMER,
+ #endif
NO_TIMER,
NO_TIMER);
#endif
@@ -259,7 +263,11 @@ PIN(PB08, EXTINT_CHANNEL(8), ADC_INPUT(2), ADC_INPUT(0), TOUCH(1),
PIN(PB09, EXTINT_CHANNEL(9), ADC_INPUT(3), ADC_INPUT(1), TOUCH(2),
NO_SERCOM,
SERCOM(4, 1),
+ #ifdef TC4
TC(TC4, 1),
+ #else
+ NO_TIMER,
+ #endif
NO_TIMER,
NO_TIMER);
#endif
diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c
index 1de6b856d..8c8045c00 100644
--- a/ports/atmel-samd/supervisor/port.c
+++ b/ports/atmel-samd/supervisor/port.c
@@ -119,12 +119,13 @@ safe_mode_t port_init(void) {
// port_pin_set_output_level(MICROPY_HW_LED1, false);
// Output clocks for debugging.
- #ifdef SAMD51
- gpio_set_pin_function(PIN_PA10, GPIO_PIN_FUNCTION_M); // GCLK4, D3
- gpio_set_pin_function(PIN_PA11, GPIO_PIN_FUNCTION_M); // GCLK5, A4
- gpio_set_pin_function(PIN_PB14, GPIO_PIN_FUNCTION_M); // GCLK0, D5
- gpio_set_pin_function(PIN_PB15, GPIO_PIN_FUNCTION_M); // GCLK1, D6
- #endif
+ // not supported by SAMD51G; uncomment for SAMD51J or update for 51G
+ // #ifdef SAMD51
+ // gpio_set_pin_function(PIN_PA10, GPIO_PIN_FUNCTION_M); // GCLK4, D3
+ // gpio_set_pin_function(PIN_PA11, GPIO_PIN_FUNCTION_M); // GCLK5, A4
+ // gpio_set_pin_function(PIN_PB14, GPIO_PIN_FUNCTION_M); // GCLK0, D5
+ // gpio_set_pin_function(PIN_PB15, GPIO_PIN_FUNCTION_M); // GCLK1, D6
+ // #endif
// Init the nvm controller.
// struct nvm_config config_nvm;