From a3564e0434bd2a5218ac4d202673639f5b4f85a8 Mon Sep 17 00:00:00 2001 From: mitchellp Date: Mon, 20 Nov 2017 10:24:41 +0800 Subject: [PATCH 1/2] samd21e sercom compatibility Make sercom4 and sercom5 optional to allow compilation of samd21e variants. --- cores/arduino/SERCOM.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cores/arduino/SERCOM.cpp b/cores/arduino/SERCOM.cpp index 42c46d015..b0ce58793 100644 --- a/cores/arduino/SERCOM.cpp +++ b/cores/arduino/SERCOM.cpp @@ -370,7 +370,7 @@ void SERCOM::enableWIRE() { // I2C Master and Slave modes share the ENABLE bit function. - // Enable the I�C master mode + // Enable the I²C master mode sercom->I2CM.CTRLA.bit.ENABLE = 1 ; while ( sercom->I2CM.SYNCBUSY.bit.ENABLE != 0 ) @@ -391,7 +391,7 @@ void SERCOM::disableWIRE() { // I2C Master and Slave modes share the ENABLE bit function. - // Enable the I�C master mode + // Enable the I²C master mode sercom->I2CM.CTRLA.bit.ENABLE = 0 ; while ( sercom->I2CM.SYNCBUSY.bit.ENABLE != 0 ) @@ -662,16 +662,20 @@ void SERCOM::initClockNVIC( void ) clockId = GCM_SERCOM3_CORE; IdNvic = SERCOM3_IRQn; } + #if defined(SERCOM4) else if(sercom == SERCOM4) { clockId = GCM_SERCOM4_CORE; IdNvic = SERCOM4_IRQn; } + #endif // SERCOM4 + #if defined(SERCOM5) else if(sercom == SERCOM5) { clockId = GCM_SERCOM5_CORE; IdNvic = SERCOM5_IRQn; } + #endif // SERCOM5 if ( IdNvic == PendSV_IRQn ) { From 6a44349ebb4dd72e28dd0737e983ca3a48403b0b Mon Sep 17 00:00:00 2001 From: mitchellp Date: Tue, 21 Nov 2017 08:15:54 +0800 Subject: [PATCH 2/2] Revert encoding on I2C --- cores/arduino/SERCOM.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cores/arduino/SERCOM.cpp b/cores/arduino/SERCOM.cpp index b0ce58793..ecf7c5da3 100644 --- a/cores/arduino/SERCOM.cpp +++ b/cores/arduino/SERCOM.cpp @@ -370,7 +370,7 @@ void SERCOM::enableWIRE() { // I2C Master and Slave modes share the ENABLE bit function. - // Enable the I²C master mode + // Enable the I�C master mode sercom->I2CM.CTRLA.bit.ENABLE = 1 ; while ( sercom->I2CM.SYNCBUSY.bit.ENABLE != 0 ) @@ -391,7 +391,7 @@ void SERCOM::disableWIRE() { // I2C Master and Slave modes share the ENABLE bit function. - // Enable the I²C master mode + // Enable the I�C master mode sercom->I2CM.CTRLA.bit.ENABLE = 0 ; while ( sercom->I2CM.SYNCBUSY.bit.ENABLE != 0 )